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