aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/graphics/mypaint/default.nix
blob: 5ebbee0e4d6f3fe74e8038a78637d3413298a632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{ stdenv
, fetchFromGitHub
, gtk3
, intltool
, json_c
, lcms2
, libpng
, librsvg
, gobject-introspection
, libmypaint
, mypaint-brushes
, gdk-pixbuf
, pkgconfig
, python3
, swig
, wrapGAppsHook
}:

let
  inherit (python3.pkgs) pycairo pygobject3 numpy buildPythonApplication;
in buildPythonApplication rec {
  pname = "mypaint";
  version = "2.0.0";

  src = fetchFromGitHub {
    owner = "mypaint";
    repo = "mypaint";
    rev = "v${version}";
    sha256 = "180kyilhf81ndhwl1hlvy82gh6hxpcvka2d1nkghbpgy431rls6r";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    intltool
    pkgconfig
    swig
    wrapGAppsHook
    gobject-introspection # for setup hook
  ];
  buildInputs = [
    gtk3
    gdk-pixbuf
    libmypaint
    mypaint-brushes
    json_c
    lcms2
    libpng
    librsvg
    pycairo
    pygobject3
  ];

  propagatedBuildInputs = [
    numpy
    pycairo
    pygobject3
  ];

  checkInputs = [
    gtk3
  ];

  buildPhase = ''
    runHook preBuild

    ${python3.interpreter} setup.py build

    runHook postBuild
  '';

  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 stdenv.lib; {
    description = "A graphics application for digital painters";
    homepage = "http://mypaint.org/";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ goibhniu jtojnar ];
  };
}