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.
This commit is contained in:
Vladimír Čunát 2013-08-04 20:59:05 +02:00
parent daf9c75ef4
commit 7fbcc56260
9 changed files with 46 additions and 19 deletions

View File

@ -3,7 +3,8 @@
rec { rec {
inherit (pkgs) fetchurl_gnome glib gtk3 atk pango; inherit (pkgs) fetchurl_gnome glib gtk3 atk pango;
gtk = gtk3; gtk = gtk3;
orbit = pkgs.gnome2.ORBit2; inherit (pkgs.gnome2) gnome_common ORBit2;
orbit = ORBit2;
inherit (lib) lowPrio hiPrio appendToName makeOverridable; inherit (lib) lowPrio hiPrio appendToName makeOverridable;

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, python, libxml2Python, libxslt, which, libX11, gnome3 { stdenv, fetchurl, pkgconfig, python, libxml2Python, libxslt, which, libX11, gnome3
, intltool, gnome_doc_utils}: , intltool, gnome_doc_utils }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -7,6 +7,8 @@ stdenv.mkDerivation rec {
minorVersion = "3"; minorVersion = "3";
name = "gnome-desktop-${majorVersion}.${minorVersion}"; name = "gnome-desktop-${majorVersion}.${minorVersion}";
enableParallelBuilding = true;
src = fetchurl { src = fetchurl {
url = "mirror://gnome/sources/gnome-desktop/${majorVersion}/${name}.tar.xz"; url = "mirror://gnome/sources/gnome-desktop/${majorVersion}/${name}.tar.xz";
sha256 = "1nrqcp1p5cxhfjjy5hjpvkqmzsgl2353a08fg0b11c932v95bsba"; sha256 = "1nrqcp1p5cxhfjjy5hjpvkqmzsgl2353a08fg0b11c932v95bsba";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, perl, glib, libintlOrEmpty }: { stdenv, fetchurl, pkgconfig, perl, glib, libintlOrEmpty, gobjectIntrospection }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "atk-2.8.0"; name = "atk-2.8.0";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig perl ]; nativeBuildInputs = [ pkgconfig perl ];
propagatedBuildInputs = [ glib ]; propagatedBuildInputs = [ glib gobjectIntrospection /*ToDo: why propagate*/ ];
postInstall = "rm -rf $out/share/gtk-doc"; postInstall = "rm -rf $out/share/gtk-doc";

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz { stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz
, jasper, libintlOrEmpty }: , jasper, libintlOrEmpty, gobjectIntrospection }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gdk-pixbuf-2.28.2"; name = "gdk-pixbuf-2.28.2";
@ -12,11 +12,13 @@ stdenv.mkDerivation rec {
# !!! We might want to factor out the gdk-pixbuf-xlib subpackage. # !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
buildInputs = [ libX11 libintlOrEmpty ]; buildInputs = [ libX11 libintlOrEmpty ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig gobjectIntrospection ];
propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ]; 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"; postInstall = "rm -rf $out/share/gtk-doc";

View File

@ -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 }: , 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 { 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 ++ libintlOrEmpty
++ stdenv.lib.optional stdenv.isDarwin otool; ++ stdenv.lib.optional stdenv.isDarwin otool;
propagatedBuildInputs = [ libffi ]; propagatedBuildInputs = [ libffi ];
@ -13,13 +21,10 @@ stdenv.mkDerivation rec {
# other dependencies). # other dependencies).
configureFlags = [ "--disable-tests" ]; 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"; postInstall = "rm -rf $out/share/gtk-doc";
setupHook = ./setup-hook.sh;
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A middleware layer between C libraries and language bindings"; description = "A middleware layer between C libraries and language bindings";
homepage = http://live.gnome.org/GObjectIntrospection; homepage = http://live.gnome.org/GObjectIntrospection;

View File

@ -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)

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, gettext { 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 , xineramaSupport ? stdenv.isLinux
, cupsSupport ? stdenv.isLinux, cups ? null , cupsSupport ? stdenv.isLinux, cups ? null
}: }:
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
nativeBuildInputs = [ pkgconfig gettext ]; nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection ];
propagatedBuildInputs = with xlibs; with stdenv.lib; propagatedBuildInputs = with xlibs; with stdenv.lib;
[ expat glib cairo pango gdk_pixbuf atk at_spi2_atk ] [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk ]
++ optionals stdenv.isLinux [ libXrandr libXrender libXcomposite libXi libXcursor ] ++ optionals stdenv.isLinux [ libXrandr libXrender libXcomposite libXi libXcursor ]

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng, harfbuzz, fontconfig { stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng, harfbuzz, fontconfig
, libintlOrEmpty }: , libintlOrEmpty, gobjectIntrospection }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "pango-1.32.5"; #.6 and higher need a not-yet-stable fontconfig (!) name = "pango-1.32.5"; #.6 and higher need a not-yet-stable fontconfig (!)
@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "08aqis6j8nd1lb4f2h4h9d9kjvp54iwf8zvqzss0qn4v7nfcjyvx"; sha256 = "08aqis6j8nd1lb4f2h4h9d9kjvp54iwf8zvqzss0qn4v7nfcjyvx";
}; };
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ]; buildInputs = [ gobjectIntrospection ]
++ stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];

View File

@ -28,6 +28,7 @@ stdenv.mkDerivation rec {
"--disable-precomp-headers" "--disable-precomp-headers"
(if unicode then "--enable-unicode" else "") (if unicode then "--enable-unicode" else "")
"--enable-mediactrl" "--enable-mediactrl"
"--enable-graphics_ctx"
] ++ optional withMesa "--with-opengl"; ] ++ optional withMesa "--with-opengl";
# These variables are used by configure to find some dependencies. # These variables are used by configure to find some dependencies.