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