1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, fetchpatch
6, setuptools-scm
7, absl-py
8, lxml
9, skia-pathops
10, pytestCheckHook
11}:
12buildPythonPackage rec {
13 pname = "picosvg";
14 version = "0.22.1";
15
16 src = fetchFromGitHub {
17 owner = "googlefonts";
18 repo = pname;
19 rev = "refs/tags/v${version}";
20 hash = "sha256-jG1rfamegnX8GXDwqkGFBFzUeycRLDObJvGbxNk6OpM=";
21 };
22
23 patches = [
24 # see https://github.com/googlefonts/picosvg/issues/299
25 # this patch fixed a failing test case after the update to skia-pathops 0.8
26 # as soon as skia-pathops in nixpkgs is updated to 0.8, this patch should be removed
27 (fetchpatch {
28 url = "https://github.com/googlefonts/picosvg/commit/4e971ed6cd9afb412b2845d29296a0c24f086562.patch";
29 hash = "sha256-OZEipNPCSuuqcy4XggBiuGv4HN604dI4N9wlznyAwF0=";
30 revert = true;
31 })
32 ];
33
34 nativeBuildInputs = [
35 setuptools-scm
36 ];
37
38 propagatedBuildInputs = [
39 absl-py
40 lxml
41 skia-pathops
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 ];
47
48 # a few tests are failing on aarch64
49 doCheck = !stdenv.isAarch64;
50
51 meta = with lib; {
52 description = "Tool to simplify SVGs";
53 homepage = "https://github.com/googlefonts/picosvg";
54 license = licenses.asl20;
55 maintainers = with maintainers; [ _999eagle ];
56 };
57}