1{
2 lib,
3 stdenv,
4 fetchzip,
5}:
6
7let
8 mkVariant =
9 variant:
10 {
11 version,
12 abbreviation,
13 sha256,
14 outputHash,
15 }:
16 stdenv.mkDerivation {
17 name = "tex-gyre-${variant}-${version}";
18 inherit version;
19
20 src = fetchzip {
21 url = "http://www.gust.org.pl/projects/e-foundry/tex-gyre/${variant}/${abbreviation}${version}otf.zip";
22 stripRoot = false;
23 inherit sha256;
24 };
25
26 installPhase = ''
27 mkdir -p $out/share/fonts/opentype/
28 # Pagella & Adventor are not flat archives
29 test -d "${abbreviation}${version}otf" && cd "${abbreviation}${version}otf"
30 cp -v *.otf $out/share/fonts/opentype/
31 '';
32
33 outputHashAlgo = "sha256";
34 outputHashMode = "recursive";
35 inherit outputHash;
36
37 meta = with lib; {
38 homepage = "http://www.gust.org.pl/projects/e-foundry/tex-gyre";
39 # "The TeX Gyre fonts are licensed under the GUST Font License (GFL),
40 # which is a free license, legally equivalent to the LaTeX Project Public
41 # License (LPPL), version 1.3c or later." - GUST website
42 license = licenses.lppl13c;
43 maintainers = [ ];
44 platforms = platforms.all;
45 };
46 };
47in
48lib.mapAttrs mkVariant {
49 adventor = {
50 version = "2_501";
51 sha256 = "0qjg3x0adfppyx3x33cm07ww9i9sl88xaq07m7wfip8rmyp567fn";
52 outputHash = "117h6f02m1r54b4f1a98q5kkjchl5pv9ibm1jla6xrzhk2pchb27";
53 abbreviation = "qag";
54 };
55 bonum = {
56 version = "2.004";
57 sha256 = "0qbrs98knx4h0b297c5n3vav4mkal1a95ai2dzmdc10pghfzl8vv";
58 outputHash = "0bid8gzwz50ylmm8jyqf9s4nfvy6cp1x34wbyrh4gyk1ki6hf3z1";
59 abbreviation = "qbk";
60 };
61 chorus = {
62 version = "2.003";
63 sha256 = "1b0zak27fzmapwbf2jasvsd95vhnqyc92n985d1lc1ivwja1zgfa";
64 outputHash = "0fqifd45c1ys6y98b66lmldfbv7wjb2414fs9swicv4n7xvl3cp1";
65 abbreviation = "qzc";
66 };
67 cursor = {
68 version = "2.004";
69 sha256 = "0ck3jm33bk2xsxp5d2irzd3j24zb49f0gnjvd1nikg1ivk8w85ng";
70 outputHash = "0i76835xqlkrnlx303mx63m0f4899j056c2ag2fl6p9qk8s4rskp";
71 abbreviation = "qcr";
72 };
73 heros = {
74 version = "2.004";
75 sha256 = "1fj2srxxf6ap913y5yd3dn4jzg828j7381gifs39nm5lnzmgw78y";
76 outputHash = "16y76ab46fxm9k8wfmwx4w0cl96yrmjywz587lyr08s0agp1v3kf";
77 abbreviation = "qhv";
78 };
79 pagella = {
80 version = "2_501";
81 sha256 = "1kccaxs3vk93la2pz4nv05hx1x3diyla49cz4l33zifdcp2zgg9d";
82 outputHash = "1nnjsgplimh29502pkd19rvfg93x31svxxmx4x7h51njrx1j8qa8";
83 abbreviation = "qpl";
84 };
85 schola = {
86 version = "2.005";
87 sha256 = "05z3gk4mm0sa7wwjcv31j2xlzqhwhcncpamn0kn9y0221cdknyp8";
88 outputHash = "1yqq1ngcylhldrh1v35l439k72szq9m4gx6g0wh235fk65chb2bm";
89 abbreviation = "qcs";
90 };
91 termes = {
92 version = "2.004";
93 sha256 = "1aq3yqbgkc3z20dkcqyhicsyq0afbgg4l397z96sd8a16jyz2x8k";
94 outputHash = "1igw821m601h8937pix6yish4d8fxmz3h4j9hripf41bxsiafzzg";
95 abbreviation = "qtm";
96 };
97}