1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 replaceVars,
6 opentype-sanitizer,
7 setuptools-scm,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "ots-python";
13 version = "9.1.0";
14 format = "setuptools";
15
16 src = fetchPypi {
17 pname = "opentype-sanitizer";
18 inherit version;
19 hash = "sha256-1Zdd+eRECimZl8L8CCkm7pCjN0TafSsc5i2Y6/oH88I=";
20 };
21
22 patches = [
23 # Invoke ots-sanitize from the opentype-sanitizer package instead of
24 # downloading precompiled binaries from the internet.
25 # (nixpkgs-specific, not upstreamable)
26 (replaceVars ./0001-use-packaged-ots.patch {
27 ots_sanitize = "${opentype-sanitizer}/bin/ots-sanitize";
28 })
29 ];
30
31 propagatedBuildInputs = [ opentype-sanitizer ];
32 nativeBuildInputs = [ setuptools-scm ];
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 meta = with lib; {
37 description = "Python wrapper for ots (OpenType Sanitizer)";
38 homepage = "https://github.com/googlefonts/ots-python";
39 license = licenses.bsd3;
40 maintainers = with maintainers; [ danc86 ];
41 };
42}