about summary refs log tree commit diff
path: root/pkgs/data/fonts/stix-two
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-28 07:27:25 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-28 07:27:25 +0100
commita6e94af6ef5b526386567b6bd5f219c64a9c543b (patch)
tree1c95c6d4bd6aa1f88b3a2cc6c945cc69b81ad1e9 /pkgs/data/fonts/stix-two
parent3dd3562fa08e5a7cbe58c91b7f5b4aacd92d4012 (diff)
treewide: convert 17 fonts to stdenvNoCC.mkDerivation
Diffstat (limited to 'pkgs/data/fonts/stix-two')
-rw-r--r--pkgs/data/fonts/stix-two/default.nix33
1 files changed, 18 insertions, 15 deletions
diff --git a/pkgs/data/fonts/stix-two/default.nix b/pkgs/data/fonts/stix-two/default.nix
index fb494391a8784..86ceb388f86aa 100644
--- a/pkgs/data/fonts/stix-two/default.nix
+++ b/pkgs/data/fonts/stix-two/default.nix
@@ -1,14 +1,23 @@
-# when changing this expression convert it from 'fetchzip' to 'stdenvNoCC.mkDerivation'
-{ lib, fetchzip }:
-let
+{ lib, stdenvNoCC, fetchzip }:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "stix-two";
   version = "2.13";
-in
-(fetchzip {
-  name = "stix-two-${version}";
 
-  url = "https://github.com/stipub/stixfonts/raw/v${version}/zipfiles/STIX${builtins.replaceStrings [ "." ] [ "_" ] version}-all.zip";
+  src = fetchzip {
+    url = "https://github.com/stipub/stixfonts/raw/v${version}/zipfiles/STIX${builtins.replaceStrings [ "." ] [ "_" ] version}-all.zip";
+    stripRoot = false;
+    hash = "sha256-hfQmrw7HjlhQSA0rVTs84i3j3iMVR0k7tCRBcB6hEpU=";
+  };
+
+  installPhase = ''
+    runHook preInstall
 
-  sha256 = "sha256-cBtZe/oq4bQCscSAhJ4YuTSghDleD9O/+3MHOJyI50o=";
+    install -Dm644 */*.otf -t $out/share/fonts/opentype
+    install -Dm644 */*.ttf -t $out/share/fonts/truetype
+
+    runHook postInstall
+  '';
 
   meta = with lib; {
     homepage = "https://www.stixfonts.org/";
@@ -17,10 +26,4 @@ in
     platforms = platforms.all;
     maintainers = [ maintainers.rycee ];
   };
-}).overrideAttrs (_: {
-  postFetch = ''
-    mkdir -p $out/share/fonts/
-    unzip -j $downloadedFile \*.otf -d $out/share/fonts/opentype
-    unzip -j $downloadedFile \*.ttf -d $out/share/fonts/truetype
-  '';
-})
+}