summary refs log tree commit diff
path: root/pkgs/data/fonts
diff options
context:
space:
mode:
authorIvan Timokhin <nixpkgs@ivan.timokhin.name>2023-08-20 17:40:34 +0300
committerIvan Timokhin <nixpkgs@ivan.timokhin.name>2023-10-26 22:52:23 +0300
commitefb9f909d6102d8f7eb02c2bec049a391578f6d4 (patch)
tree37a2a4da6012402b0f1ae1543efc1fb4b8a73a71 /pkgs/data/fonts
parent377a39f0a23899132e7fa61eab130547c631896f (diff)
downloadnixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.tar
nixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.tar.gz
nixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.tar.bz2
nixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.tar.lz
nixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.tar.xz
nixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.tar.zst
nixpkgs-efb9f909d6102d8f7eb02c2bec049a391578f6d4.zip
junicode: 1.003 -> 2.001
Release announcement:
https://github.com/psb1558/Junicode-font/releases/tag/v2.001

This is a breaking change, at least in font file naming (Junicode.ttf
is now Junicode-Regular.ttf). In general, 2.0 adds a lot more font
variants and opentype and web font versions of the font.

Seeing as backward compatibility is broken anyway, I opted to break it
a bit more and change custom install path (`junicode-ttf`) to
seemingly more conventional `truetype`; new .otf and .woff2 variants
are then naturally placed in corresponding directories. This
does *not* affect the `fonts.packages` NixOS option, which rearranges
font files anyway, but brings a degree of consistency with other
fonts.

Both the file renaming and the directory structure change break
satysfi, however, so I adjusted its builder accordingly, copying over
only those font variants that were also present in 1.0 series.
Diffstat (limited to 'pkgs/data/fonts')
-rw-r--r--pkgs/data/fonts/junicode/default.nix24
1 files changed, 13 insertions, 11 deletions
diff --git a/pkgs/data/fonts/junicode/default.nix b/pkgs/data/fonts/junicode/default.nix
index 4e42cf1c417..622f9d84161 100644
--- a/pkgs/data/fonts/junicode/default.nix
+++ b/pkgs/data/fonts/junicode/default.nix
@@ -1,22 +1,24 @@
-{ lib, stdenvNoCC, fetchFromGitHub }:
+{ lib, stdenvNoCC, fetchzip }:
 
-stdenvNoCC.mkDerivation {
+stdenvNoCC.mkDerivation rec {
   pname = "junicode";
-  version = "1.003";
+  version = "2.001";
 
-  src = fetchFromGitHub {
-    owner = "psb1558";
-    repo = "Junicode-font";
-    rev = "55d816d91a5e19795d9b66edec478379ee2b9ddb";
-    hash = "sha256-eTiMgI8prnpR4H6sqKRaB3Gcnt4C5QWZalRajWW49G4=";
+  src = fetchzip {
+    url = "https://github.com/psb1558/Junicode-font/releases/download/v${version}/Junicode_${version}.zip";
+    hash = "sha256-AEbRU0KiB9gLdxcXn8Mn/XLjBEm0qa4cV6+xE1HKU5s=";
   };
 
+  outputs = [ "out" "doc" ];
+
   installPhase = ''
     runHook preInstall
 
-    local out_ttf=$out/share/fonts/junicode-ttf
-    mkdir -p $out_ttf
-    cp legacy/*.ttf $out_ttf
+    install -Dt $out/share/fonts/truetype TTF/*.ttf VAR/*.ttf
+    install -Dt $out/share/fonts/opentype OTF/*.otf
+    install -Dt $out/share/fonts/woff2 WOFF2/*.woff2
+
+    install -Dt $doc/share/doc/${pname}-${version} docs/*.pdf
 
     runHook postInstall
   '';