Merge pull request #332298 from jopejoe1/fontmake-optinal

python3Packages.fontmake: modernize and add optional dependencies
This commit is contained in:
OTABI Tomoya 2024-08-10 00:36:42 +09:00 committed by GitHub
commit bea821b69e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 94 additions and 18 deletions

View File

@ -1,14 +1,17 @@
{
lib,
buildPythonPackage,
fetchPypi,
glyphslib,
setuptools-scm,
ufo2ft,
fonttools,
fetchFromGitHub,
pytestCheckHook,
fontmath,
lxml,
fonttools,
glyphslib,
setuptools,
setuptools-scm,
skia-pathops,
ttfautohint-py,
ufo2ft,
ufolib2,
}:
buildPythonPackage rec {
@ -16,28 +19,45 @@ buildPythonPackage rec {
version = "3.9.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-KrfT0fvE1fhaM2RH4LqRUda7yMHg2T59UdGi3SSZP7s=";
extension = "zip";
src = fetchFromGitHub {
owner = "googlefonts";
repo = "fontmake";
rev = "v${version}";
hash = "sha256-q6ul9MYbq85RpZE0ozHOCBNAR4r9InIjumadT1GyJ6k=";
};
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [
glyphslib
ufo2ft
fonttools
fontmath
lxml
build-system = [
setuptools
setuptools-scm
];
dependencies =
[
fontmath
fonttools
glyphslib
ufo2ft
ufolib2
]
++ fonttools.optional-dependencies.ufo
++ fonttools.optional-dependencies.lxml
++ fonttools.optional-dependencies.unicode;
optional-dependencies = {
pathops = [ skia-pathops ];
autohint = [ ttfautohint-py ];
json = ufolib2.optional-dependencies.json;
repacker = fonttools.optional-dependencies.repacker;
};
nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.autohint;
pythonImportsCheck = [ "fontmake" ];
meta = {
description = "Compiles fonts from various sources (.glyphs, .ufo, designspace) into binaries formats (.otf, .ttf)";
homepage = "https://github.com/googlefonts/fontmake";
changelog = "https://github.com/googlefonts/fontmake/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.BarinovMaxim ];
};

View File

@ -0,0 +1,54 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
setuptools,
setuptools-scm,
distutils,
ttfautohint,
fonttools,
}:
buildPythonPackage rec {
pname = "ttfautohint-py";
version = "0.5.1";
pyproject = true;
src = fetchFromGitHub {
owner = "fonttools";
repo = "ttfautohint-py";
rev = "refs/tags/v${version}";
hash = "sha256-NTog461RpyHKo/Qpicj3tflehaKj9LlZEN9qeCMM6JQ=";
};
postPatch = ''
substituteInPlace src/python/ttfautohint/__init__.py \
--replace-fail 'find_library("ttfautohint")' '"${lib.getLib ttfautohint}/lib/libttfautohint.so"'
'';
env.TTFAUTOHINTPY_BUNDLE_DLL = false;
build-system = [
setuptools
setuptools-scm
distutils
];
buildInputs = [ ttfautohint ];
nativeCheckInputs = [
pytestCheckHook
fonttools
];
pythonImportsCheck = [ "ttfautohint" ];
meta = {
description = "Command line utility and Python library that merges two UFO source format fonts into a single file";
homepage = "https://github.com/fonttools/ttfautohint-py";
changelog = "https://github.com/fonttools/ttfautohint-py/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jopejoe1 ];
};
}

View File

@ -15906,6 +15906,8 @@ self: super: with self; {
ttach = callPackage ../development/python-modules/ttach { };
ttfautohint-py = callPackage ../development/python-modules/ttfautohint-py { };
ttls = callPackage ../development/python-modules/ttls { };
ttn-client = callPackage ../development/python-modules/ttn-client { };