1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 pkg-config,
6 mono,
7 glib,
8 pango,
9 gtk2,
10 libxml2,
11 monoDLLFixer,
12 autoconf,
13 automake,
14 libtool,
15 which,
16 fetchpatch,
17}:
18
19stdenv.mkDerivation rec {
20 pname = "gtk-sharp";
21 version = "2.12.45";
22
23 builder = ./builder.sh;
24 src = fetchFromGitHub {
25 owner = "mono";
26 repo = "gtk-sharp";
27 rev = version;
28 sha256 = "1vy6yfwkfv6bb45bzf4g6dayiqkvqqvlr02rsnhd10793hlpqlgg";
29 };
30
31 patches = [
32 (fetchpatch {
33 url = "https://projects.archlinux.de/svntogit/packages.git/plain/trunk/gtk-sharp2-2.12.12-gtkrange.patch?h=packages/gtk-sharp-2";
34 sha256 = "bjx+OfgWnN8SO82p8G7pbGuxJ9EeQxMLeHnrtEm8RV8=";
35 })
36 ];
37
38 postInstall = ''
39 pushd $out/bin
40 for f in gapi2-*
41 do
42 substituteInPlace $f --replace mono ${mono}/bin/mono
43 done
44 popd
45 '';
46
47 nativeBuildInputs = [
48 pkg-config
49 autoconf
50 automake
51 libtool
52 which
53 ];
54
55 buildInputs = [
56 mono
57 glib
58 pango
59 gtk2
60 libxml2
61 ];
62
63 preConfigure = ''
64 ./bootstrap-${lib.versions.majorMinor version}
65 '';
66
67 env.NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion";
68
69 dontStrip = true;
70
71 inherit monoDLLFixer;
72
73 passthru = {
74 gtk = gtk2;
75 };
76
77 meta = with lib; {
78 description = "Graphical User Interface Toolkit for mono and .Net";
79 homepage = "https://www.mono-project.com/docs/gui/gtksharp";
80 platforms = platforms.unix;
81 license = licenses.gpl2;
82 };
83}