Merge pull request #28393 from volth/patch-54

liberation_ttf: make derivation fixed-output

authored by

Michael Raskin and committed by
GitHub
0965a3a8 77dfa05b

+23 -10
+23 -10
pkgs/data/fonts/redhat-liberation-fonts/default.nix
··· 4 inherit (python2.pkgs) fonttools; 5 6 common = 7 - {version, url, sha256, buildInputs}: 8 stdenv.mkDerivation rec { 9 name = "liberation-fonts-${version}"; 10 src = fetchurl { 11 inherit url sha256; 12 }; 13 14 - inherit buildInputs; 15 16 installPhase = '' 17 mkdir -p $out/share/fonts/truetype 18 cp -v $( find . -name '*.ttf') $out/share/fonts/truetype 19 20 - mkdir -p "$out/doc/${name}" 21 - cp -v AUTHORS ChangeLog COPYING License.txt README "$out/doc/${name}" || true 22 ''; 23 24 meta = with stdenv.lib; { 25 description = "Liberation Fonts, replacements for Times New Roman, Arial, and Courier New"; 26 longDescription = '' ··· 36 ''; 37 38 license = licenses.ofl; 39 - homepage = https://fedorahosted.org/liberation-fonts/; 40 maintainers = [ 41 maintainers.raskin 42 ]; ··· 47 in { 48 liberation_ttf_v1_from_source = common rec { 49 version = "1.07.4"; 50 - url = "https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-${version}.tar.gz"; 51 sha256 = "01jlg88q2s6by7qv6fmnrlx0lwjarrjrpxv811zjz6f2im4vg65d"; 52 - buildInputs = [ fontforge fonttools ]; 53 }; 54 liberation_ttf_v1_binary = common rec { 55 version = "1.07.4"; 56 - url = "https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-ttf-${version}.tar.gz"; 57 sha256 = "0p7frz29pmjlk2d0j2zs5kfspygwdnpzxkb2hwzcfhrafjvf59v1"; 58 buildInputs = [ ]; 59 }; 60 liberation_ttf_v2_from_source = common rec { 61 version = "2.00.1"; 62 - url = "https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-${version}.tar.gz"; 63 sha256 = "1ymryvd2nw4jmw4w5y1i3ll2dn48rpkqzlsgv7994lk6qc9cdjvs"; 64 buildInputs = [ fontforge fonttools ]; 65 }; 66 liberation_ttf_v2_binary = common rec { 67 version = "2.00.1"; 68 - url = "https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-ttf-${version}.tar.gz"; 69 sha256 = "010m4zfqan4w04b6bs9pm3gapn9hsb18bmwwgp2p6y6idj52g43q"; 70 buildInputs = [ ]; 71 }; 72 }
··· 4 inherit (python2.pkgs) fonttools; 5 6 common = 7 + {version, url, sha256, buildInputs, postPatch ? null, outputHash}: 8 stdenv.mkDerivation rec { 9 name = "liberation-fonts-${version}"; 10 src = fetchurl { 11 inherit url sha256; 12 }; 13 14 + inherit buildInputs postPatch; 15 16 installPhase = '' 17 mkdir -p $out/share/fonts/truetype 18 cp -v $( find . -name '*.ttf') $out/share/fonts/truetype 19 20 + mkdir -p "$out/share/doc/${name}" 21 + cp -v AUTHORS ChangeLog COPYING License.txt README "$out/share/doc/${name}" || true 22 ''; 23 24 + outputHashAlgo = "sha256"; 25 + outputHashMode = "recursive"; 26 + inherit outputHash; 27 + 28 meta = with stdenv.lib; { 29 description = "Liberation Fonts, replacements for Times New Roman, Arial, and Courier New"; 30 longDescription = '' ··· 40 ''; 41 42 license = licenses.ofl; 43 + homepage = https://pagure.io/liberation-fonts/; 44 maintainers = [ 45 maintainers.raskin 46 ]; ··· 51 in { 52 liberation_ttf_v1_from_source = common rec { 53 version = "1.07.4"; 54 + url = "https://releases.pagure.org/liberation-fonts/liberation-fonts-${version}.tar.gz"; 55 sha256 = "01jlg88q2s6by7qv6fmnrlx0lwjarrjrpxv811zjz6f2im4vg65d"; 56 + buildInputs = [ fontforge ]; 57 + outputHash = "1q102rmg4004p74f8m4y8a6iklmnva0q39sq260jsq3lhcfypg7p"; 58 }; 59 liberation_ttf_v1_binary = common rec { 60 version = "1.07.4"; 61 + url = "https://releases.pagure.org/liberation-fonts/liberation-fonts-ttf-${version}.tar.gz"; 62 sha256 = "0p7frz29pmjlk2d0j2zs5kfspygwdnpzxkb2hwzcfhrafjvf59v1"; 63 buildInputs = [ ]; 64 + outputHash = "12gwb9b4ij9d93ky4c9ykgp03fqr62axy37pds88q7y6zgciwkab"; 65 }; 66 liberation_ttf_v2_from_source = common rec { 67 version = "2.00.1"; 68 + url = "https://releases.pagure.org/liberation-fonts/liberation-fonts-${version}.tar.gz"; 69 sha256 = "1ymryvd2nw4jmw4w5y1i3ll2dn48rpkqzlsgv7994lk6qc9cdjvs"; 70 buildInputs = [ fontforge fonttools ]; 71 + postPatch = '' 72 + substituteInPlace scripts/setisFixedPitch-fonttools.py --replace \ 73 + 'font = ttLib.TTFont(fontfile)' \ 74 + 'font = ttLib.TTFont(fontfile, recalcTimestamp=False)' 75 + ''; 76 + outputHash = "0nldgawm0a6lpn86w4w3rzx01ns3ph09ar1knq1g4jkxc8ci5rqn"; 77 }; 78 liberation_ttf_v2_binary = common rec { 79 version = "2.00.1"; 80 + url = "https://releases.pagure.org/liberation-fonts/liberation-fonts-ttf-${version}.tar.gz"; 81 sha256 = "010m4zfqan4w04b6bs9pm3gapn9hsb18bmwwgp2p6y6idj52g43q"; 82 buildInputs = [ ]; 83 + outputHash = "19jky9li345zsig9pcb0rnlsjqqclh7r60vbi4pwh16f14850gpk"; 84 }; 85 }