about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gtk-sharp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gtk-sharp')
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix79
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh11
3 files changed, 154 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix
new file mode 100644
index 000000000000..f35f5e0552c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix
@@ -0,0 +1,79 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, pkg-config
+, mono
+, glib
+, pango
+, gtk2
+, GConf ? null
+, libglade ? null
+, libgtkhtml ? null
+, gtkhtml ? null
+, libgnomecanvas ? null
+, libgnomeui ? null
+, libgnomeprint ? null
+, libgnomeprintui ? null
+, libxml2
+, monoDLLFixer
+, autoconf
+, automake
+, libtool
+, which
+, fetchpatch
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-sharp";
+  version = "2.12.45";
+
+  builder = ./builder.sh;
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "gtk-sharp";
+    rev = version;
+    sha256 = "1vy6yfwkfv6bb45bzf4g6dayiqkvqqvlr02rsnhd10793hlpqlgg";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://projects.archlinux.de/svntogit/packages.git/plain/trunk/gtk-sharp2-2.12.12-gtkrange.patch?h=packages/gtk-sharp-2";
+      sha256 = "bjx+OfgWnN8SO82p8G7pbGuxJ9EeQxMLeHnrtEm8RV8=";
+    })
+  ];
+
+  postInstall = ''
+    pushd $out/bin
+    for f in gapi2-*
+    do
+      substituteInPlace $f --replace mono ${mono}/bin/mono
+    done
+    popd
+  '';
+
+  nativeBuildInputs = [ pkg-config autoconf automake libtool which ];
+
+  buildInputs = [
+    mono glib pango gtk2 GConf libglade libgnomecanvas
+    libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
+  ];
+
+  preConfigure = ''
+    ./bootstrap-${lib.versions.majorMinor version}
+  '';
+
+  dontStrip = true;
+
+  inherit monoDLLFixer;
+
+  passthru = {
+    gtk = gtk2;
+  };
+
+  meta = with lib; {
+    description = "Graphical User Interface Toolkit for mono and .Net";
+    homepage = "https://www.mono-project.com/docs/gui/gtksharp";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
new file mode 100644
index 000000000000..6b996244a9f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, pkg-config
+, mono
+, glib
+, pango
+, gtk3
+, GConf ? null
+, libglade ? null
+, libgtkhtml ? null
+, gtkhtml ? null
+, libgnomecanvas ? null
+, libgnomeui ? null
+, libgnomeprint ? null
+, libgnomeprintui ? null
+, libxml2
+, monoDLLFixer
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-sharp";
+  version = "2.99.3";
+
+  builder = ./builder.sh;
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "18n3l9zcldyvn4lwi8izd62307mkhz873039nl6awrv285qzah34";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    mono glib pango gtk3 GConf libglade libgnomecanvas
+    libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
+  ];
+
+  patches = [
+    # Fixes MONO_PROFILE_ENTER_LEAVE undeclared when compiling against newer versions of mono.
+    # @see https://github.com/mono/gtk-sharp/pull/266
+    (fetchpatch {
+      name = "MONO_PROFILE_ENTER_LEAVE.patch";
+      url = "https://github.com/mono/gtk-sharp/commit/401df51bc461de93c1a78b6a7a0d5adc63cf186c.patch";
+      sha256 = "0hrkcr5a7wkixnyp60v4d6j3arsb63h54rd30lc5ajfjb3p92kcf";
+    })
+    # @see https://github.com/mono/gtk-sharp/pull/263
+    (fetchpatch {
+      name = "disambiguate_Gtk.Range.patch";
+      url = "https://github.com/mono/gtk-sharp/commit/a00552ad68ae349e89e440dca21b86dbd6bccd30.patch";
+      sha256 = "1ylplr9g9x7ybsgrydsgr6p3g7w6i46yng1hnl3afgn4vj45rag2";
+    })
+  ];
+
+  dontStrip = true;
+
+  inherit monoDLLFixer;
+
+  passthru = {
+    inherit gtk3;
+  };
+
+  meta = {
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh b/nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh
new file mode 100644
index 000000000000..4b8f757540b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh
@@ -0,0 +1,11 @@
+source $stdenv/setup
+
+genericBuild
+
+# !!! hack
+export ALL_INPUTS="$out $pkgs"
+
+find $out -name "*.dll.config" | while read configFile; do
+    echo "modifying config file $configFile"
+    $monoDLLFixer "$configFile"
+done