summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/fonts/arphic/default.nix50
-rw-r--r--pkgs/data/fonts/cabin/default.nix22
2 files changed, 29 insertions, 43 deletions
diff --git a/pkgs/data/fonts/arphic/default.nix b/pkgs/data/fonts/arphic/default.nix
index b392ac79b2d..37d9a199567 100644
--- a/pkgs/data/fonts/arphic/default.nix
+++ b/pkgs/data/fonts/arphic/default.nix
@@ -1,27 +1,23 @@
-{ stdenv, fetchurl, mkfontscale, mkfontdir }:
+{ stdenv, fetchzip, mkfontscale, mkfontdir }:
 
-{
-  arphic-ukai = stdenv.mkDerivation rec {
+let
+  version = "0.2.20080216.2";
+in {
+  arphic-ukai = fetchzip {
     name = "arphic-ukai-${version}";
 
-    version = "0.2.20080216.2";
+    url = "http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-arphic-ukai/fonts-arphic-ukai_${version}.orig.tar.bz2";
 
-    src = fetchurl {
-      url = "http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-arphic-ukai/fonts-arphic-ukai_${version}.orig.tar.bz2";
-      sha256 = "1lp3i9m6x5wrqjkh1a8vpyhmsrhvsa2znj2mx13qfkwza5rqv5ml";
-    };
-
-    buildInputs = [ mkfontscale mkfontdir ];
-
-    phases = [ "unpackPhase" "installPhase" ];
-
-    installPhase = ''
+    postFetch = ''
+      tar -xjvf $downloadedFile --strip-components=1
       install -D -v ukai.ttc $out/share/fonts/truetype/arphic-ukai.ttc
       cd $out/share/fonts
-      mkfontdir
-      mkfontscale
+      ${mkfontdir}/bin/mkfontdir
+      ${mkfontscale}/bin/mkfontscale
     '';
 
+    sha256 = "0xi5ycm7ydzpn7cqxv1kcj9vd70nr9wn8v27hmibyjc25y2qdmzl";
+
     meta = with stdenv.lib; {
       description = "CJK Unicode font Kai style";
       homepage = https://www.freedesktop.org/wiki/Software/CJKUnifonts/;
@@ -32,27 +28,21 @@
     };
   };
 
-  arphic-uming = stdenv.mkDerivation rec {
+  arphic-uming = fetchzip {
     name = "arphic-uming-${version}";
 
-    version = "0.2.20080216.2";
+    url = "http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-arphic-uming/fonts-arphic-uming_${version}.orig.tar.bz2";
 
-    src = fetchurl {
-      url = "http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-arphic-uming/fonts-arphic-uming_${version}.orig.tar.bz2";
-      sha256 = "1ny11n380vn7sryvy1g3a83y3ll4h0jf9wgnrx55nmksx829xhg3";
-    };
-
-    buildInputs = [ mkfontscale mkfontdir ];
-
-    phases = [ "unpackPhase" "installPhase" ];
-
-    installPhase = ''
+    postFetch = ''
+      tar -xjvf $downloadedFile --strip-components=1
       install -D -v uming.ttc $out/share/fonts/truetype/arphic-uming.ttc
       cd $out/share/fonts
-      mkfontdir
-      mkfontscale
+      ${mkfontdir}/bin/mkfontdir
+      ${mkfontscale}/bin/mkfontscale
     '';
 
+    sha256 = "16jybvj1cxamm682caj6nsm6l5c60x9mgchp1l2izrw2rvc8x38d";
+
     meta = with stdenv.lib; {
       description = "CJK Unicode font Ming style";
       homepage = https://www.freedesktop.org/wiki/Software/CJKUnifonts/;
diff --git a/pkgs/data/fonts/cabin/default.nix b/pkgs/data/fonts/cabin/default.nix
index 8e432db8418..5bf4d454b06 100644
--- a/pkgs/data/fonts/cabin/default.nix
+++ b/pkgs/data/fonts/cabin/default.nix
@@ -1,22 +1,18 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchzip }:
 
-stdenv.mkDerivation rec {
+fetchzip rec {
   name = "cabin-1.005";
 
-  src = fetchFromGitHub {
-    owner = "impallari";
-    repo = "Cabin";
-    rev = "982839c790e9dc57c343972aa34c51ed3b3677fd";
-    sha256 = "16v7spviphvdh2rrr8klv11lc9hxphg12ddf0qs7xdx801ri0ppn";
-  };
+  url = https://github.com/impallari/Cabin/archive/982839c790e9dc57c343972aa34c51ed3b3677fd.zip;
 
-  installPhase = ''
-    mkdir -p $out/share/fonts/opentype
-    mkdir -p $out/share/doc/${name}
-    cp -v "fonts/OTF/"*.otf $out/share/fonts/opentype/
-    cp -v README.md FONTLOG.txt $out/share/doc/${name}
+  postFetch = ''
+    mkdir -p $out/share/{doc,fonts}
+    unzip -j $downloadedFile \*.otf                    -d $out/share/fonts/opentype
+    unzip -j $downloadedFile \*README.md \*FONTLOG.txt -d "$out/share/doc/${name}"
   '';
 
+  sha256 = "1ax5c2iab48qsk9zn3gjvqaib2lnlm25f1wr0aysf5ngw0y0jkrd";
+
   meta = with stdenv.lib; {
     description = "A humanist sans with 4 weights and true italics";
     longDescription = ''