summary refs log tree commit diff
path: root/pkgs/applications/graphics/pinta/default.nix
blob: 6958c94f7e18e16359ee74fe07920b4459057cd4 (plain) (blame)
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
{stdenv, fetchurl, mono, gtksharp, pkgconfig}:

stdenv.mkDerivation {
  name = "pinta-1.4";

  src = fetchurl {
    url = "https://github.com/PintaProject/Pinta/tarball/3f7ccfa93d";
    name = "pinta-1.4.tar.gz";
    sha256 = "1kgb4gy5l6bd0akniwhiqqkvqayr5jgdsvn2pgg1038q9raafnpn";
  };

  buildInputs = [mono gtksharp pkgconfig];

  buildPhase = ''
    # xbuild understands pkgconfig, but gtksharp does not give .pc for gdk-sharp
    # So we have to go the GAC-way
    export MONO_GAC_PREFIX=${gtksharp}
    xbuild Pinta.sln
  '';

  # Very ugly - I don't know enough Mono to improve this. Isn't there any rpath in binaries?
  installPhase = ''
    mkdir -p $out/lib/pinta $out/bin
    cp bin/*.{dll,exe} $out/lib/pinta
    cat > $out/bin/pinta << EOF
    #!/bin/sh
    export MONO_GAC_PREFIX=${gtksharp}:\$MONO_GAC_PREFIX
    export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${gtksharp}/lib:${gtksharp.gtk}/lib:${mono}/lib
    exec ${mono}/bin/mono $out/lib/pinta/Pinta.exe
    EOF
    chmod +x $out/bin/pinta
  '';

  # Always needed on Mono, otherwise nothing runs
  dontStrip = true; 

  meta = {
    homepage = http://www.pinta-project.com/;
    description = "Drawing/editing program modeled after Paint.NET";
    license = stdenv.lib.licenses.mit;
    maintainers = with stdenv.lib.maintainers; [viric];
    platforms = with stdenv.lib.platforms; linux;
  };
}