@@ -42,8 +42,8 @@ let
4242 ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
4343 '';
4444
45− ver_maj = "2.52";
46− ver_min = "3";
45+ ver_maj = "2.54";
46+ ver_min = "0";
4747in
4848
4949stdenv.mkDerivation rec {
@@ -51,10 +51,11 @@ stdenv.mkDerivation rec {
5151
5252 src = fetchurl {
5353 url = "mirror://gnome/sources/glib/${ver_maj}/${name}.tar.xz";
54− sha256 = "0a71wkkhkvad84gm30w13micxxgqqw3sxhybj7nd9z60lwspdvi5";
54+ sha256 = "fe22998ff0394ec31e6e5511c379b74011bee61a4421bca7fcab223dfbe0fc6a";
5555 };
5656
57− patches = optional stdenv.isDarwin ./darwin-compilation.patch ++ optional doCheck ./skip-timer-test.patch;
57+ patches = optional stdenv.isDarwin ./darwin-compilation.patch
58+ ++ optional doCheck ./skip-timer-test.patch;
5859
5960 outputs = [ "out" "dev" "devdoc" ];
6061 outputBin = "dev";
@@ -76,21 +77,23 @@ stdenv.mkDerivation rec {
7677 ++ optional (stdenv.isFreeBSD || stdenv.isSunOS) "--with-libiconv=gnu"
7778 ++ optional stdenv.isSunOS "--disable-dtrace";
7879
79− NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl"
80− + optionalString stdenv.isSunOS " -DBSD_COMP";
80+ NIX_CFLAGS_COMPILE = optional stdenv.isDarwin "-lintl"
81+ ++ optional stdenv.isSunOS "-DBSD_COMP";
8182
82− preConfigure = if !stdenv.isSunOS then null else
83− ''
84− sed -i -e 's|inotify.h|foobar-inotify.h|g' configure
85− '';
83+ preConfigure = optionalString stdenv.isSunOS ''
84+ sed -i -e 's|inotify.h|foobar-inotify.h|g' configure
85+ '';
86+
87+ postConfigure = ''
88+ patchShebangs ./gobject/
89+ '';
8690
8791 LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}";
8892 LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf";
8993
90− preBuild = optionalString stdenv.isDarwin
91− ''
92− export MACOSX_DEPLOYMENT_TARGET=
93− '';
94+ preBuild = optionalString stdenv.isDarwin ''
95+ export MACOSX_DEPLOYMENT_TARGET=
96+ '';
9497
9598 enableParallelBuilding = true;
9699 DETERMINISTIC_BUILD = 1;
@@ -100,33 +103,36 @@ stdenv.mkDerivation rec {
100103 substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev"
101104 sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"
102105 ''
103− # This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
104− + ''
105− sed '1i#line 1 "${name}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
106− -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
107− '';
106+ # This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
107+ + ''
108+ sed '1i#line 1 "${name}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
109+ -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
110+ '';
108111
109112 inherit doCheck;
110− preCheck = optionalString doCheck
111− '' export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${name}/glib/.libs:$LD_LIBRARY_PATH"
112− export TZDIR="${tzdata}/share/zoneinfo"
113− export XDG_CACHE_HOME="$TMP"
114− export XDG_RUNTIME_HOME="$TMP"
115− export HOME="$TMP"
116− export XDG_DATA_DIRS="${desktop_file_utils}/share:${shared_mime_info}/share"
117− export G_TEST_DBUS_DAEMON="${dbus_daemon.out}/bin/dbus-daemon"
118−
119− substituteInPlace gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop --replace "Exec=/bin/true" "Exec=${coreutils}/bin/true"
120− # Needs machine-id, comment the test
121− sed -e '/\/gdbus\/codegen-peer-to-peer/ s/^\/*/\/\//' -i gio/tests/gdbus-peer.c
122− sed -e '/g_test_add_func/ s/^\/*/\/\//' -i gio/tests/gdbus-unix-addresses.c
123− # All gschemas fail to pass the test, upstream bug?
124− sed -e '/g_test_add_data_func/ s/^\/*/\/\//' -i gio/tests/gschema-compile.c
125− # Cannot reproduce the failing test_associations on hydra
126− sed -e '/\/appinfo\/associations/d' -i gio/tests/appinfo.c
127− # Needed because of libtool wrappers
128− sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c
129− '';
113+ preCheck = optionalString doCheck ''
114+ export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${name}/glib/.libs:$LD_LIBRARY_PATH"
115+ export TZDIR="${tzdata}/share/zoneinfo"
116+ export XDG_CACHE_HOME="$TMP"
117+ export XDG_RUNTIME_HOME="$TMP"
118+ export HOME="$TMP"
119+ export XDG_DATA_DIRS="${desktop_file_utils}/share:${shared_mime_info}/share"
120+ export G_TEST_DBUS_DAEMON="${dbus_daemon.out}/bin/dbus-daemon"
121+ export PATH="$PATH:$(pwd)/gobject"
122+ echo "PATH=$PATH"
123+
124+ substituteInPlace gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop \
125+ --replace "Exec=/bin/true" "Exec=${coreutils}/bin/true"
126+ # Needs machine-id, comment the test
127+ sed -e '/\/gdbus\/codegen-peer-to-peer/ s/^\/*/\/\//' -i gio/tests/gdbus-peer.c
128+ sed -e '/g_test_add_func/ s/^\/*/\/\//' -i gio/tests/gdbus-unix-addresses.c
129+ # All gschemas fail to pass the test, upstream bug?
130+ sed -e '/g_test_add_data_func/ s/^\/*/\/\//' -i gio/tests/gschema-compile.c
131+ # Cannot reproduce the failing test_associations on hydra
132+ sed -e '/\/appinfo\/associations/d' -i gio/tests/appinfo.c
133+ # Needed because of libtool wrappers
134+ sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c
135+ '';
130136
131137 passthru = {
132138 gioModuleDir = "lib/gio/modules";
@@ -136,7 +142,7 @@ stdenv.mkDerivation rec {
136142 meta = with stdenv.lib; {
137143 description = "C library of programming buildings blocks";
138144 homepage = https://www.gtk.org/;
139− license = licenses.lgpl2Plus;
145+ license = licenses.lgpl21Plus;
140146 maintainers = with maintainers; [ lovek323 raskin ];
141147 platforms = platforms.unix;
142148