summary refs log tree commit diff
path: root/pkgs/data/fonts/victor-mono
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2019-07-17 18:27:26 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2019-07-18 18:46:40 -0400
commit0cd086946251b9acab10392451b0429fcc8af689 (patch)
treed1f544898f77541d33cbf7b7ceef8b8936ea79bc /pkgs/data/fonts/victor-mono
parentb2e0ab39a740590a15ef77c2326d5400208f86c0 (diff)
downloadnixpkgs-0cd086946251b9acab10392451b0429fcc8af689.tar
nixpkgs-0cd086946251b9acab10392451b0429fcc8af689.tar.gz
nixpkgs-0cd086946251b9acab10392451b0429fcc8af689.tar.bz2
nixpkgs-0cd086946251b9acab10392451b0429fcc8af689.tar.lz
nixpkgs-0cd086946251b9acab10392451b0429fcc8af689.tar.xz
nixpkgs-0cd086946251b9acab10392451b0429fcc8af689.tar.zst
nixpkgs-0cd086946251b9acab10392451b0429fcc8af689.zip
victor-mono: improvements from previous PR
Fixes #64465.

Resolves conflicts with earlier merged PR,
notable differences in the result
(by our powers combined!):

* provide both ttf and otf versions
* quote URL, since folks seem to like those
* don't put fonts in ${pname} subdirs
  fontconfig's hashing/cache is mostly geared
  for the many-fonts-in-one-place situation,
  although this may be fixed in more recent versions.
  Anyway minor change and mostly went with not modifying
  what I had ;) so happy to adjust back if that
  better matches your senses/style/use.
* Drop leading 'A' from description,
  I think this is per policy written.. somewhere O:).
* alpha-sort the meta attributes, which is easy to rem
  and generally matches what most expressions do anyway :)

Reviewer feedback:

* use subdirs with fontname, seems preferred
* fix indent, whoops
Diffstat (limited to 'pkgs/data/fonts/victor-mono')
-rw-r--r--pkgs/data/fonts/victor-mono/default.nix28
1 files changed, 19 insertions, 9 deletions
diff --git a/pkgs/data/fonts/victor-mono/default.nix b/pkgs/data/fonts/victor-mono/default.nix
index d83e412267a..e1ef611d686 100644
--- a/pkgs/data/fonts/victor-mono/default.nix
+++ b/pkgs/data/fonts/victor-mono/default.nix
@@ -3,27 +3,37 @@
 let
   pname = "victor-mono";
   version = "1.2.1";
-in fetchFromGitHub {
+in fetchFromGitHub rec {
   name = "${pname}-${version}";
 
   owner = "rubjo";
   repo = pname;
   rev = "v${version}";
 
+  # Upstream prefers we download from the website,
+  # but we really insist on a more versioned resource.
+  # Happily, tagged releases on github contain the same
+  # file `VictorMonoAll.zip` as from the website,
+  # so we extract it from the tagged release.
+  # Both methods produce the same file, but this way
+  # we can safely reason about what version it is.
   postFetch = ''
-    tar xf $downloadedFile --strip=1
-    unzip public/VictorMonoAll.zip TTF/\*
-    mkdir -p $out/share/fonts/truetype/${pname}
-    cp TTF/*.ttf $out/share/fonts/truetype/${pname}
+    tar xvf $downloadedFile --strip-components=2 ${name}/public/VictorMonoAll.zip
+
+    mkdir -p $out/share/fonts/{true,open}type/${pname}
+
+    unzip -j VictorMonoAll.zip \*.ttf -d $out/share/fonts/truetype/${pname}
+    unzip -j VictorMonoAll.zip \*.otf -d $out/share/fonts/opentype/${pname}
   '';
 
-  sha256 = "0gisjcywmn3kjgwfmzcv8ibxqd126s93id2w0zjly0c7m3ckamh8";
+  sha256 = "0347n3kdyrbg42rxcgnyghi21qz5iz6w30v7ms2vjal7pfm6h2vn";
 
   meta = with lib; {
-    homepage = https://rubjo.github.io/victor-mono;
-    description = "A free programming font with cursive italics and ligatures";
+    description = "Free programming font with cursive italics and ligatures";
+    homepage = "https://rubjo.github.io/victor-mono";
     license = with licenses; [ mit ];
-    maintainers = with maintainers; [ jpotier ];
+    maintainers = with maintainers; [ jpotier dtzWill ];
     platforms = platforms.all;
   };
 }
+