nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchzip,
5 texlive,
6 callPackage,
7}:
8
9stdenvNoCC.mkDerivation rec {
10 pname = "junicode";
11 version = "2.220";
12
13 src = fetchzip {
14 url = "https://github.com/psb1558/Junicode-font/releases/download/v${version}/Junicode_${version}.zip";
15 hash = "sha256-NZdNWnWMWscAI0p878mQ8rOoo5TlEDrKYzfiqGeo4lc=";
16 };
17
18 outputs = [
19 "out"
20 "doc"
21 "tex"
22 ];
23
24 patches = [ ./tex-font-path.patch ];
25
26 postPatch = ''
27 substituteInPlace TeX/junicode.sty \
28 --replace '@@@opentype_path@@@' "$out/share/fonts/opentype/" \
29 --replace '@@@truetype_path@@@' "$out/share/fonts/truetype/"
30 substituteInPlace TeX/junicodevf.sty \
31 --replace '@@@truetype_path@@@' "$out/share/fonts/truetype/"
32 '';
33
34 installPhase = ''
35 runHook preInstall
36
37 install -Dm 444 -t $out/share/fonts/truetype TTF/*.ttf VAR/*.ttf
38 install -Dm 444 -t $out/share/fonts/opentype OTF/*.otf
39 install -Dm 444 -t $out/share/fonts/woff2 WOFF2/*.woff2
40
41 install -Dm 444 -t $doc/share/doc/${pname}-${version} docs/*.pdf
42
43 install -Dm 444 -t $tex/tex/latex/junicode TeX/junicode.sty
44 install -Dm 444 -t $tex/tex/latex/junicodevf TeX/junicodevf.{sty,lua}
45
46 runHook postInstall
47 '';
48
49 passthru = {
50 tlDeps = with texlive; [
51 xkeyval
52 fontspec
53 ];
54
55 tests = callPackage ./tests.nix { };
56 };
57
58 meta = {
59 homepage = "https://github.com/psb1558/Junicode-font";
60 description = "Unicode font for medievalists";
61 maintainers = with lib.maintainers; [ ivan-timokhin ];
62 license = lib.licenses.ofl;
63 };
64}