mastodon: 4.3.1 -> 4.3.2 (#361487)
[NixPkgs.git] / pkgs / development / python-modules / gftools / default.nix
blobc997cee039fff2bd362f5d8aa1c565f2d35a01f0
2   lib,
3   fetchFromGitHub,
4   buildPythonPackage,
5   pytestCheckHook,
6   setuptools,
7   setuptools-scm,
8   absl-py,
9   afdko,
10   axisregistry,
11   babelfont,
12   beautifulsoup4,
13   black,
14   brotli,
15   bumpfontversion,
16   coreutils,
17   diffenator2,
18   font-v,
19   fontbakery,
20   fontfeatures,
21   fontmake,
22   fonttools,
23   gflanguages,
24   gfsubsets,
25   glyphsets,
26   glyphslib,
27   harfbuzz,
28   jinja2,
29   nanoemoji,
30   networkx,
31   ninja,
32   opentype-feature-freezer,
33   ots-python,
34   packaging,
35   paintcompiler,
36   pillow,
37   protobuf,
38   pycairo,
39   pygit2,
40   pygithub,
41   pytest,
42   pyyaml,
43   requests,
44   rich,
45   ruamel-yaml,
46   skia-pathops,
47   statmake,
48   strictyaml,
49   tabulate,
50   ttfautohint-py,
51   ufomerge,
52   unidecode,
53   vharfbuzz,
54   vttlib,
55   python,
58 let
59   fontmake' = python.withPackages (ps: [ ps.fontmake ] ++ ps.fontmake.optional-dependencies.json);
60   fonttools' = python.withPackages (ps: [ ps.fonttools ] ++ ps.fonttools.optional-dependencies.ufo);
62 buildPythonPackage rec {
63   pname = "gftools";
64   version = "0.9.74";
65   pyproject = true;
67   src = fetchFromGitHub {
68     owner = "googlefonts";
69     repo = "gftools";
70     rev = "refs/tags/v${version}";
71     hash = "sha256-AIE2b2BgW4LYtnS76t4vu6B2POmqKgMzLLqRs9K40Gg=";
72   };
74   postPatch = ''
75     substituteInPlace \
76       Lib/gftools/builder/operations/{buildTTF,glyphs2ds,buildVariable,buildOTF}.py \
77       --replace-fail '"fontmake' '"${lib.getExe' fontmake' "fontmake"}'
79     substituteInPlace \
80       Lib/gftools/builder/operations/instantiateUfo.py \
81       --replace-fail "'fontmake" "'${lib.getExe' fontmake' "fontmake"}"
83     substituteInPlace \
84       Lib/gftools/builder/operations/{compress,subspace}.py \
85       --replace-fail '"fonttools' '"${lib.getExe' fonttools' "fonttools"}'
87     substituteInPlace \
88       Lib/gftools/builder/operations/hbsubset.py \
89       --replace-fail '"pyftsubset"' '"${lib.getExe' fonttools' "pyftsubset"}"' \
90       --replace-fail '"hb-subset"' '"${lib.getExe' harfbuzz "hb-subset"}"'
92     substituteInPlace \
93       Lib/gftools/builder/operations/autohintOTF.py \
94       --replace-fail '"otfautohint' '"${lib.getExe' afdko "otfautohint"}'
96     substituteInPlace \
97       Lib/gftools/builder/operations/paintcompiler.py \
98       --replace-fail '"paintcompiler' '"${lib.getExe paintcompiler}'
100     substituteInPlace \
101       Lib/gftools/builder/operations/featureFreeze.py \
102       --replace-fail '"pyftfeatfreeze' '"${lib.getExe opentype-feature-freezer}'
104     substituteInPlace \
105       Lib/gftools/builder/operations/copy.py \
106       --replace-fail '"cp' '"${lib.getExe' coreutils "cp"}'
108     substituteInPlace \
109       Lib/gftools/builder/operations/{fix,remap,autohint,buildStat,addSubset,remapLayout,buildVTT}.py \
110       --replace-fail '"gftools' '"${placeholder "out"}/bin/gftools'
112     substituteInPlace \
113       Lib/gftools/builder/operations/rename.py \
114       --replace-fail "'gftools" "'${placeholder "out"}t/bin/gftools"
115   '';
117   env.PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
119   pythonRelaxDeps = [
120     "protobuf"
121     "pygit2"
122   ];
124   build-system = [
125     setuptools
126     setuptools-scm
127   ];
129   dependencies = [
130     absl-py
131     afdko
132     axisregistry
133     babelfont
134     beautifulsoup4
135     brotli
136     bumpfontversion
137     font-v
138     fontfeatures
139     fontmake
140     fonttools
141     gflanguages
142     gfsubsets
143     glyphsets
144     glyphslib
145     jinja2
146     nanoemoji
147     networkx
148     ninja
149     ots-python
150     packaging
151     pillow
152     protobuf
153     pygit2
154     pygithub
155     pyyaml
156     requests
157     rich
158     ruamel-yaml
159     setuptools
160     skia-pathops
161     statmake
162     strictyaml
163     tabulate
164     ttfautohint-py
165     ufomerge
166     unidecode
167     vharfbuzz
168     vttlib
169   ] ++ fonttools.optional-dependencies.ufo ++ fontmake.optional-dependencies.json;
171   optional-dependencies = {
172     qa = [
173       diffenator2
174       fontbakery
175       pycairo
176     ];
177     test = [
178       black
179       pytest
180     ];
181   };
183   nativeCheckInputs = [ pytestCheckHook ];
185   disabledTestPaths = [
186     # Wants none exsiting module
187     "bin/test_args.py"
188     # Requires internet
189     "tests/push/test_items.py"
190     "tests/test_gfgithub.py"
191     "tests/test_usage.py"
192     "tests/push/test_servers.py"
193     # Can't find directory
194     "tests/test_builder.py"
195     "tests/test_dependencies.py"
196     "tests/test_fix.py"
197   ];
199   pythonImportsCheck = [ "gftools" ];
201   meta = with lib; {
202     description = "Misc tools for working with the Google Fonts library";
203     homepage = "https://github.com/googlefonts/gftools";
204     changelog = "https://github.com/googlefonts/gftools/releases/tag/v${version}";
205     license = licenses.asl20;
206     mainProgram = "gftools";
207     maintainers = with maintainers; [ jopejoe1 ];
208   };