about summary refs log tree commit diff
path: root/pkgs/development/libraries/glib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/glib/default.nix')
-rw-r--r--pkgs/development/libraries/glib/default.nix39
1 files changed, 22 insertions, 17 deletions
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index b5e2b1e43b21..119584deb1eb 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, pkgconfig, gettext, perl, libiconvOrEmpty, zlib, libffi
-, python, pcre, libelf, libintlOrEmpty }:
+{ stdenv, fetchurl, pkgconfig, gettext, perl, python, autoconf, automake, libtool
+, libiconvOrEmpty, libintlOrEmpty, zlib, libffi, pcre, libelf, dbus }:
 
 # TODO:
 # * Add gio-module-fam
@@ -12,41 +12,47 @@
 #       $out/bin/gtester-report' to postInstall if this is solved
 
 let
-  # some packages don't get "Cflags" from pkgconfig correctly
-  # and then fail to build when directly including like <glib/...>
+  # Some packages don't get "Cflags" from pkgconfig correctly
+  # and then fail to build when directly including like <glib/...>.
+  # This is intended to be run in postInstall of any package
+  # which has $out/include/ containing just some disjunct directories.
   flattenInclude = ''
-    for dir in $out/include/*; do
-      cp -r $dir/* "$out/include/"
+    for dir in "$out"/include/*; do
+      cp -r "$dir"/* "$out/include/"
       rm -r "$dir"
       ln -s . "$dir"
     done
-    ln -sr -t "$out/include/" $out/lib/*/include/* 2>/dev/null || true
+    ln -sr -t "$out/include/" "$out"/lib/*/include/* 2>/dev/null || true
   '';
 in
+with { inherit (stdenv.lib) optionalString; };
 
 stdenv.mkDerivation rec {
-  name = "glib-2.36.1";
+  name = "glib-2.36.4";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/2.36/${name}.tar.xz";
-    sha256 = "090bw5par3dfy5m6dhq393pmy92zpw3d7rgbzqjc14jfg637bqvx";
+    sha256 = "0zmdbkg2yjyxdl72w34lxvrssbzqzdficskkfn22s0994dad4m7n";
   };
 
-  # configure script looks for d-bus but it is only needed for tests
-  buildInputs = [ libelf ] ++ libintlOrEmpty;
+  # configure script looks for d-bus but it is (probably) only needed for tests
+  buildInputs = [ libelf ];
 
-  nativeBuildInputs = [ perl pkgconfig gettext python ];
+  # I don't know why the autotools are needed now, even without modifying configure scripts
+  nativeBuildInputs = [ pkgconfig gettext perl python ] ++ [ autoconf automake libtool ];
 
-  propagatedBuildInputs = [ pcre zlib libffi ] ++ libiconvOrEmpty;
+  propagatedBuildInputs = [ pcre zlib libffi ] ++ libiconvOrEmpty ++ libintlOrEmpty;
 
+  preConfigure = "autoreconf -fi";
   configureFlags = "--with-pcre=system --disable-fam";
 
-  postConfigure = "sed '/SANE_MALLOC_PROTOS/s,^,//,' -i config.h";
-
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
+  NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-lintl";
 
   enableParallelBuilding = true;
 
+  doCheck = false; # ToDo: fix the remaining problems, so we have checked glib by default
+  LD_LIBRARY_PATH = optionalString doCheck "${stdenv.gcc.gcc}/lib";
+
   postInstall = ''rm -rvf $out/share/gtk-doc'';
 
   passthru = {
@@ -69,4 +75,3 @@ stdenv.mkDerivation rec {
     '';
   };
 }
-