about summary refs log tree commit diff
path: root/pkgs/data/fonts/source-sans
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-28 09:08:17 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-28 09:08:17 +0100
commit7562d1ed9cacaeddc46a8fc26c9e340569cea1ac (patch)
treeb135589bcf1b4c2692d66c76c827c51bf92dd985 /pkgs/data/fonts/source-sans
parent4fe4a0e8abadd05d9e81923c13531ab1476d6fd3 (diff)
treewide: convert 9 fonts to stdenvNoCC.mkDerivation
Diffstat (limited to 'pkgs/data/fonts/source-sans')
-rw-r--r--pkgs/data/fonts/source-sans/default.nix32
1 files changed, 17 insertions, 15 deletions
diff --git a/pkgs/data/fonts/source-sans/default.nix b/pkgs/data/fonts/source-sans/default.nix
index 94df27765ee28..1433804ce71d7 100644
--- a/pkgs/data/fonts/source-sans/default.nix
+++ b/pkgs/data/fonts/source-sans/default.nix
@@ -1,14 +1,23 @@
-# when changing this expression convert it from 'fetchzip' to 'stdenvNoCC.mkDerivation'
-{ lib, fetchzip }:
+{ lib, stdenvNoCC, fetchzip }:
 
-let
+stdenvNoCC.mkDerivation rec {
+  pname = "source-sans";
   version = "3.046";
-in (fetchzip {
-  name = "source-sans-${version}";
 
-  url = "https://github.com/adobe-fonts/source-sans/archive/${version}R.zip";
+  src = fetchzip {
+    url = "https://github.com/adobe-fonts/source-sans/archive/${version}R.zip";
+    hash = "sha256-nBLEK+T5n1CdZK2zvCWIhF2MxPmiAwL9l55a55yHtgU=";
+  };
+
+  installPhase = ''
+    runHook preInstall
 
-  sha256 = "1wxdinnliq0xqbjrs0sqykwaggkmyqawfq862d9xn05g1pnxda94";
+    install -Dm444 OTF/*.otf -t $out/share/fonts/opentype
+    install -Dm444 TTF/*.ttf -t $out/share/fonts/truetype
+    install -Dm444 VAR/*.otf -t $out/share/fonts/variable
+
+    runHook postInstall
+  '';
 
   meta = with lib; {
     homepage = "https://adobe-fonts.github.io/source-sans/";
@@ -17,11 +26,4 @@ in (fetchzip {
     platforms = platforms.all;
     maintainers = with maintainers; [ ttuegel ];
   };
-}).overrideAttrs (_: {
-  postFetch = ''
-    mkdir -p $out/share/fonts/{opentype,truetype,variable}
-    unzip -j $downloadedFile "*/OTF/*.otf" -d $out/share/fonts/opentype
-    unzip -j $downloadedFile "*/TTF/*.ttf" -d $out/share/fonts/truetype
-    unzip -j $downloadedFile "*/VAR/*.otf" -d $out/share/fonts/variable
-  '';
-})
+}