summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2013-08-04 20:59:05 +0200
committerVladimír Čunát <vcunat@gmail.com>2013-08-04 21:11:24 +0200
commit7fbcc562609249a6ba81b26064e31c00ed38ebda (patch)
tree0f3f1a5c64c86438081b9dd5c08a88aaefb8d5d7 /pkgs/development/libraries
parentdaf9c75ef4f999aea6e6c70506ee80f35714043e (diff)
downloadnixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.tar
nixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.tar.gz
nixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.tar.bz2
nixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.tar.lz
nixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.tar.xz
nixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.tar.zst
nixlib-7fbcc562609249a6ba81b26064e31c00ed38ebda.zip
add introspection into GTK libs (part of #517)
This is all work of Marc Weber <marco-oweber@gmx.de>, except for a few nitpicks.

Tested space blowup: IMHO negligible to headers and similar stuff,
e.g. the firefox closure (reported by du) grows from 560 to 579 MB.
Saving space should be handled separately,
e.g. we have the multiple-outputs branch.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/atk/default.nix4
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/default.nix8
-rw-r--r--pkgs/development/libraries/gobject-introspection/default.nix21
-rw-r--r--pkgs/development/libraries/gobject-introspection/setup-hook.sh14
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix4
-rw-r--r--pkgs/development/libraries/pango/default.nix6
-rw-r--r--pkgs/development/libraries/wxGTK-2.8/default.nix1
7 files changed, 41 insertions, 17 deletions
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index cea207f27bc5..f4c33c869112 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, perl, glib, libintlOrEmpty }:
+{ stdenv, fetchurl, pkgconfig, perl, glib, libintlOrEmpty, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   name = "atk-2.8.0";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig perl ];
 
-  propagatedBuildInputs = [ glib ];
+  propagatedBuildInputs = [ glib gobjectIntrospection /*ToDo: why propagate*/ ];
 
   postInstall = "rm -rf $out/share/gtk-doc";
 
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index fabc009e3ef3..6ad30f66e03c 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz
-, jasper, libintlOrEmpty }:
+, jasper, libintlOrEmpty, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   name = "gdk-pixbuf-2.28.2";
@@ -12,11 +12,13 @@ stdenv.mkDerivation rec {
   # !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
   buildInputs = [ libX11 libintlOrEmpty ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig gobjectIntrospection ];
 
   propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
 
-  configureFlags = "--with-libjasper --with-x11";
+  configureFlags = "--with-libjasper --with-x11"
+    + stdenv.lib.optionalString (gobjectIntrospection != null) " --enable-introspection=yes"
+    ;
 
   postInstall = "rm -rf $out/share/gtk-doc";
 
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix
index 99a80640bb8d..6a2caa281366 100644
--- a/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/pkgs/development/libraries/gobject-introspection/default.nix
@@ -1,10 +1,18 @@
-{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python, gdk_pixbuf
+{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python
 , libintlOrEmpty, autoconf, automake, otool }:
+# now that gobjectIntrospection creates large .gir files (eg gtk3 case)
+# it may be worth thinking about using multiple derivation outputs
+# In that case its about 6MB which could be separated
 
 stdenv.mkDerivation rec {
-  name = "gobject-introspection-1.34.2";
+  name = "gobject-introspection-1.36.0";
 
-  buildInputs = [ flex bison glib pkgconfig python gdk_pixbuf ]
+  src = fetchurl {
+    url = "mirror://gnome/sources/gobject-introspection/1.36/${name}.tar.xz";
+    sha256 = "10v3idh489vra7pjn1g8f844nnl6719zgkgq3dv38xcf8afnvrz3";
+  };
+
+  buildInputs = [ flex bison glib pkgconfig python ]
     ++ libintlOrEmpty
     ++ stdenv.lib.optional stdenv.isDarwin otool;
   propagatedBuildInputs = [ libffi ];
@@ -13,13 +21,10 @@ stdenv.mkDerivation rec {
   # other dependencies).
   configureFlags = [ "--disable-tests" ];
 
-  src = fetchurl {
-    url = "mirror://gnome/sources/gobject-introspection/1.34/${name}.tar.xz";
-    sha256 = "0a9lq0y67sr3g37l1hy0biqn046jr9wnd05hvwi8j8g2bjilhydw";
-  };
-
   postInstall = "rm -rf $out/share/gtk-doc";
 
+  setupHook = ./setup-hook.sh;
+
   meta = with stdenv.lib; {
     description = "A middleware layer between C libraries and language bindings";
     homepage    = http://live.gnome.org/GObjectIntrospection;
diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
new file mode 100644
index 000000000000..d411ad69dc43
--- /dev/null
+++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
@@ -0,0 +1,14 @@
+make_gobject_introspection_find_gir_files() {
+
+    # required for .typelib files, eg mypaint git version
+    if [ -d "$1/lib/girepository-1.0" ]; then
+      addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0
+    fi
+
+    # XDG_DATA_DIRS: required for .gir files?
+    if [ -d "$1/share" ]; then
+      addToSearchPath XDG_DATA_DIRS $1/share
+    fi
+}
+
+envHooks+=(make_gobject_introspection_find_gir_files)
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index f89b521758ca..31bdba716b90 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, gettext
-, expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, xlibs, x11
+, expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, xlibs, x11, gobjectIntrospection
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? stdenv.isLinux, cups ? null
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection ];
   propagatedBuildInputs = with xlibs; with stdenv.lib;
     [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk ]
     ++ optionals stdenv.isLinux [ libXrandr libXrender libXcomposite libXi libXcursor ]
diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix
index b1faa6c30f62..99bf8f10fd82 100644
--- a/pkgs/development/libraries/pango/default.nix
+++ b/pkgs/development/libraries/pango/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng, harfbuzz, fontconfig
-, libintlOrEmpty }:
+, libintlOrEmpty, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   name = "pango-1.32.5"; #.6 and higher need a not-yet-stable fontconfig (!)
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "08aqis6j8nd1lb4f2h4h9d9kjvp54iwf8zvqzss0qn4v7nfcjyvx";
   };
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];
+  buildInputs = [ gobjectIntrospection ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];
+
 
   nativeBuildInputs = [ pkgconfig ];
 
diff --git a/pkgs/development/libraries/wxGTK-2.8/default.nix b/pkgs/development/libraries/wxGTK-2.8/default.nix
index e11de87415d0..62d2de0238f1 100644
--- a/pkgs/development/libraries/wxGTK-2.8/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.8/default.nix
@@ -28,6 +28,7 @@ stdenv.mkDerivation rec {
     "--disable-precomp-headers"
     (if unicode then "--enable-unicode" else "")
     "--enable-mediactrl"
+    "--enable-graphics_ctx"
   ] ++ optional withMesa "--with-opengl";
 
   # These variables are used by configure to find some dependencies.