From e9784b1219b94b884d22c69e7f674484c48216c6 Mon Sep 17 00:00:00 2001 From: volth Date: Mon, 13 May 2019 03:54:44 +0000 Subject: [PATCH] data/fonts: fonts made with fontforge are not fixed-output --- pkgs/data/fonts/dejavu-fonts/default.nix | 21 ++++--------------- pkgs/data/fonts/inconsolata/lgc.nix | 16 +++----------- pkgs/data/fonts/libertine/default.nix | 17 +++++---------- pkgs/data/fonts/monoid/default.nix | 9 ++------ .../fonts/redhat-liberation-fonts/default.nix | 19 +++++++---------- .../rictydiminished-with-firacode/default.nix | 7 +------ pkgs/data/fonts/unscii/default.nix | 19 ++++++----------- pkgs/data/fonts/xits-math/default.nix | 7 +------ 8 files changed, 29 insertions(+), 86 deletions(-) diff --git a/pkgs/data/fonts/dejavu-fonts/default.nix b/pkgs/data/fonts/dejavu-fonts/default.nix index fa877ea6ed53..e563d201ff3d 100644 --- a/pkgs/data/fonts/dejavu-fonts/default.nix +++ b/pkgs/data/fonts/dejavu-fonts/default.nix @@ -38,38 +38,25 @@ let preBuild = "patchShebangs scripts"; - installPhase = '' - mkdir -p $out/share/fonts/truetype - cp build/*.ttf $out/share/fonts/truetype/ - ''; + installPhase = "install -m444 -Dt $out/share/fonts/truetype build/*.ttf"; - 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 + install -m444 -Dt $out/share/fonts/truetype ${full-ttf}/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/ + install -m444 -Dt $out/share/fonts/truetype ${full-ttf}/share/fonts/truetype/*.ttf ln -s --relative --force --target-directory=$out/share/fonts/truetype ${minimal}/share/fonts/truetype/DejaVuSans.ttf ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "15l93xm9mg2ziaxv4nqy2a4jaz54d05xf0hfz1h84bclzb882llh"; inherit meta; - passthru.minimal = minimal; + passthru = { inherit minimal full-ttf; }; } diff --git a/pkgs/data/fonts/inconsolata/lgc.nix b/pkgs/data/fonts/inconsolata/lgc.nix index 8563e0e112ac..8b5570081757 100644 --- a/pkgs/data/fonts/inconsolata/lgc.nix +++ b/pkgs/data/fonts/inconsolata/lgc.nix @@ -14,20 +14,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ fontforge ]; installPhase = '' - mkdir -p $out/share/fonts/truetype - cp -v $(find . -name '*.ttf') $out/share/fonts/truetype - - mkdir -p $out/share/fonts/opentype - cp -v $(find . -name '*.otf') $out/share/fonts/opentype - - mkdir -p "$out/doc/${name}" - cp -v AUTHORS ChangeLog COPYING License.txt README "$out/doc/${name}" || true + find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/truetype {} \; + find . -name '*.otf' -exec install -m444 -Dt $out/share/fonts/opentype {} \; + install -m444 -Dt $out/share/doc/${name} LICENSE README ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "18brmw0h4hjq1m2l0abwc3zmib4rnfalpywdk68djm711zldxr76"; - meta = with stdenv.lib; { description = "Fork of Inconsolata font, with proper support of Cyrillic and Greek"; longDescription = '' @@ -57,6 +48,5 @@ stdenv.mkDerivation rec { license = licenses.ofl; homepage = https://github.com/MihailJP/Inconsolata-LGC; maintainers = with maintainers; [ avnik rht ]; - platforms = platforms.linux; }; } diff --git a/pkgs/data/fonts/libertine/default.nix b/pkgs/data/fonts/libertine/default.nix index 748c0268a80f..2152b960cdc2 100644 --- a/pkgs/data/fonts/libertine/default.nix +++ b/pkgs/data/fonts/libertine/default.nix @@ -31,23 +31,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' - mkdir -p $out/share/fonts/{opentype,truetype,type1}/public - mkdir -p $out/share/texmf/fonts/{enc,map} - cp *.otf $out/share/fonts/opentype/public - cp *.ttf $out/share/fonts/truetype/public - cp *.pfb $out/share/fonts/type1/public - cp *.enc $out/share/texmf/fonts/enc - cp *.map $out/share/texmf/fonts/map + install -m444 -Dt $out/share/fonts/opentype/public *.otf + install -m444 -Dt $out/share/fonts/truetype/public *.ttf + install -m444 -Dt $out/share/fonts/type1/public *.pfb + install -m444 -Dt $out/share/texmf/fonts/enc *.enc + install -m444 -Dt $out/share/texmf/fonts/map *.map ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "1mj0j0hkp8pn7jcs4pvcan6whba60bfd671g3vhx3s9kxwf7xjvr"; - meta = with stdenv.lib; { description = "Linux Libertine Fonts"; homepage = http://linuxlibertine.sf.net; - platforms = platforms.linux; maintainers = [ maintainers.volth ]; license = licenses.ofl; }; diff --git a/pkgs/data/fonts/monoid/default.nix b/pkgs/data/fonts/monoid/default.nix index 77c311ce364c..2bc5a82fa94f 100644 --- a/pkgs/data/fonts/monoid/default.nix +++ b/pkgs/data/fonts/monoid/default.nix @@ -24,15 +24,10 @@ stdenv.mkDerivation rec { ''; installPhase = '' - mkdir -p $out/share/{doc,fonts/truetype} - cp -va _release/* $out/share/fonts/truetype - cp -va Readme.md $out/share/doc + install -m444 -Dt $out/share/fonts/truetype _release/* + install -m444 -Dt $out/share/doc Readme.md ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "0lbipgygiva3gg1pqw07phpnnf0s6ka9vqdk1pw7bkybjw3f7wzm"; - meta = with stdenv.lib; { homepage = http://larsenwork.com/monoid; description = "Customisable coding font with alternates, ligatures and contextual positioning"; diff --git a/pkgs/data/fonts/redhat-liberation-fonts/default.nix b/pkgs/data/fonts/redhat-liberation-fonts/default.nix index 0ee2a0c308c5..61206ca5d14b 100644 --- a/pkgs/data/fonts/redhat-liberation-fonts/default.nix +++ b/pkgs/data/fonts/redhat-liberation-fonts/default.nix @@ -4,7 +4,7 @@ let inherit (python3.pkgs) fonttools; common = - { version, repo, sha256, nativeBuildInputs, postPatch ? null, outputHash }: + { version, repo, sha256, nativeBuildInputs, postPatch ? null }: stdenv.mkDerivation rec { pname = "liberation-fonts"; inherit version; @@ -18,17 +18,15 @@ let inherit nativeBuildInputs postPatch; installPhase = '' - mkdir -p $out/share/fonts/truetype - cp -v $( find . -name '*.ttf') $out/share/fonts/truetype + find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/truetype {} \; - mkdir -p "$out/share/doc/${pname}-${version}" - cp -v AUTHORS ChangeLog COPYING License.txt README "$out/share/doc/${pname}-${version}" || true + install -m444 -Dt $out/share/doc/${pname}-${version} AUTHORS || true + install -m444 -Dt $out/share/doc/${pname}-${version} ChangeLog || true + install -m444 -Dt $out/share/doc/${pname}-${version} COPYING || true + install -m444 -Dt $out/share/doc/${pname}-${version} License.txt || true + install -m444 -Dt $out/share/doc/${pname}-${version} README || true ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - inherit outputHash; - meta = with stdenv.lib; { description = "Liberation Fonts, replacements for Times New Roman, Arial, and Courier New"; longDescription = '' @@ -48,7 +46,6 @@ let maintainers = [ maintainers.raskin ]; - platforms = platforms.unix; }; }; @@ -58,7 +55,6 @@ in { version = "1.07.5"; nativeBuildInputs = [ fontforge ]; sha256 = "1ffl10mf78hx598sy9qr5m6q2b8n3mpnsj73bwixnd4985gsz56v"; - outputHash = "16jn17p22z2vip58aza2dfg1ri31ki6z3hsnmidfqfi7v8k83vq4"; }; liberation_ttf_v2 = common rec { repo = "liberation-fonts"; @@ -70,6 +66,5 @@ in { 'font = ttLib.TTFont(fontfile, recalcTimestamp=False)' ''; sha256 = "14bn1zlhyr4qaz5z2sx4h115pnbd41ix1vky8fxm2lx76xrjjiaa"; - outputHash = "14c0c5n4vzd5y0hf9jkh48h12kkd8hlg94npbmv41j449g6wv6vn"; }; } diff --git a/pkgs/data/fonts/rictydiminished-with-firacode/default.nix b/pkgs/data/fonts/rictydiminished-with-firacode/default.nix index 10d4678de059..2bdb96228d9c 100644 --- a/pkgs/data/fonts/rictydiminished-with-firacode/default.nix +++ b/pkgs/data/fonts/rictydiminished-with-firacode/default.nix @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { ''; installPhase = '' - mkdir -p $out/share/fonts/rictydiminished-with-firacode - cp *.ttf $out/share/fonts/rictydiminished-with-firacode + install -m444 -Dt $out/share/fonts/rictydiminished-with-firacode *.ttf ''; nativeBuildInputs = [ @@ -35,10 +34,6 @@ stdenv.mkDerivation rec { ])) ]; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "09ldviapljn4bb1mcxap2pkz7cq3wr2k2qialbnav5y7ii82acd4"; - meta = with stdenv.lib; { homepage = https://github.com/hakatashi/RictyDiminished-with-FiraCode; description = "The best Japanese programming font meets the awesone ligatures of Firacode"; diff --git a/pkgs/data/fonts/unscii/default.nix b/pkgs/data/fonts/unscii/default.nix index c4969d046d48..6d169e940cf9 100644 --- a/pkgs/data/fonts/unscii/default.nix +++ b/pkgs/data/fonts/unscii/default.nix @@ -8,25 +8,19 @@ stdenv.mkDerivation rec { url = "http://pelulamu.net/${pname}/${name}-src.tar.gz"; sha256 = "0qcxcnqz2nlwfzlrn115kkp3n8dd7593h762vxs6vfqm13i39lq1"; }; - nativeBuildInputs = [perl bdftopcf perlPackages.TextCharWidth fontforge + nativeBuildInputs = [perl bdftopcf perlPackages.TextCharWidth fontforge SDL SDL_image]; preConfigure = '' patchShebangs . ''; installPhase = '' - mkdir -p "$out/share/fonts"/{truetype,opentype,web,svg} - cp *.hex "$out/share/fonts/" - cp *.pcf "$out/share/fonts/" - cp *.ttf "$out/share/fonts/truetype" - cp *.otf "$out/share/fonts/opentype" - cp *.svg "$out/share/fonts/svg" - cp *.woff "$out/share/fonts/web" + install -m444 -Dt $out/share/fonts *.hex *.pcf + install -m444 -Dt $out/share/fonts/truetype *.ttf + install -m444 -Dt $out/share/fonts/opentype *.otf + install -m444 -Dt $out/share/fonts/svg *.svg + install -m444 -Dt $out/share/fonts/web *.woff ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "03zvczdka665zcyf9fjrnx434mwpr5q8396j34kjmc67w7nhc49r"; - meta = { inherit version; description = ''Bitmapped character-art-friendly Unicode fonts''; @@ -34,7 +28,6 @@ stdenv.mkDerivation rec { # version. The reduced version is public domain. license = http://unifoundry.com/LICENSE.txt; maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.linux; homepage = http://pelulamu.net/unscii/; }; } diff --git a/pkgs/data/fonts/xits-math/default.nix b/pkgs/data/fonts/xits-math/default.nix index 25431c7f9d70..1aa103adefbb 100644 --- a/pkgs/data/fonts/xits-math/default.nix +++ b/pkgs/data/fonts/xits-math/default.nix @@ -22,14 +22,9 @@ stdenv.mkDerivation rec { ''; installPhase = '' - mkdir -p $out/share/fonts/opentype - cp *.otf $out/share/fonts/opentype + install -m444 -Dt $out/share/fonts/opentype *.otf ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "00xycmb9ka67j5s66nkng53y8q6362igisxz04zb58r2717jk50m"; - meta = with stdenv.lib; { homepage = https://github.com/khaledhosny/xits-math; description = "OpenType implementation of STIX fonts with math support";