summary refs log tree commit diff
path: root/pkgs/development/libraries/glib
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-02-18 20:03:03 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-02-18 20:27:23 +0100
commitdcf6cbf5b383eb66bafbdbaaf972eb1c7264c35c (patch)
tree54e475a7102fea497bc46c81ab95f6b16cc74b84 /pkgs/development/libraries/glib
parent96f07fa74e2b812b988749b1ff9882b15aad3b73 (diff)
glib: add -tested variant, also to the unstable job
Replaces #1753.
Diffstat (limited to 'pkgs/development/libraries/glib')
-rw-r--r--pkgs/development/libraries/glib/default.nix38
1 files changed, 23 insertions, 15 deletions
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index de0a02c56e25c..6fa77b233c677 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -1,5 +1,9 @@
-{ stdenv, fetchurl, pkgconfig, gettext, perl, python, autoconf, automake, libtool
-, libiconvOrEmpty, libintlOrEmpty, zlib, libffi, pcre, libelf, dbus }:
+{ stdenv, fetchurl, pkgconfig, gettext, perl, python
+, libiconvOrEmpty, libintlOrEmpty, zlib, libffi, pcre, libelf
+
+# this is just for tests (not in closure of any regular package)
+, libxml2, tzdata, desktop_file_utils, shared_mime_info, doCheck ? false
+}:
 
 # TODO:
 # * Add gio-module-fam
@@ -17,7 +21,6 @@
       https://wiki.gnome.org/GnomeGoals/InstalledTests
   * Support org.freedesktop.Application, including D-Bus activation from desktop files
 */
-
 let
   # Some packages don't get "Cflags" from pkgconfig correctly
   # and then fail to build when directly including like <glib/...>.
@@ -35,7 +38,7 @@ let
   ver_maj = "2.38";
   ver_min = "2";
 in
-with { inherit (stdenv.lib) optional optionalString; };
+with { inherit (stdenv.lib) optional optionals optionalString; };
 
 stdenv.mkDerivation rec {
   name = "glib-${ver_maj}.${ver_min}";
@@ -45,28 +48,33 @@ stdenv.mkDerivation rec {
     sha256 = "0d2px8m77603s5pm3md4bcm5d0ksbcsb6ik1w52hjslnq1a9hsh5";
   };
 
-  # configure script looks for d-bus but it is (probably) only needed for tests
-  buildInputs = [ libelf ];
+  buildInputs = [ libelf ]
+    ++ optionals doCheck [ tzdata libxml2 desktop_file_utils shared_mime_info ];
 
-  # I don't know why the autotools are needed now, even without modifying configure scripts
-  nativeBuildInputs = [ pkgconfig gettext perl python ] ++ [ autoconf automake libtool ];
+  nativeBuildInputs = [ pkgconfig gettext perl python ];
 
   propagatedBuildInputs = [ pcre zlib libffi ] ++ libiconvOrEmpty ++ libintlOrEmpty;
 
-  preConfigure = "autoreconf -fi";
-
   configureFlags =
     optional stdenv.isDarwin "--disable-compile-warnings"
     ++ optional stdenv.isSunOS "--disable-modular-tests";
 
-  CPPFLAGS = optionalString stdenv.isSunOS "-DBSD_COMP";
-
-  NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-lintl";
+  NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl"
+    + optionalString stdenv.isSunOS " -DBSD_COMP";
 
   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";
+  inherit doCheck;
+  preCheck = optionalString doCheck
+    # libgcc_s.so.1 must be installed for pthread_cancel to work
+    # also point to the glib/.libs path
+    '' export LD_LIBRARY_PATH="$(dirname $(echo ${stdenv.gcc.gcc}/lib*/libgcc_s.so)):$NIX_BUILD_TOP/${name}/glib/.libs:$LD_LIBRARY_PATH"
+       export TZDIR="${tzdata}/share/zoneinfo"
+       export XDG_CACHE_HOME="$TMP"
+       export XDG_RUNTIME_HOME="$TMP"
+       export HOME="$TMP"
+       export XDG_DATA_DIRS="${desktop_file_utils}/share:${shared_mime_info}/share"
+    '';
 
   postInstall = ''rm -rvf $out/share/gtk-doc'';