diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix index 16691e8588cf..41dab3ad2df2 100644 --- a/pkgs/development/libraries/gtk+/2.x.nix +++ b/pkgs/development/libraries/gtk+/2.x.nix @@ -15,13 +15,16 @@ stdenv.mkDerivation rec { sha256 = "1x14rnjvqslpa1q19fp1qalz5sxds72amsgjk8m7769rwk511jr0"; }; - outputs = [ "dev" "out" "bin" "doc" ]; + outputs = [ "dev" "out" "doc" ]; + outputBin = "dev"; enableParallelBuilding = true; NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (libintlOrEmpty != []) "-lintl"; - nativeBuildInputs = [ perl pkgconfig gettext ]; + setupHook = ./setup-hook.sh; + + nativeBuildInputs = [ setupHook perl pkgconfig gettext ]; propagatedBuildInputs = with xlibs; with stdenv.lib; [ glib cairo pango gdk_pixbuf atk ] @@ -37,6 +40,10 @@ stdenv.mkDerivation rec { then "--disable-glibtest --disable-introspection --disable-visibility" else "--with-xinput=yes"; + postInstall = '' + _moveToOutput share/gtk-2.0/demo "$doc" + ''; + passthru = { gtkExeEnvPostBuild = '' rm $out/lib/gtk-2.0/2.10.0/immodules.cache diff --git a/pkgs/development/libraries/gtk+/setup-hook.sh b/pkgs/development/libraries/gtk+/setup-hook.sh new file mode 100644 index 000000000000..c2b0ab502db7 --- /dev/null +++ b/pkgs/development/libraries/gtk+/setup-hook.sh @@ -0,0 +1,10 @@ +fixupOutputHooks+=(_gtk2CleanComments) + +# Clean comments that link to generator of the file +_gtk2CleanComments() { + local f="$prefix/lib/gtk-2.0/2.10.0/immodules.cache" + if [ -f "$f" ]; then + sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f" + fi +} +