about summary refs log tree commit diff
path: root/pkgs/data/fonts
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2022-10-06 22:24:11 -0300
committerGitHub <noreply@github.com>2022-10-06 22:24:11 -0300
commit10c7f50248c588d51edb97b4fde99684d2916db3 (patch)
treef001ea66ccf3ac2c6a25e65b438dba85eae8882e /pkgs/data/fonts
parent76d36a9d65a1a7e9ad8b90387f3f6d9febe702aa (diff)
parent1fd6cf192a849c3ef9886ea34f7803991e8b127d (diff)
Merge pull request #194425 from SuperSandro2000/remove-double-fixed-output
Add support for pname+version to fetchzip/fetchurl
Diffstat (limited to 'pkgs/data/fonts')
-rw-r--r--pkgs/data/fonts/cooper-hewitt/default.nix20
-rw-r--r--pkgs/data/fonts/freefont-ttf/default.nix12
-rw-r--r--pkgs/data/fonts/ubuntu-font-family/default.nix20
3 files changed, 25 insertions, 27 deletions
diff --git a/pkgs/data/fonts/cooper-hewitt/default.nix b/pkgs/data/fonts/cooper-hewitt/default.nix
index 19c68973a2528..48c7bc8734283 100644
--- a/pkgs/data/fonts/cooper-hewitt/default.nix
+++ b/pkgs/data/fonts/cooper-hewitt/default.nix
@@ -1,21 +1,19 @@
-{ lib, stdenv, fetchzip }:
+{ lib, fetchzip }:
 
-stdenv.mkDerivation {
+fetchzip rec {
   pname = "cooper-hewitt";
   version = "unstable-2014-06-09";
 
-  src = fetchzip {
-    url = "https://www.cooperhewitt.org/wp-content/uploads/fonts/CooperHewitt-OTF-public.zip";
-    hash = "sha256-bTlEXQeYNNspvnNdvQhJn6CNBrcSKYWuNWF/N6+3Vb0=";
-  };
-
-  dontConfigure = true;
-  dontBuild = true;
+  url = "https://web.archive.org/web/20221004145117/https://www.cooperhewitt.org/wp-content/uploads/fonts/CooperHewitt-OTF-public.zip";
 
-  installPhase = ''
-    install -D -m 644 -t "$out/share/fonts/opentype" *.otf
+  postFetch = ''
+    mkdir -p $out/share/fonts/opentype
+    mv $out/*.otf $out/share/fonts/opentype
+    find $out -maxdepth 1 ! -type d -exec rm {} +
   '';
 
+  sha256 = "01iwqmjvqkc6fmc2r0486vk06s6f51n9wxzl1pf9z48n0igj4gqd";
+
   meta = with lib; {
     homepage = "https://www.cooperhewitt.org/open-source-at-cooper-hewitt/cooper-hewitt-the-typeface-by-chester-jenkins/";
     description = "A contemporary sans serif, with characters composed of modified-geometric curves and arches";
diff --git a/pkgs/data/fonts/freefont-ttf/default.nix b/pkgs/data/fonts/freefont-ttf/default.nix
index 5934ec3589ac3..9d8c28681a9f1 100644
--- a/pkgs/data/fonts/freefont-ttf/default.nix
+++ b/pkgs/data/fonts/freefont-ttf/default.nix
@@ -1,16 +1,18 @@
 { lib, fetchzip }:
 
 fetchzip rec {
-  name = "freefont-ttf-20120503";
+  pname = "freefont-ttf";
+  version = "20120503";
 
-  url = "mirror://gnu/freefont/${name}.zip";
+  url = "mirror://gnu/freefont/freefont-ttf-${version}.zip";
 
   postFetch = ''
-    mkdir -p $out/share/fonts
-    unzip -j $downloadedFile \*.ttf -d $out/share/fonts/truetype
+    mkdir -p $out/share/fonts/truetype
+    mv $out/*.ttf $out/share/fonts/truetype
+    find $out -maxdepth 1 ! -type d -exec rm {} +
   '';
 
-  sha256 = "0h0x2hhr7kvjiycf7fv800xxwa6hcpiz54bqx06wsqc7z61iklvd";
+  sha256 = "sha256-bdMZg/mHYc0N6HiR8uNl0CjeOwBou+OYj3LPkyEUHUA=";
 
   meta = {
     description = "GNU Free UCS Outline Fonts";
diff --git a/pkgs/data/fonts/ubuntu-font-family/default.nix b/pkgs/data/fonts/ubuntu-font-family/default.nix
index 4e29f23a158d6..0458abf91d4f9 100644
--- a/pkgs/data/fonts/ubuntu-font-family/default.nix
+++ b/pkgs/data/fonts/ubuntu-font-family/default.nix
@@ -1,20 +1,18 @@
-{ lib, stdenv, fetchzip }:
+{ lib, fetchzip }:
 
-stdenv.mkDerivation rec {
+fetchzip rec {
   pname = "ubuntu-font-family";
   version = "0.83";
 
-  src = fetchzip {
-    url = "https://assets.ubuntu.com/v1/fad7939b-${pname}-${version}.zip";
-    hash = "sha256-FAg1xn8Gcbwmuvqtg9SquSet4oTT9nqE+Izeq7ZMVcA=";
-  };
+  url = "https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-${version}.zip";
 
-  installPhase = ''
-    install -D -m 644 -t "$out/share/fonts/truetype" *.ttf
+  postFetch = ''
+    mkdir -p $out/share/fonts/ubuntu
+    mv $out/*.ttf $out/share/fonts/ubuntu
+    find $out -maxdepth 1 ! -type d -exec rm {} +
   '';
 
-  outputHashMode = "recursive";
-  outputHash = "sha256-EEcYtOeOd2DKyRLo1kG7lk8euaFilCFMXMJNAosxHiQ=";
+  sha256 = "090y665h4kf2bi623532l6wiwkwnpd0xds0jr7560xwfwys1hiqh";
 
   meta = with lib; {
     description = "Ubuntu Font Family";
@@ -25,6 +23,6 @@ stdenv.mkDerivation rec {
     homepage = "http://font.ubuntu.com/";
     license = licenses.free;
     platforms = platforms.all;
-    maintainers = with maintainers; [ antono ];
+    maintainers = [ maintainers.antono ];
   };
 }