From 1da730d9109384dddb32f7ab9dfd8a6a5f26ca6d Mon Sep 17 00:00:00 2001
From: Vincent Laporte <Vincent.Laporte@gmail.com>
Date: Thu, 6 Nov 2014 00:24:59 +0000
Subject: [PATCH] Adds gnome-sharp

A .Net language binding for assorted GNOME libraries
---
 .../libraries/gnome-sharp/Makefile.in.patch   | 11 ++++++++++
 .../libraries/gnome-sharp/default.nix         | 22 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  2 ++
 3 files changed, 35 insertions(+)
 create mode 100644 pkgs/development/libraries/gnome-sharp/Makefile.in.patch
 create mode 100644 pkgs/development/libraries/gnome-sharp/default.nix

diff --git a/pkgs/development/libraries/gnome-sharp/Makefile.in.patch b/pkgs/development/libraries/gnome-sharp/Makefile.in.patch
new file mode 100644
index 000000000000..46b644f2471a
--- /dev/null
+++ b/pkgs/development/libraries/gnome-sharp/Makefile.in.patch
@@ -0,0 +1,11 @@
+--- a/sample/gnomevfs/Makefile.in	2009-03-03 16:09:52.000000000 +0000
++++ b/sample/gnomevfs/Makefile.in	2014-10-14 13:35:51.020427244 +0100
+@@ -218,7 +218,7 @@
+ 
+ @ENABLE_GNOMEVFS_FALSE@EXTRA_TARGETS = 
+ @ENABLE_GNOMEVFS_TRUE@@ENABLE_MONOGETOPTIONS_FALSE@EXTRA_TARGETS = 
+-@ENABLE_GNOMEVFS_TRUE@@ENABLE_MONOGETOPTIONS_TRUE@EXTRA_TARGETS = TestXfer.exe
++@ENABLE_GNOMEVFS_TRUE@@ENABLE_MONOGETOPTIONS_TRUE@EXTRA_TARGETS =
+ assemblies = ../../gnomevfs/gnome-vfs-sharp.dll
+ references = $(GTKSHARP_LIBS) $(addprefix /r:, $(assemblies))
+ noinst_SCRIPTS = $(TARGETS) $(EXTRA_TARGETS)
diff --git a/pkgs/development/libraries/gnome-sharp/default.nix b/pkgs/development/libraries/gnome-sharp/default.nix
new file mode 100644
index 000000000000..5818726e345e
--- /dev/null
+++ b/pkgs/development/libraries/gnome-sharp/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, pkgconfig, gtk, mono, gtk-sharp, gnome}:
+
+stdenv.mkDerivation {
+  name = "gnome-sharp-2.24.1";
+  src = fetchurl {
+    url = http://ftp.gnome.org/pub/gnome/sources/gnome-sharp/2.24/gnome-sharp-2.24.1.tar.gz;
+    sha256 = "0cfvs7hw67fp0wimskqd0gdfx323gv6hi0c5pf59krnmhdrl6z8p";
+  };
+
+  buildInputs = [ pkgconfig gtk mono gtk-sharp ]
+  ++ (with gnome; [ libart_lgpl gnome_vfs libgnome libgnomecanvas libgnomeui]);
+
+  patches = [ ./Makefile.in.patch ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.mono-project.com/docs/gui/gtksharp/;
+    description = "A .NET language binding for assorted GNOME libraries";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5bf40ee8fccd..7b87003869f3 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5582,6 +5582,8 @@ let
       else stdenv;
   };
 
+  gnome-sharp = callPackage ../development/libraries/gnome-sharp {};
+
   granite = callPackage ../development/libraries/granite { };
 
   gtk2 = callPackage ../development/libraries/gtk+/2.x.nix {