about summary refs log tree commit diff
path: root/pkgs/development/python-modules/psautohint
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-08-25 20:14:19 +0200
committerJon <jonringer@users.noreply.github.com>2020-08-30 10:17:23 -0700
commite871d7ad35b5f1c3161931af9dd1a4f3728dce5c (patch)
treef0e8f07864228eb73be451b4a4fe350c63033399 /pkgs/development/python-modules/psautohint
parent40c0cde72ef5fb3e78349dd2b26fb37eebc60ea5 (diff)
pythonPackages.psautohint: init at 2.1.0
Diffstat (limited to 'pkgs/development/python-modules/psautohint')
-rw-r--r--pkgs/development/python-modules/psautohint/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/psautohint/default.nix b/pkgs/development/python-modules/psautohint/default.nix
new file mode 100644
index 0000000000000..0f89069c7d8fe
--- /dev/null
+++ b/pkgs/development/python-modules/psautohint/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
+, fonttools, lxml, fs
+, setuptools_scm
+, pytest, pytestcov, pytest_xdist, pytest-randomly
+}:
+
+buildPythonPackage rec {
+  pname = "psautohint";
+  version = "2.1.0";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner  = "adobe-type-tools";
+    repo   = pname;
+    sha256 = "1k1rx1adqxdxj5v3788lwnvygylp73sps1p0q44hws2vmsag2s8r";
+    rev    = "v${version}";
+    fetchSubmodules = true; # data dir for tests
+  };
+
+  postPatch = ''
+    echo '#define PSAUTOHINT_VERSION "${version}"' > libpsautohint/src/version.h
+    sed -i '/use_scm_version/,+3d' setup.py
+    sed -i '/setup(/a \     version="${version}",' setup.py
+  '';
+
+  nativeBuildInputs = [ setuptools_scm ];
+
+  propagatedBuildInputs = [ fonttools lxml fs ];
+
+  checkInputs = [ pytest pytestcov pytest_xdist pytest-randomly ];
+  checkPhase = "pytest tests";
+
+  meta = with lib; {
+    description = "Script to normalize the XML and other data inside of a UFO";
+    homepage = "https://github.com/adobe-type-tools/psautohint";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}