biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / graphics / mypaint / default.nix
blob10a19431dbfca8c01f54565f88606c765cc0c709
1 { lib
2 , fetchFromGitHub
3 , fetchpatch
4 , gtk3
5 , gettext
6 , json_c
7 , lcms2
8 , libpng
9 , librsvg
10 , gobject-introspection
11 , libmypaint
12 , hicolor-icon-theme
13 , mypaint-brushes
14 , gdk-pixbuf
15 , pkg-config
16 , python3
17 , swig
18 , wrapGAppsHook3
21 let
22   inherit (python3.pkgs) pycairo pygobject3 numpy buildPythonApplication;
23 in buildPythonApplication rec {
24   pname = "mypaint";
25   version = "2.0.1";
26   format = "other";
28   src = fetchFromGitHub {
29     owner = "mypaint";
30     repo = "mypaint";
31     rev = "v${version}";
32     hash = "sha256-rVKcxzWZRLcuxK8xRyRgvitXAh4uOEyqHswLeTdA2Mk=";
33     fetchSubmodules = true;
34   };
36   patches = [
37     # Fix build due to setuptools issue.
38     # https://github.com/mypaint/mypaint/pull/1183
39     (fetchpatch {
40       url = "https://github.com/mypaint/mypaint/commit/423950bec96d6057eac70442de577364d784a847.patch";
41       hash = "sha256-OxJJOi20bFMRibL59zx6svtMrkgeMYyEvbdSXbZHqpc=";
42     })
43     # https://github.com/mypaint/mypaint/pull/1193
44     (fetchpatch {
45       name = "python-3.11-compatibility.patch";
46       url = "https://github.com/mypaint/mypaint/commit/032a155b72f2b021f66a994050d83f07342d04af.patch";
47       hash = "sha256-EI4WJbpZrCtFMKd6QdXlWpRpIHi37gJffDjclzTLaLc=";
48     })
49     # Fix drag-n-drop file opening
50     (fetchpatch {
51       url = "https://github.com/mypaint/mypaint/commit/66b2ba98bd953afa73d0d6ac71040b14a4ea266b.patch";
52       hash = "sha256-4AWXD/JMpNA5otl2ad1ZLVPW49pycuOXGcgfzvj0XEE=";
53     })
54     # Fix crash with locked layer
55     (fetchpatch {
56       url = "https://github.com/mypaint/mypaint/commit/0b720f8867f18acccc8e6ec770a9cc494aa81dcf.patch";
57       hash = "sha256-ahYeERiMLA8yKIXQota6/ApAbOW0XwsHO2JkEEMm1Ow=";
58     })
59     # Refactoring for the following patch to apply.
60     (fetchpatch {
61       url = "https://github.com/mypaint/mypaint/commit/d7d2496401a112a178d5fa2e491f0cc7537d24cd.patch";
62       hash = "sha256-dIW6qWqY96+bsUDQQtGtjENvypnh//Ep3xW+wooCJ14=";
63       includes = [
64         "gui/colors/hcywheel.py"
65       ];
66     })
67     # Fix crash with hcy wheel masking
68     (fetchpatch {
69       url = "https://github.com/mypaint/mypaint/commit/5496b1cd1113fcd46230d87760b7e6b51cc747bc.patch";
70       hash = "sha256-h+sE1LW04xDU2rofH5KqXsY1M0jacfBNBC+Zb0i6y1w=";
71     })
72   ];
74   nativeBuildInputs = [
75     gettext
76     pkg-config
77     swig
78     wrapGAppsHook3
79     gobject-introspection # for setup hook
80     hicolor-icon-theme # fór setup hook
81     python3.pkgs.setuptools
82   ];
84   buildInputs = [
85     gtk3
86     gdk-pixbuf
87     libmypaint
88     mypaint-brushes
89     json_c
90     lcms2
91     libpng
92     librsvg
93     pycairo
94     pygobject3
96     # Mypaint checks for a presence of this theme scaffold and crashes when not present.
97     hicolor-icon-theme
98   ];
100   propagatedBuildInputs = [
101     numpy
102     pycairo
103     pygobject3
104   ];
106   nativeCheckInputs = [
107     gtk3
108   ];
110   buildPhase = ''
111     runHook preBuild
113     ${python3.interpreter} setup.py build
115     runHook postBuild
116   '';
118   installPhase = ''
119     runHook preInstall
121     ${python3.interpreter} setup.py managed_install --prefix=$out
123     runHook postInstall
124   '';
126   checkPhase = ''
127     runHook preCheck
129     HOME=$TEMPDIR ${python3.interpreter} setup.py test
131     runHook postCheck
132   '';
134   meta = with lib; {
135     description = "Graphics application for digital painters";
136     homepage = "http://mypaint.org/";
137     license = licenses.gpl2Plus;
138     platforms = platforms.linux;
139     maintainers = with maintainers; [ jtojnar ];
140   };