nixpkgs/pkgs/applications/graphics/mypaint/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

142 lines
3.3 KiB
Nix
Raw Normal View History

{ lib
2019-11-28 13:33:15 +00:00
, fetchFromGitHub
2022-04-06 21:21:37 +00:00
, fetchpatch
2019-11-28 13:33:15 +00:00
, gtk3
, gettext
2019-11-28 13:33:15 +00:00
, json_c
, lcms2
, libpng
, librsvg
, gobject-introspection
2019-01-27 09:25:23 +00:00
, libmypaint
, hicolor-icon-theme
2019-01-27 09:25:23 +00:00
, mypaint-brushes
2019-11-28 13:33:15 +00:00
, gdk-pixbuf
, pkg-config
2019-01-27 09:25:23 +00:00
, python3
2019-11-28 13:33:15 +00:00
, swig
, wrapGAppsHook
}:
let
2019-01-27 09:25:23 +00:00
inherit (python3.pkgs) pycairo pygobject3 numpy buildPythonApplication;
in buildPythonApplication rec {
pname = "mypaint";
version = "2.0.1";
format = "other";
2017-07-03 19:21:50 +00:00
src = fetchFromGitHub {
owner = "mypaint";
repo = "mypaint";
2019-01-27 09:25:23 +00:00
rev = "v${version}";
hash = "sha256-rVKcxzWZRLcuxK8xRyRgvitXAh4uOEyqHswLeTdA2Mk=";
2017-07-03 19:21:50 +00:00
fetchSubmodules = true;
};
2022-04-06 21:21:37 +00:00
patches = [
# Fix build due to setuptools issue.
# https://github.com/mypaint/mypaint/pull/1183
(fetchpatch {
url = "https://github.com/mypaint/mypaint/commit/423950bec96d6057eac70442de577364d784a847.patch";
hash = "sha256-OxJJOi20bFMRibL59zx6svtMrkgeMYyEvbdSXbZHqpc=";
})
# https://github.com/mypaint/mypaint/pull/1193
(fetchpatch {
name = "python-3.11-compatibility.patch";
url = "https://github.com/mypaint/mypaint/commit/032a155b72f2b021f66a994050d83f07342d04af.patch";
hash = "sha256-EI4WJbpZrCtFMKd6QdXlWpRpIHi37gJffDjclzTLaLc=";
2022-04-06 21:21:37 +00:00
})
2024-02-03 20:00:44 +00:00
# Fix drag-n-drop file opening
(fetchpatch {
url = "https://github.com/mypaint/mypaint/commit/66b2ba98bd953afa73d0d6ac71040b14a4ea266b.patch";
hash = "sha256-4AWXD/JMpNA5otl2ad1ZLVPW49pycuOXGcgfzvj0XEE=";
})
# Fix crash with locked layer
(fetchpatch {
url = "https://github.com/mypaint/mypaint/commit/0b720f8867f18acccc8e6ec770a9cc494aa81dcf.patch";
hash = "sha256-ahYeERiMLA8yKIXQota6/ApAbOW0XwsHO2JkEEMm1Ow=";
})
# Refactoring for the following patch to apply.
(fetchpatch {
url = "https://github.com/mypaint/mypaint/commit/d7d2496401a112a178d5fa2e491f0cc7537d24cd.patch";
hash = "sha256-dIW6qWqY96+bsUDQQtGtjENvypnh//Ep3xW+wooCJ14=";
includes = [
"gui/colors/hcywheel.py"
];
})
# Fix crash with hcy wheel masking
(fetchpatch {
url = "https://github.com/mypaint/mypaint/commit/5496b1cd1113fcd46230d87760b7e6b51cc747bc.patch";
hash = "sha256-h+sE1LW04xDU2rofH5KqXsY1M0jacfBNBC+Zb0i6y1w=";
})
2022-04-06 21:21:37 +00:00
];
nativeBuildInputs = [
gettext
pkg-config
2019-11-28 13:33:15 +00:00
swig
wrapGAppsHook
gobject-introspection # for setup hook
hicolor-icon-theme # fór setup hook
python3.pkgs.setuptools
];
buildInputs = [
2019-11-28 13:33:15 +00:00
gtk3
gdk-pixbuf
2019-01-27 09:25:23 +00:00
libmypaint
mypaint-brushes
2019-11-28 13:33:15 +00:00
json_c
lcms2
libpng
librsvg
pycairo
pygobject3
# Mypaint checks for a presence of this theme scaffold and crashes when not present.
hicolor-icon-theme
];
2017-07-03 19:21:50 +00:00
2019-11-28 13:33:15 +00:00
propagatedBuildInputs = [
numpy
2019-01-27 09:25:23 +00:00
pycairo
pygobject3
2019-11-28 13:33:15 +00:00
];
nativeCheckInputs = [
2019-01-27 09:25:23 +00:00
gtk3
];
buildPhase = ''
runHook preBuild
${python3.interpreter} setup.py build
runHook postBuild
2017-07-03 19:21:50 +00:00
'';
2019-01-27 09:25:23 +00:00
installPhase = ''
runHook preInstall
${python3.interpreter} setup.py managed_install --prefix=$out
runHook postInstall
'';
checkPhase = ''
runHook preCheck
HOME=$TEMPDIR ${python3.interpreter} setup.py test
runHook postCheck
'';
meta = with lib; {
description = "A graphics application for digital painters";
2019-11-28 13:33:15 +00:00
homepage = "http://mypaint.org/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
2017-07-03 19:21:50 +00:00
maintainers = with maintainers; [ goibhniu jtojnar ];
};
}