about summary refs log tree commit diff
path: root/pkgs/applications/graphics/pinta/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/graphics/pinta/default.nix')
-rw-r--r--pkgs/applications/graphics/pinta/default.nix43
1 files changed, 31 insertions, 12 deletions
diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix
index 7dc6014ec8b5..801ed7a1b619 100644
--- a/pkgs/applications/graphics/pinta/default.nix
+++ b/pkgs/applications/graphics/pinta/default.nix
@@ -1,25 +1,44 @@
 {stdenv, fetchgit, mono, gtksharp, pkgconfig}:
 
 stdenv.mkDerivation {
-  name = "pinta-20100617";
-
-  builder = ./builder.sh;
+  name = "pinta-0.3";
 
   src = fetchgit {
     url = http://github.com/jpobst/Pinta.git;
-    tag = "0.3";
-    sha256 = "0qvpz9602igjmv8ba6vc4kg9jj3yyw0frl7wgz62hdxiizdfhm2f";
+    rev = "0.3";
+    sha256 = "17fde1187be4cfd50a9acda4ba45584e24d51ff22df5074654bed23f61faf33b";
   };
 
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
+  buildInputs = [mono gtksharp pkgconfig];
 
-  makePhase = ''
-    HOME=`pwd`/tmphome
-    mkdir -p $HOME
-    xbuild Pinta.Core/Pinta.Core.csproj /v:diag
+  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
   '';
 
-  buildInputs = [mono gtksharp pkgconfig];
+  # Very ugly - I don't know enough Mono to improve this. Isn't there any rpath in binaries?
+  installPhase = ''
+    ensureDir $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; 
 
-  inherit gtksharp;
+  meta = {
+    homepage = http://www.pinta-project.com/;
+    description = "Drawing/editing program modeled after Paint.NET";
+    license = "MIT";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
 }