From 9baf0b76b767f8bc9995bcef9e8f1cf173fb4502 Mon Sep 17 00:00:00 2001 From: volth Date: Fri, 11 Aug 2017 04:10:51 +0000 Subject: [PATCH] wqy_microhei: make the font derivation fixed-output - [x] make the font derivation fixed-output (https://github.com/NixOS/nixpkgs/issues/27754) --- pkgs/data/fonts/wqy-microhei/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/data/fonts/wqy-microhei/default.nix b/pkgs/data/fonts/wqy-microhei/default.nix index c0665b2f0cc..038f0316940 100644 --- a/pkgs/data/fonts/wqy-microhei/default.nix +++ b/pkgs/data/fonts/wqy-microhei/default.nix @@ -1,14 +1,16 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchzip }: -stdenv.mkDerivation rec { +fetchzip rec { name = "wqy-microhei-0.2.0-beta"; - src = fetchurl { - url = "mirror://sourceforge/wqy/${name}.tar.gz"; - sha256 = "0gi1yxqph8xx869ichpzzxvx6y50wda5hi77lrpacdma4f0aq0i8"; - }; + url = "mirror://sourceforge/wqy/${name}.tar.gz"; - installPhase = ''install -Dm644 wqy-microhei.ttc $out/share/fonts/wqy-microhei.ttc''; + postFetch = '' + tar -xzf $downloadedFile --strip-components=1 + install -Dm644 wqy-microhei.ttc $out/share/fonts/wqy-microhei.ttc + ''; + + sha256 = "0i5jh7mkp371fxqmsvn7say075r641yl4hq26isjyrqvb8cv92a9"; meta = { description = "A (mainly) Chinese Unicode font";