league-of-moveable-type: migrate to symlinkJoin

This commit is contained in:
Minijackson 2023-01-21 14:57:24 +01:00
parent 2d34ea393f
commit 9303d8fb51
3 changed files with 42 additions and 138 deletions

View file

@ -1,35 +1,46 @@
{lib, stdenv, fetchurl, unzip, raleway}:
{ lib
, symlinkJoin
, the-neue-black
, blackout
, chunk
, fanwood
, goudy-bookletter-1911
, junction-font
, knewave
, league-gothic
, league-script-number-one
, league-spartan
, linden-hill
, orbitron
, ostrich-sans
, prociono
, raleway
, sniglet
, sorts-mill-goudy
}:
let
symlinkJoin {
name = "league-of-moveable-type";
# TO UPDATE:
# ./update.sh > ./fonts.nix
# we use the extended version of raleway (same license).
fonts = [raleway]
++ map fetchurl (builtins.filter (f: f.name != "raleway.zip") (import ./fonts.nix));
in
stdenv.mkDerivation rec {
baseName = "league-of-moveable-type";
version = "2016-10-15";
name="${baseName}-${version}";
srcs = fonts;
nativeBuildInputs = [ unzip ];
sourceRoot = ".";
installPhase = ''
mkdir -p $out/share/fonts/opentype
cp */*.otf $out/share/fonts/opentype
# for Raleway, where the fonts are already in /share/…
cp */share/fonts/opentype/*.otf $out/share/fonts/opentype
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "1gy959qhhdwm1phbrkab9isi0dmxcy0yizzncb0k49w88mc13vd0";
paths = [
the-neue-black
blackout
chunk
fanwood
goudy-bookletter-1911
junction-font
knewave
league-gothic
league-script-number-one
league-spartan
linden-hill
orbitron
ostrich-sans
prociono
raleway
sniglet
sorts-mill-goudy
];
meta = {
description = "Font Collection by The League of Moveable Type";
@ -46,6 +57,6 @@ stdenv.mkDerivation rec {
license = lib.licenses.ofl;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ bergey Profpatsch ];
maintainers = with lib.maintainers; [ bergey minijackson Profpatsch ];
};
}

View file

@ -1,82 +0,0 @@
[
{
url = "https://www.theleagueofmoveabletype.com/league-spartan/download";
sha256 = "1z9pff8xm58njs7whaxb3sq4vbdkxv7llwgm9nqhwshmgr52jrm1";
name = "league-spartan.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/junction/download";
sha256 = "1qbhfha012ma26n43lm1fh06i7z47wk50r8qsp09bpxc5yr4ypi7";
name = "junction.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/ostrich-sans/download";
sha256 = "11ydhbgcfhmydcnim64vb035cha14krxxrbf62426dm6bvxkphp3";
name = "ostrich-sans.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/league-gothic/download";
sha256 = "0nbwsbwhs375kbis3lpk98dw05mnh455vghjg1cq0j2fsj1zb99b";
name = "league-gothic.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/blackout/download";
sha256 = "1r7dihnjvy4fgvaj5m4llc9dm4cpdl1l79mhg3as16qvjgazms3p";
name = "blackout.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/knewave/download";
sha256 = "065yiakhm6h6jkmigj4pqm2qi6saph0pwb7g8s9gwkskhkk5iy57";
name = "knewave.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/fanwood/download";
sha256 = "1023da7hik8ci8s7rcy6lh4h9p6igx1kz9y1a2cv6sizbp819w8g";
name = "fanwood.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/linden-hill/download";
sha256 = "0rm92rz9kki91l5wcn149mdpwq1mfql4dv6d159hv534qmg3z3ks";
name = "linden-hill.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/league-script-number-one/download";
sha256 = "056hb02a5vydrq5q0gwzanp2zkrrv1spm8sfc5wzhyfzgwd1vc76";
name = "league-script-number-one.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/raleway/download";
sha256 = "0f6anym0adq0ankqbdqx4lyzbysx824zqdj1x60gafyisjx48y87";
name = "raleway.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/prociono/download";
sha256 = "11hamjry5lx3cykzpjq7kwlp6h9cjqy470fmn9f2pi954b46xkdy";
name = "prociono.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/orbitron/download";
sha256 = "156w4j324d350pvjmzdg2w8inhhdfzrvb86rhlavgd9sxx2fykk4";
name = "orbitron.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/goudy-bookletter-1911/download";
sha256 = "01qganq5n7rgqw546lf45kj8j7ymfjr00i2bwp3qw7ibifg9pn4n";
name = "goudy-bookletter-1911.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/sorts-mill-goudy/download";
sha256 = "11aywj5lzapk04k2yzi1g96acbbm48x902ka0v9cfwwqpn6js9ra";
name = "sorts-mill-goudy.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/chunk/download";
sha256 = "15mbqwz90y1n4vlj2xkc8vd56va6la5qnxhiipvcmkrng5y3931j";
name = "chunk.zip";
}
{
url = "https://www.theleagueofmoveabletype.com/sniglet/download";
sha256 = "1lhpnjm52gyhy9s2kwbsg1rd9iyrqli5q9ngp141igx4p1bgbqkc";
name = "sniglet.zip";
}
]

View file

@ -1,25 +0,0 @@
#!/usr/bin/env bash
SITE=https://www.theleagueofmoveabletype.com
# since there is no nice way to get all the fonts,
# this fetches the homepage and extracts their names from the html …
fonts=$(curl "$SITE" 2>/dev/null | \
sed -ne 's/<img.*cloudfront.*images\/\(.*\)-[[:digit:]-]\..*$/\1/p')
# build an ad-hoc nixexpr list with the files & hashes
echo "["
for f in $fonts; do
url="$SITE/$f/download"
hash=$(nix-prefetch-url --type sha256 "$url" 2>/dev/null)
cat <<EOF
{
url = "$url";
sha256 = "$hash";
name = "$f.zip";
}
EOF
done
echo "]"