dejavu_fonts: made derivation fixed-output

This commit is contained in:
volth 2017-08-19 13:27:26 +00:00 committed by GitHub
parent 0965a3a8a8
commit dd72f17534

View file

@ -1,34 +1,7 @@
{fetchFromGitHub, stdenv, fontforge, perl, FontTTF}:
let version = "2.37" ; in
stdenv.mkDerivation rec {
name = "dejavu-fonts-${version}";
buildInputs = [fontforge perl FontTTF];
src = fetchFromGitHub {
owner = "dejavu-fonts";
repo = "dejavu-fonts";
rev = "version_${stdenv.lib.replaceStrings ["."] ["_"] version}";
sha256 = "1xknlg2h287dx34v2n5r33bpcl4biqf0cv7nak657rjki7s0k4bk";
};
outputs = [ "out" "minimal" ];
buildFlags = "full-ttf";
preBuild = "patchShebangs scripts";
installPhase = ''
mkdir -p $out/share/fonts/truetype
for i in $(find build -name '*.ttf'); do
cp $i $out/share/fonts/truetype;
done;
'' + ''
local fname=share/fonts/truetype/DejaVuSans.ttf
moveToOutput "$fname" "$minimal"
ln -s "$minimal/$fname" "$out/$fname"
'';
let
version = "2.37";
meta = {
description = "A typeface family based on the Bitstream Vera fonts";
@ -49,4 +22,54 @@ stdenv.mkDerivation rec {
platforms = stdenv.lib.platforms.unix;
};
full-ttf = stdenv.mkDerivation {
name = "dejavu-fonts-full-${version}";
buildInputs = [fontforge perl FontTTF];
src = fetchFromGitHub {
owner = "dejavu-fonts";
repo = "dejavu-fonts";
rev = "version_${stdenv.lib.replaceStrings ["."] ["_"] version}";
sha256 = "1xknlg2h287dx34v2n5r33bpcl4biqf0cv7nak657rjki7s0k4bk";
};
buildFlags = "full-ttf";
preBuild = "patchShebangs scripts";
installPhase = ''
mkdir -p $out/share/fonts/truetype
cp build/*.ttf $out/share/fonts/truetype/
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "1cxprzsr826d888ha4zxx28i9jfj1k74q9kfv3v2rf603460iha9";
inherit meta;
};
minimal = stdenv.mkDerivation {
name = "dejavu-fonts-minimal-${version}";
buildCommand = ''
install -D ${full-ttf}/share/fonts/truetype/DejaVuSans.ttf $out/share/fonts/truetype/DejaVuSans.ttf
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "0ybsynp9904vmd3qv5b438swhx43m5q6gfih3i32iw33rks8nkpj";
inherit meta;
};
in stdenv.mkDerivation {
name = "dejavu-fonts-${version}";
buildCommand = ''
mkdir -p $out/share/fonts/truetype
cp ${full-ttf}/share/fonts/truetype/*.ttf $out/share/fonts/truetype/
ln -s --force ${minimal}/share/fonts/truetype/DejaVuSans.ttf $out/share/fonts/truetype/DejaVuSans.ttf
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "1nf0h15p8yvjx36syq1034i3hix99lm8p54iyjw8dpa19i9jfkmd";
inherit meta;
passthru.minimal = minimal;
}