diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-01-25 12:34:24 +0100 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-01-25 12:34:24 +0100 |
commit | 948a25ffd329f30e582aba359d7d76052bdb05dd (patch) | |
tree | b434fd389cd8fc9526faf3c259213df5f46877a3 | |
parent | dc985b7f9016eb00a4c0208ad9a8eb6dbb4d6748 (diff) |
treewide: convert 16 fonts
-rw-r--r-- | pkgs/data/fonts/liberastika/default.nix | 28 | ||||
-rw-r--r-- | pkgs/data/fonts/mph-2b-damase/default.nix | 26 | ||||
-rw-r--r-- | pkgs/data/fonts/mro-unicode/default.nix | 22 | ||||
-rw-r--r-- | pkgs/data/fonts/pretendard/default.nix | 31 | ||||
-rw-r--r-- | pkgs/data/fonts/ruwudu/default.nix | 22 | ||||
-rw-r--r-- | pkgs/data/fonts/sampradaya/default.nix | 24 | ||||
-rw-r--r-- | pkgs/data/fonts/shrikhand/default.nix | 24 | ||||
-rw-r--r-- | pkgs/data/fonts/sil-abyssinica/default.nix | 28 | ||||
-rw-r--r-- | pkgs/data/fonts/sil-padauk/default.nix | 28 | ||||
-rw-r--r-- | pkgs/data/fonts/sitelen-seli-kiwen/default.nix | 25 | ||||
-rw-r--r-- | pkgs/data/fonts/stix-otf/default.nix | 26 | ||||
-rw-r--r-- | pkgs/data/fonts/tai-languages/default.nix | 38 | ||||
-rw-r--r-- | pkgs/data/fonts/ttf-envy-code-r/default.nix | 24 | ||||
-rw-r--r-- | pkgs/data/fonts/ttf-tw-moe/default.nix | 25 | ||||
-rw-r--r-- | pkgs/data/fonts/ubuntu-font-family/default.nix | 20 | ||||
-rw-r--r-- | pkgs/data/fonts/victor-mono/default.nix | 27 |
16 files changed, 245 insertions, 173 deletions
diff --git a/pkgs/data/fonts/liberastika/default.nix b/pkgs/data/fonts/liberastika/default.nix index 5435a601d147c..7c716c1a354b0 100644 --- a/pkgs/data/fonts/liberastika/default.nix +++ b/pkgs/data/fonts/liberastika/default.nix @@ -1,23 +1,22 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -let +stdenvNoCC.mkDerivation rec { + pname = "liberastika"; version = "1.1.5"; -in fetchzip rec { - name = "liberastika-${version}"; - url = "mirror://sourceforge/project/lib-ka/liberastika-ttf-${version}.zip"; + src = fetchzip { + url = "mirror://sourceforge/project/lib-ka/liberastika-ttf-${version}.zip"; + stripRoot = false; + hash = "sha256-woUpOmxhj6eEw7PKJ8EyRcs3ORj0gCZhxHP5a5dy5z0="; + }; - stripRoot = false; + installPhase = '' + runHook preInstall - postFetch = '' - mkdir -p $out/share/fonts - install -Dm644 $out/*.ttf -t $out/share/fonts/truetype - shopt -s extglob dotglob - rm -rf $out/!(share) - shopt -u extglob dotglob - ''; + install -Dm644 *.ttf -t $out/share/fonts/truetype - sha256 = "sha256-1hoETOjPRUIzzM+NUR+g/Ph16jXmH2ARSlZHjgEwoeM="; + runHook postInstall + ''; meta = with lib; { description = "Liberation Sans fork with improved cyrillic support"; @@ -25,7 +24,6 @@ in fetchzip rec { license = licenses.gpl2; platforms = platforms.all; - hydraPlatforms = []; maintainers = [ ]; }; } diff --git a/pkgs/data/fonts/mph-2b-damase/default.nix b/pkgs/data/fonts/mph-2b-damase/default.nix index 10a8dc38d9549..d5623d907bee2 100644 --- a/pkgs/data/fonts/mph-2b-damase/default.nix +++ b/pkgs/data/fonts/mph-2b-damase/default.nix @@ -1,17 +1,21 @@ -{ fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -fetchzip { - name = "MPH-2B-Damase-2"; +stdenvNoCC.mkDerivation rec { + pname = "mph-2b-damase"; + version = "2"; - url = "http://www.wazu.jp/downloads/damase_v.2.zip"; + src = fetchzip { + url = "https://web.archive.org/web/20160322114946/http://www.wazu.jp/downloads/damase_v.2.zip"; + hash = "sha256-4x78D+c3ZBxfhTQQ4+gyxvrsuztHF2ItXLh4uA0PxvU="; + }; - postFetch = '' - mkdir -p $out/share/fonts - unzip -j $downloadedFile \*.ttf -d $out/share/fonts/truetype - ''; + installPhase = '' + runHook preInstall - sha256 = "0yzf12z6fpbgycqwiz88f39iawdhjabadfa14wxar3nhl9n434ql"; + install -Dm644 *.ttf -t $out/share/fonts/truetype - meta = { - }; + runHook postInstall + ''; + + meta = { }; } diff --git a/pkgs/data/fonts/mro-unicode/default.nix b/pkgs/data/fonts/mro-unicode/default.nix index 9f4eda63d0fa1..9a522c1c2a362 100644 --- a/pkgs/data/fonts/mro-unicode/default.nix +++ b/pkgs/data/fonts/mro-unicode/default.nix @@ -1,13 +1,23 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchurl }: -fetchzip { - name = "mro-unicode-2013-05-25"; +stdenvNoCC.mkDerivation { + pname = "mro-unicode"; + version = "unstable-2013-05-25"; - url = "https://github.com/phjamr/MroUnicode/raw/f297de070f7eba721a47c850e08efc119d3bfbe8/MroUnicode-Regular.ttf"; + src = fetchurl { + url = "https://github.com/phjamr/MroUnicode/raw/f297de070f7eba721a47c850e08efc119d3bfbe8/MroUnicode-Regular.ttf"; + hash = "sha256-hcQmTuRWxaU5KEMXg/O0b1olE8YxXWz0PAlqAJknR/0="; + }; + + dontUnpack = true; + + installPhase = '' + runHook preInstall - postFetch = "install -Dm644 $downloadedFile $out/share/fonts/truetype/MroUnicode-Regular.ttf"; + install -Dm644 $src $out/share/fonts/truetype/MroUnicode-Regular.ttf - sha256 = "1i71bjd9gdyn8ladfncbfhz6xz1h8xx8yf876j1z8lh719410c8g"; + runHook postInstall + ''; meta = with lib; { homepage = "https://github.com/phjamr/MroUnicode"; diff --git a/pkgs/data/fonts/pretendard/default.nix b/pkgs/data/fonts/pretendard/default.nix index 40175dc54056e..60ecc61c7ec36 100644 --- a/pkgs/data/fonts/pretendard/default.nix +++ b/pkgs/data/fonts/pretendard/default.nix @@ -1,21 +1,24 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: let version = "1.3.3"; - mkPretendard = { pname, typeface, sha256 }: - fetchzip { - name = "${pname}-${version}"; + mkPretendard = { pname, typeface, hash }: + stdenvNoCC.mkDerivation { + inherit pname version; - url = "https://github.com/orioncactus/pretendard/releases/download/v${version}/${typeface}-${version}.zip"; - inherit sha256; + src = fetchzip { + url = "https://github.com/orioncactus/pretendard/releases/download/v${version}/${typeface}-${version}.zip"; + stripRoot = false; + inherit hash; + }; + + installPhase = '' + runHook preInstall - stripRoot = false; + install -Dm644 public/static/*.otf -t $out/share/fonts/opentype - postFetch = '' - mkdir -p $out/share/fonts/ - install -Dm644 $out/public/static/*.otf -t $out/share/fonts/opentype - rm -rf $out/{public,web,LICENSE.txt} + runHook postInstall ''; meta = with lib; { @@ -32,18 +35,18 @@ in pretendard = mkPretendard { pname = "pretendard"; typeface = "Pretendard"; - sha256 = "sha256-lRHRdCAg3i3+3Y6j0dCXUgwLdeS/VeI6KNkbDKchNEY="; + hash = "sha256-xCEZlwTPhrNIO6WODl55wo2oin+iMYOL/rVaEybpzr0="; }; pretendard-jp = mkPretendard { pname = "pretendard-jp"; typeface = "PretendardJP"; - sha256 = "sha256-VgGt/WoaaJJDAzw+gUQVgTQ+q34bdAaKUB4cA9eU0dQ="; + hash = "sha256-x0G7ULzkIJqZlK995+wWKHXZdWryUTRouGTa5LsJQzk="; }; pretendard-std = mkPretendard { pname = "pretendard-std"; typeface = "PretendardStd"; - sha256 = "sha256-FOlZrr6CHPfUm9Q+Yoi0HLQUI7cAhQYq6P6sJGXBIWg="; + hash = "sha256-/I8LZhFB86/+o+IzUP+bSIq7scKPOL7k/6/Bom0ZSqg="; }; } diff --git a/pkgs/data/fonts/ruwudu/default.nix b/pkgs/data/fonts/ruwudu/default.nix index 2002f4b672031..61f306c710245 100644 --- a/pkgs/data/fonts/ruwudu/default.nix +++ b/pkgs/data/fonts/ruwudu/default.nix @@ -1,19 +1,23 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -fetchzip rec { +stdenvNoCC.mkDerivation rec { pname = "ruwudu"; version = "2.000"; - url = "https://software.sil.org/downloads/r/ruwudu/Ruwudu-${version}.zip"; + src = fetchzip { + url = "https://software.sil.org/downloads/r/ruwudu/Ruwudu-${version}.zip"; + hash = "sha256-FP+ZHm1fKlozAAI2PbJ4r4v5OwRxBtYMRLmRwPbqx2I="; + }; + + installPhase = '' + runHook preInstall - postFetch = '' - rm -rf $out/web $out/manifest.json mkdir -p $out/share/{doc/${pname},fonts/truetype} - mv $out/*.ttf $out/share/fonts/truetype/ - mv $out/*.txt $out/documentation $out/share/doc/${pname}/ - ''; + mv *.ttf $out/share/fonts/truetype/ + mv *.txt documentation $out/share/doc/${pname}/ - sha256 = "sha256-JCvVPbAFBWHL2eEnEUSgdTZ+Vkw3wkS3aS85xQZKNQs="; + runHook postInstall + ''; meta = with lib; { homepage = "https://software.sil.org/ruwudu/"; diff --git a/pkgs/data/fonts/sampradaya/default.nix b/pkgs/data/fonts/sampradaya/default.nix index 749abb71dbd4f..8c0545d2c7fe5 100644 --- a/pkgs/data/fonts/sampradaya/default.nix +++ b/pkgs/data/fonts/sampradaya/default.nix @@ -1,16 +1,26 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchurl }: -fetchzip { - name = "sampradaya-2015-05-26"; +stdenvNoCC.mkDerivation rec { + pname = "sampradaya"; + version = "0.5.0"; - url = "https://bitbucket.org/OorNaattaan/sampradaya/raw/afa9f7c6ab17e14bd7dd74d0acaec2f75454dfda/Sampradaya.ttf"; + src = fetchurl { + url = "https://github.com/deepestblue/sampradaya/releases/download/v${version}/Sampradaya.ttf"; + hash = "sha256-ygKMNzHvbLR2A5HHrfY2C9ZUg0yng+JL3cyg6sBKqeQ="; + }; + + dontUnpack = true; + + installPhase = '' + runHook preInstall - postFetch = "install -Dm644 $downloadedFile $out/share/fonts/truetype/Sampradaya.ttf"; + install -Dm644 $src $out/share/fonts/truetype/Sampradaya.ttf - sha256 = "1pqyj5r5jc7dk8yyzl7i6qq2m9zvahcjj49a66wwzdby5zyw8dqv"; + runHook postInstall + ''; meta = with lib; { - homepage = "https://bitbucket.org/OorNaattaan/sampradaya/"; + homepage = "https://github.com/deepestblue/sampradaya"; description = "Unicode-compliant Grantha font"; maintainers = with maintainers; [ mathnerd314 ]; license = licenses.ofl; # See font metadata diff --git a/pkgs/data/fonts/shrikhand/default.nix b/pkgs/data/fonts/shrikhand/default.nix index 684f3d0395e9d..0db94ebd4ecba 100644 --- a/pkgs/data/fonts/shrikhand/default.nix +++ b/pkgs/data/fonts/shrikhand/default.nix @@ -1,15 +1,23 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchurl }: -let - version = "2016-03-03"; -in fetchzip { - name = "shrikhand-${version}"; +stdenvNoCC.mkDerivation { + pname = "shrikhand"; + version = "unstable-2016-03-03"; - url = "https://github.com/jonpinhorn/shrikhand/raw/c11c9b0720fba977fad7cb4f339ebacdba1d1394/build/Shrikhand-Regular.ttf"; + src = fetchurl { + url = "https://github.com/jonpinhorn/shrikhand/raw/c11c9b0720fba977fad7cb4f339ebacdba1d1394/build/Shrikhand-Regular.ttf"; + hash = "sha256-wHP1Bwu5Yw3a+RwDOHrmthsnuvwyCV4l6ma5EjA6EMA="; + }; + + dontUnpack = true; + + installPhase = '' + runHook preInstall - postFetch = "install -D -m644 $downloadedFile $out/share/fonts/truetype/Shrikhand-Regular.ttf"; + install -D -m644 $src $out/share/fonts/truetype/Shrikhand-Regular.ttf - sha256 = "0s54k9cs1g2yz6lwg5gakqb12vg5qkfdz3pc8mh7mib2s6q926hs"; + runHook postInstall + ''; meta = with lib; { homepage = "https://jonpinhorn.github.io/shrikhand/"; diff --git a/pkgs/data/fonts/sil-abyssinica/default.nix b/pkgs/data/fonts/sil-abyssinica/default.nix index b61af144dcc0a..f01c50b426088 100644 --- a/pkgs/data/fonts/sil-abyssinica/default.nix +++ b/pkgs/data/fonts/sil-abyssinica/default.nix @@ -1,18 +1,22 @@ -{ fetchzip, lib }: +{ lib, stdenvNoCC, fetchzip }: -let +stdenvNoCC.mkDerivation rec { + pname = "sil-abyssinica"; version = "2.200"; -in -fetchzip rec { - name = "sil-abyssinica-${version}"; - url = "https://software.sil.org/downloads/r/abyssinica/AbyssinicaSIL-${version}.zip"; - sha256 = "sha256-Kvswqzw8remcu36QaVjeyk03cR4wW5BKQMDihiaxJoE="; - postFetch = '' - rm -rf $out/web - mkdir -p $out/share/{fonts/truetype,doc/${name}} - mv $out/*.ttf $out/share/fonts/truetype/ - mv $out/*.txt $out/documentation $out/share/doc/${name}/ + src = fetchzip { + url = "https://software.sil.org/downloads/r/abyssinica/AbyssinicaSIL-${version}.zip"; + hash = "sha256-IdWMZHm9VoLVDO0//ISujxlXUxe0O6+aEcdP63YRmPg="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/{fonts/truetype,doc/${pname}-${version}} + mv *.ttf $out/share/fonts/truetype/ + mv *.txt documentation $out/share/doc/${pname}-${version}/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/sil-padauk/default.nix b/pkgs/data/fonts/sil-padauk/default.nix index b993ef5ae6b68..fe45da1317383 100644 --- a/pkgs/data/fonts/sil-padauk/default.nix +++ b/pkgs/data/fonts/sil-padauk/default.nix @@ -1,19 +1,23 @@ -{ fetchzip, lib }: +{ lib, stdenvNoCC, fetchzip }: -let +stdenvNoCC.mkDerivation rec { + pname = "sil-padauk"; version = "5.001"; -in -fetchzip rec { - name = "sil-padauk-${version}"; - url = "https://software.sil.org/downloads/r/padauk/Padauk-${version}.zip"; - sha256 = "sha256-6H9EDmXr1Ox2fgLw9sG5JrCAllK3tbjvMfLi8DTF1f0="; - postFetch = '' + src = fetchzip { + url = "https://software.sil.org/downloads/r/padauk/Padauk-${version}.zip"; + hash = "sha256-rLzuDUd+idjTN0xQxblXQ9V2rQtJPN2EtWGmTRY1R7U="; + }; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype - rm -rf $out/{manifest.json,web/} - mv $out/*.ttf $out/share/fonts/truetype/ - mkdir -p $out/share/doc/${name} - mv $out/*.txt $out/documentation/ $out/share/doc/${name}/ + mv *.ttf $out/share/fonts/truetype/ + mkdir -p $out/share/doc/${pname}-${version} + mv *.txt documentation/ $out/share/doc/${pname}-${version}/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/sitelen-seli-kiwen/default.nix b/pkgs/data/fonts/sitelen-seli-kiwen/default.nix index 60f5c3e36e763..de0fec7b6f3eb 100644 --- a/pkgs/data/fonts/sitelen-seli-kiwen/default.nix +++ b/pkgs/data/fonts/sitelen-seli-kiwen/default.nix @@ -1,20 +1,23 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -let - rev = "69132c99873894746c9710707aaeb2cea2609709"; -in -fetchzip { +stdenvNoCC.mkDerivation { pname = "sitelen-seli-kiwen"; version = "unstable-2022-06-28"; - url = "https://raw.githubusercontent.com/kreativekorp/sitelen-seli-kiwen/${rev}/sitelenselikiwen.zip"; - hash = "sha256-63sl/Ha2QAe8pVKCpLNs//DB0kjLdW01u6tVMrGquIU="; - stripRoot = false; + src = fetchzip { + url = "https://raw.githubusercontent.com/kreativekorp/sitelen-seli-kiwen/69132c99873894746c9710707aaeb2cea2609709/sitelenselikiwen.zip"; + stripRoot = false; + hash = "sha256-viOLAj9Rn60bcQkkDHVuKHCE8KPnIz/L0hIJhum1SSQ="; + }; + + installPhase = '' + runHook preInstall - postFetch = '' mkdir -p $out/share/fonts/{opentype,truetype} - mv $out/*.eot $out/share/fonts/opentype/ - mv $out/*.ttf $out/share/fonts/truetype/ + mv *.eot $out/share/fonts/opentype/ + mv *.ttf $out/share/fonts/truetype/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/stix-otf/default.nix b/pkgs/data/fonts/stix-otf/default.nix index 894fd22c36f9a..c5505b7a79483 100644 --- a/pkgs/data/fonts/stix-otf/default.nix +++ b/pkgs/data/fonts/stix-otf/default.nix @@ -1,24 +1,28 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -let +stdenvNoCC.mkDerivation rec { + pname = "stix-otf"; version = "1.1.1"; -in fetchzip { - name = "stix-otf-${version}"; - url = "http://ftp.fi.muni.cz/pub/linux/gentoo/distfiles/STIXv${version}-word.zip"; + src = fetchzip { + url = "https://sources.debian.org/src/fonts-stix/1.1.1-4.1/STIXv${version}-word.zip"; + stripRoot = false; + hash = "sha256-M3STue+RPHi8JgZZupV0dVLZYKBiFutbBOlanuKkD08="; + }; - postFetch = '' - mkdir -p $out/share/fonts - unzip -j $downloadedFile \*.otf -d $out/share/fonts/opentype - ''; + installPhase = '' + runHook preInstall - sha256 = "04d4qxq3i9fyapsmxk6d9v1xirjam8c74fyxs6n24d3gf2945zmw"; + install -Dm644 Fonts/STIX-Word/*.otf -t $out/share/fonts/opentype + + runHook postInstall + ''; meta = with lib; { homepage = "http://www.stixfonts.org/"; description = "Fonts for Scientific and Technical Information eXchange"; license = licenses.ofl; platforms = platforms.all; - maintainers = [maintainers.rycee]; + maintainers = [ maintainers.rycee ]; }; } diff --git a/pkgs/data/fonts/tai-languages/default.nix b/pkgs/data/fonts/tai-languages/default.nix index 71ca170afb1de..4e4c689b6ac6d 100644 --- a/pkgs/data/fonts/tai-languages/default.nix +++ b/pkgs/data/fonts/tai-languages/default.nix @@ -1,24 +1,34 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchurl }: { -tai-ahom = fetchzip { - name = "tai-ahom-2015-07-06"; + tai-ahom = stdenvNoCC.mkDerivation rec { + pname = "tai-ahom"; + version = "unstable-2015-07-06"; - url = "https://github.com/enabling-languages/tai-languages/blob/b57a3ea4589af69bb8e87c6c4bb7cd367b52f0b7/ahom/.fonts/ttf/.original/AhomUnicode_FromMartin.ttf?raw=true"; + src = fetchurl { + url = "https://github.com/enabling-languages/tai-languages/raw/b57a3ea4589af69bb8e87c6c4bb7cd367b52f0b7/ahom/.fonts/ttf/.original/AhomUnicode_FromMartin.ttf"; + hash = "sha256-U1vcVf/VgXhvK1f2Iw2JKkd2EzJgz7KbHAwnUanX8n4="; + }; - postFetch = "install -Dm644 $downloadedFile $out/share/fonts/truetype/AhomUnicode.ttf"; + dontUnpack = true; - sha256 = "03h8ql9d5bzq4j521j0cz08ddf717bzim1nszh2aar6kn0xqnp9q"; + installPhase = '' + runHook preInstall - meta = with lib; { - homepage = "https://github.com/enabling-languages/tai-languages"; - description = "Unicode-compliant Tai Ahom font"; - maintainers = with maintainers; [ mathnerd314 ]; - license = licenses.ofl; # See font metadata - platforms = platforms.all; + install -Dm644 $src $out/share/fonts/truetype/AhomUnicode.ttf + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/enabling-languages/tai-languages"; + description = "Unicode-compliant Tai Ahom font"; + maintainers = with maintainers; [ mathnerd314 ]; + license = licenses.ofl; # See font metadata + platforms = platforms.all; + }; }; -}; -# TODO: package others (Khamti Shan, Tai Aiton, Tai Phake, and/or Assam Tai) + # TODO: package others (Khamti Shan, Tai Aiton, Tai Phake, and/or Assam Tai) } diff --git a/pkgs/data/fonts/ttf-envy-code-r/default.nix b/pkgs/data/fonts/ttf-envy-code-r/default.nix index 871bfb0099b2c..673d946a1e9a0 100644 --- a/pkgs/data/fonts/ttf-envy-code-r/default.nix +++ b/pkgs/data/fonts/ttf-envy-code-r/default.nix @@ -1,20 +1,22 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -let +stdenvNoCC.mkDerivation rec { pname = "ttf-envy-code-r"; version = "PR7"; -in fetchzip { - name = "${pname}-0.${version}"; - url = "http://download.damieng.com/fonts/original/EnvyCodeR-${version}.zip"; + src = fetchzip { + url = "http://download.damieng.com/fonts/original/EnvyCodeR-${version}.zip"; + hash = "sha256-pJqC/sbNjxEwbVf2CVoXMBI5zvT3DqzRlKSqFT8I2sM="; + }; - postFetch = '' - mkdir -p $out/share/{doc,fonts} - unzip -j $downloadedFile \*.ttf -d $out/share/fonts/truetype - unzip -j $downloadedFile \*.txt -d "$out/share/doc/${pname}" - ''; + installPhase = '' + runHook preInstall - sha256 = "0x0r07nax68cmz7490x2crzzgdg4j8fg63wppcmjqm0230bggq2z"; + install -Dm644 *.ttf -t $out/share/fonts/truetype + install -Dm644 *.txt -t $out/share/doc/${pname} + + runHook postInstall + ''; meta = with lib; { homepage = "https://damieng.com/blog/tag/envy-code-r"; diff --git a/pkgs/data/fonts/ttf-tw-moe/default.nix b/pkgs/data/fonts/ttf-tw-moe/default.nix index bf52d07c52e98..85b2ec1ce7876 100644 --- a/pkgs/data/fonts/ttf-tw-moe/default.nix +++ b/pkgs/data/fonts/ttf-tw-moe/default.nix @@ -1,18 +1,21 @@ -{ lib, fetchzip }: -let +{ lib, stdenvNoCC, fetchzip }: + +stdenvNoCC.mkDerivation rec { + pname = "ttf-tw-moe"; version = "2020-11-14"; -in -fetchzip { - name = "ttf-tw-moe"; - url = "https://github.com/Jiehong/TW-fonts/archive/${version}.zip"; + src = fetchzip { + url = "https://github.com/Jiehong/TW-fonts/archive/${version}.zip"; + hash = "sha256-9gy8xO93ViIPmpg1du0DbXVCR2FowourLH8nP9d6HK0="; + }; - postFetch = '' - mkdir -p $out/share/fonts - unzip -j $downloadedFile TW-fonts-${version}/\*.ttf -d $out/share/fonts/truetype - ''; + installPhase = '' + runHook preInstall - sha256 = "1jd3gjjfa4vadp6d499n0irz5b22z611kd7q5qgqf6s2fwbxfhiz"; + install -Dm644 *.ttf -t $out/share/fonts/truetype + + runHook postInstall + ''; meta = with lib; { homepage = "http://www.moe.gov.tw/"; diff --git a/pkgs/data/fonts/ubuntu-font-family/default.nix b/pkgs/data/fonts/ubuntu-font-family/default.nix index 0458abf91d4f9..331e34690a5e2 100644 --- a/pkgs/data/fonts/ubuntu-font-family/default.nix +++ b/pkgs/data/fonts/ubuntu-font-family/default.nix @@ -1,18 +1,22 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -fetchzip rec { +stdenvNoCC.mkDerivation rec { pname = "ubuntu-font-family"; version = "0.83"; - url = "https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-${version}.zip"; + src = fetchzip { + url = "https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-${version}.zip"; + hash = "sha256-FAg1xn8Gcbwmuvqtg9SquSet4oTT9nqE+Izeq7ZMVcA="; + }; + + installPhase = '' + runHook preInstall - postFetch = '' mkdir -p $out/share/fonts/ubuntu - mv $out/*.ttf $out/share/fonts/ubuntu - find $out -maxdepth 1 ! -type d -exec rm {} + - ''; + mv *.ttf $out/share/fonts/ubuntu - sha256 = "090y665h4kf2bi623532l6wiwkwnpd0xds0jr7560xwfwys1hiqh"; + runHook postInstall + ''; meta = with lib; { description = "Ubuntu Font Family"; diff --git a/pkgs/data/fonts/victor-mono/default.nix b/pkgs/data/fonts/victor-mono/default.nix index f34baa8a83144..1708a43b80564 100644 --- a/pkgs/data/fonts/victor-mono/default.nix +++ b/pkgs/data/fonts/victor-mono/default.nix @@ -1,11 +1,8 @@ -{ lib, fetchzip }: +{ lib, stdenvNoCC, fetchzip }: -let +stdenvNoCC.mkDerivation rec { + pname = "victor-mono"; version = "1.5.4"; -in -fetchzip { - name = "victor-mono-${version}"; - stripRoot = false; # Upstream prefers we download from the website, # but we really insist on a more versioned resource. @@ -14,19 +11,23 @@ fetchzip { # so we extract it from the tagged release. # Both methods produce the same file, but this way # we can safely reason about what version it is. - url = "https://github.com/rubjo/victor-mono/raw/v${version}/public/VictorMonoAll.zip"; + src = fetchzip { + url = "https://github.com/rubjo/victor-mono/raw/v${version}/public/VictorMonoAll.zip"; + stripRoot = false; + hash = "sha256-E8j1bfYrM8yRtasiwgTvyE4EYx2LyAbmw3MXH1l+owk="; + }; + + installPhase = '' + runHook preInstall - postFetch = '' mkdir -p "$out/share/fonts/" - mv $out/OTF $out/share/fonts/opentype - mv $out/TTF $out/share/fonts/truetype + mv OTF $out/share/fonts/opentype + mv TTF $out/share/fonts/truetype - rm -r $out/{EOT,WOFF,WOFF2,LICENSE.txt} + runHook postInstall ''; - sha256 = "sha256-1si0d2lpuXaDcSc3giVMMMbZc/eKbHKU3wmwfYHZ8o0="; - meta = with lib; { description = "Free programming font with cursive italics and ligatures"; homepage = "https://rubjo.github.io/victor-mono"; |