about summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
authorJack Kelly <jack@jackkelly.name>2022-12-06 15:31:47 +1000
committerJack Kelly <jack@jackkelly.name>2022-12-07 10:00:43 +1000
commitad8edb6259e0cf510691a4c48abed8546967d310 (patch)
treee606871bfe4b727265ae57a02618bcb650037667 /pkgs/data
parent4f4073186f4714a6fbca4e649e568fb35ac8811e (diff)
carlito: Use stdenvNoCC.mkDerivation
carlito used to call `fetchzip` directly, and the fact that it was a
fixed-output derivation meant nobody noticed that:

1. the derivation no longer built from source (due to changes in
   `fetchzip`), and

2. the updated fontconfig xml never got used.
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/fonts/carlito/default.nix21
1 files changed, 10 insertions, 11 deletions
diff --git a/pkgs/data/fonts/carlito/default.nix b/pkgs/data/fonts/carlito/default.nix
index 1de2e9afc0f94..0ecd3f85c6933 100644
--- a/pkgs/data/fonts/carlito/default.nix
+++ b/pkgs/data/fonts/carlito/default.nix
@@ -1,22 +1,21 @@
-{ lib, fetchzip }:
+{ lib, fetchzip, stdenvNoCC }:
 
-let
+stdenvNoCC.mkDerivation rec {
+  pname = "carlito";
   version = "20130920";
-in fetchzip {
-  name = "carlito-${version}";
 
-  url = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/crosextrafonts-carlito-${version}.tar.gz";
+  src = fetchzip {
+    url = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/crosextrafonts-carlito-${version}.tar.gz";
+    sha256 = "sha256-OGDO5WoF7OmiRdLRRrIXMzg276Pgeq1L3Offcl0W2jg=";
+  };
 
-  postFetch = ''
-    tar -xzvf $downloadedFile --strip-components=1
+  installPhase = ''
     mkdir -p $out/etc/fonts/conf.d
     mkdir -p $out/share/fonts/truetype
-    cp -v *.ttf $out/share/fonts/truetype
+    cp -v $src/*.ttf $out/share/fonts/truetype
     cp -v ${./calibri-alias.conf} $out/etc/fonts/conf.d/30-calibri.conf
   '';
 
-  sha256 = "0d72zy6kdmxgpi63r3yvi3jh1hb7lvlgv8hgd4ag0x10dz18mbzv";
-
   meta = with lib; {
     # This font doesn't appear to have any official web site but this
     # one provides some good information and samples.
@@ -25,7 +24,7 @@ in fetchzip {
     longDescription = ''
       Carlito is a free font that is metric-compatible with the
       Microsoft Calibri font. The font is designed by Ɓukasz Dziedzic
-      of the tyPoland foundry and based his Lato font.
+      of the tyPoland foundry and based upon his Lato font.
     '';
     license = licenses.ofl;
     platforms = platforms.all;