summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-01-16 23:01:24 +0100
committerLudovic Courtès <ludo@gnu.org>2013-01-19 22:20:47 +0100
commit943f33a3263af38c69a2eb60440fe10602104607 (patch)
tree7786acdae26e1d815771f1a4ecce0639c412cda4 /gnu
parent3889a82ef889004bb0835c54e8dc8b23a4a6758f (diff)
downloadguix-943f33a3263af38c69a2eb60440fe10602104607.tar.gz
distro: glib: Run the test suite; add DBus.
* distro/packages/glib.scm: Rename to...
* gnu/packages/glib.scm: ... this.  Update module declaration
  accordingly.
  (dbus): New variable.
  (glib): Change version number to 2.34.3, and adjust URL accordingly.
  Add a "doc" output.  Add #:configure-flags, #:patches, and #:phases
  arguments. Add DBUS as an input, as well a three patches.
* Makefile.am (MODULES): Adjust to file renaming.
  (dist_patch_DATA): Add `glib-tests-timezone.patch',
  `glib-tests-homedir.patch', and `glib-tests-desktop.patch'.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/glib.scm99
-rw-r--r--gnu/packages/patches/glib-tests-desktop.patch87
-rw-r--r--gnu/packages/patches/glib-tests-homedir.patch59
-rw-r--r--gnu/packages/patches/glib-tests-timezone.patch41
4 files changed, 270 insertions, 16 deletions
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index bbf64f2800..1286700911 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
+;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -16,44 +17,110 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
-(define-module (distro packages glib)
-  #:use-module ((guix licenses) #:select (lgpl2.0+))
+(define-module (gnu packages glib)
+  #:use-module ((guix licenses) #:select (lgpl2.0+ gpl2+))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
-  #:use-module (distro packages base)
-  #:use-module (distro packages compression)
-  #:use-module ((distro packages gettext)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages compression)
+  #:use-module ((gnu packages gettext)
                 #:renamer (symbol-prefix-proc 'guix:))
-  #:use-module (distro packages libffi)
-  #:use-module (distro packages pkg-config)
-  #:use-module (distro packages python))
+  #:use-module (gnu packages libffi)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages perl)
+  #:use-module ((gnu packages xml)
+                #:renamer (symbol-prefix-proc 'xml:)))
+
+(define-public dbus
+  (package
+    (name "dbus")
+    (version "1.6.4")
+    (source (origin
+             (method url-fetch)
+             (uri
+              (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
+                             version ".tar.gz"))
+             (sha256
+              (base32
+               "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("expat" ,xml:expat)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://dbus.freedesktop.org/")
+    (synopsis "Message bus for inter-process communication (IPC)")
+    (description
+     "D-Bus is a message bus system, a simple way for applications to
+talk to one another. In addition to interprocess communication, D-Bus
+helps coordinate process lifecycle; it makes it simple and reliable to
+code a \"single instance\" application or daemon, and to launch
+applications and daemons on demand when their services are needed.
+
+D-Bus supplies both a system daemon (for events such as \"new hardware
+device added\" or \"printer queue changed\") and a
+per-user-login-session daemon (for general IPC needs among user
+applications). Also, the message bus is built on top of a general
+one-to-one message passing framework, which can be used by any two apps
+to communicate directly (without going through the message bus
+daemon). Currently the communicating applications are on one computer,
+or through unencrypted TCP/IP suitable for use behind a firewall with
+shared NFS home directories.")
+    (license gpl2+)))                     ; or Academic Free License 2.1
 
 (define-public glib
   (package
    (name "glib")
-   (version "2.34")
+   (version "2.34.3")
    (source (origin
             (method url-fetch)
             (uri (string-append "http://ftp.gnome.org/pub/gnome/sources/"
-                                name "/" version "/"
-                                name "-" version ".3" ".tar.xz"))
+                                name "/2.34/"
+                                name "-" version ".tar.xz"))
             (sha256
              (base32 "19sq4rhl2vr8ikjvl8qh51vr38yqfhbkb3imi2s6ac5rgkwcnpw5"))))
    (build-system gnu-build-system)
+   (outputs '("out"                        ; everything
+              "doc"))                      ; 20 MiB of GTK-Doc reference
    (inputs
     `(("coreutils" ,coreutils)
       ("gettext" ,guix:gettext)
       ("libffi" ,libffi)
       ("pkg-config" ,pkg-config)
       ("python" ,python)
-      ("zlib" ,zlib)))
-   (arguments `(#:tests? #f)) ; XXX: tests fail
-   (synopsis
-    "GLib, a library that provides the core application building blocks")
+      ("zlib" ,zlib)
+      ("perl" ,perl)                              ; needed by GIO tests
+      ("dbus" ,dbus)                              ; for GDBus tests
+
+      ("patch/tests-tzdata"
+       ,(search-patch "glib-tests-timezone.patch"))
+      ("patch/tests-homedir"
+       ,(search-patch "glib-tests-homedir.patch"))
+      ("patch/tests-desktop"
+       ,(search-patch "glib-tests-desktop.patch"))))
+   (arguments
+    '(#:patches (list (assoc-ref %build-inputs "patch/tests-tzdata")
+                      (assoc-ref %build-inputs "patch/tests-homedir")
+                      (assoc-ref %build-inputs "patch/tests-desktop"))
+      #:phases (alist-cons-before
+                'build 'pre-build
+                (lambda* (#:key inputs outputs #:allow-other-keys)
+                  (substitute* '("glib/gspawn.c"
+                                 "glib/tests/utils.c"
+                                 "tests/spawn-test.c")
+                    (("/bin/sh") (which "sh"))))
+                %standard-phases)
+
+      ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
+      #:configure-flags (list (string-append "--with-html-dir="
+                                             (assoc-ref %outputs "doc")
+                                             "/share/gtk-doc"))))
+   (synopsis "C library that provides core application building blocks")
    (description
     "GLib provides data structure handling for C, portability wrappers,
 and interfaces for such runtime functionality as an event loop, threads,
 dynamic loading, and an object system.")
    (home-page "http://developer.gnome.org/glib/")
-   (license lgpl2.0+))) ; some files are under lgpl2.1+
\ No newline at end of file
+   (license lgpl2.0+)))                        ; some files are under lgpl2.1+
diff --git a/gnu/packages/patches/glib-tests-desktop.patch b/gnu/packages/patches/glib-tests-desktop.patch
new file mode 100644
index 0000000000..85f2b06c9a
--- /dev/null
+++ b/gnu/packages/patches/glib-tests-desktop.patch
@@ -0,0 +1,87 @@
+Some GLib tests expect desktop things, such as an xterm, a MIME
+database, the `update-desktop-database' program, which we don't provide.
+
+--- glib-2.34.3/gio/tests/appinfo.c	2013-01-16 18:20:00.000000000 +0100
++++ glib-2.34.3/gio/tests/appinfo.c	2013-01-16 18:20:06.000000000 +0100
+@@ -384,14 +384,09 @@ main (int argc, char *argv[])
+ 
+   g_test_add_func ("/appinfo/basic", test_basic);
+   g_test_add_func ("/appinfo/text", test_text);
+-  g_test_add_func ("/appinfo/launch", test_launch);
+   g_test_add_func ("/appinfo/show-in", test_show_in);
+   g_test_add_func ("/appinfo/commandline", test_commandline);
+-  g_test_add_func ("/appinfo/launch-context", test_launch_context);
+   g_test_add_func ("/appinfo/tryexec", test_tryexec);
+-  g_test_add_func ("/appinfo/associations", test_associations);
+   g_test_add_func ("/appinfo/environment", test_environment);
+-  g_test_add_func ("/appinfo/startup-wm-class", test_startup_wm_class);
+-  g_test_add_func ("/appinfo/supported-types", test_supported_types);
+   g_test_add_func ("/appinfo/from-keyfile", test_from_keyfile);
+
+--- glib-2.34.3/gio/tests/contenttype.c	2013-01-16 21:22:29.000000000 +0100
++++ glib-2.34.3/gio/tests/contenttype.c	2013-01-16 21:22:33.000000000 +0100
+@@ -207,13 +207,6 @@ main (int argc, char *argv[])
+ 
+   g_test_init (&argc, &argv, NULL);
+ 
+-  g_test_add_func ("/contenttype/guess", test_guess);
+-  g_test_add_func ("/contenttype/unknown", test_unknown);
+-  g_test_add_func ("/contenttype/subtype", test_subtype);
+-  g_test_add_func ("/contenttype/list", test_list);
+-  g_test_add_func ("/contenttype/executable", test_executable);
+-  g_test_add_func ("/contenttype/description", test_description);
+-  g_test_add_func ("/contenttype/icon", test_icon);
+ 
+   return g_test_run ();
+ }
+
+--- glib-2.34.3/gio/tests/desktop-app-info.c	2013-01-16 21:30:00.000000000 +0100
++++ glib-2.34.3/gio/tests/desktop-app-info.c	2013-01-16 21:30:02.000000000 +0100
+@@ -363,9 +363,5 @@ main (int   argc,
+   g_setenv ("XDG_DATA_HOME", basedir, TRUE);
+   cleanup_subdirs (basedir);
+   
+-  g_test_add_func ("/desktop-app-info/delete", test_delete);
+-  g_test_add_func ("/desktop-app-info/default", test_default);
+-  g_test_add_func ("/desktop-app-info/fallback", test_fallback);
+-  g_test_add_func ("/desktop-app-info/lastused", test_last_used);
+ 
+   result = g_test_run ();
+
+
+-----------------------------
+The hunk below removes tests that depend on `gdbus-testserver.py',
+because that script depends on python-gobject.
+
+--- glib-2.34.3/gio/tests/Makefile.in	2012-11-26 20:08:54.000000000 +0100
++++ glib-2.34.3/gio/tests/Makefile.in	2013-01-17 23:09:44.000000000 +0100
+@@ -60,15 +60,8 @@ DIST_COMMON = $(srcdir)/Makefile.am $(sr
+ noinst_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_8)
+ @HAVE_DBUS_DAEMON_TRUE@am__append_1 = \
+ @HAVE_DBUS_DAEMON_TRUE@	actions 		\
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-connection	\
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-connection-loss	\
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-connection-slow	\
+ @HAVE_DBUS_DAEMON_TRUE@	gdbus-names		\
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-proxy		\
+ @HAVE_DBUS_DAEMON_TRUE@	gdbus-proxy-threads	\
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-proxy-well-known-name \
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-introspection	\
+-@HAVE_DBUS_DAEMON_TRUE@	gdbus-threading		\
+ @HAVE_DBUS_DAEMON_TRUE@	gdbus-export		\
+ @HAVE_DBUS_DAEMON_TRUE@	gdbus-error		\
+ @HAVE_DBUS_DAEMON_TRUE@	gdbus-bz627724		\
+
+
+The test below depends on the availability /etc/passwd to dbus-daemon.
+
+--- glib-2.34.3/gio/tests/gdbus-auth.c	2013-01-19 14:32:14.000000000 +0100
++++ glib-2.34.3/gio/tests/gdbus-auth.c	2013-01-19 14:32:20.000000000 +0100
+@@ -264,6 +264,7 @@ main (int   argc,
+ {
+   gint ret;
+ 
++  exit (0);
+   setlocale (LC_ALL, "C");
+ 
+   g_type_init ();
diff --git a/gnu/packages/patches/glib-tests-homedir.patch b/gnu/packages/patches/glib-tests-homedir.patch
new file mode 100644
index 0000000000..9232ca5e77
--- /dev/null
+++ b/gnu/packages/patches/glib-tests-homedir.patch
@@ -0,0 +1,59 @@
+`g_get_home_dir' looks at /etc/passwd first, which fails in chroot builds.
+The gdbus tests use it to lookup .dbus-keyrings, so they cannot run in our
+chroot build environment.  Thus, disable them.
+
+--- glib-2.34.3/gio/tests/gdbus-connection-flush.c	2013-01-16 17:29:46.000000000 +0100
++++ glib-2.34.3/gio/tests/gdbus-connection-flush.c	2013-01-16 17:29:47.000000000 +0100
+@@ -373,10 +373,6 @@ main (int   argc,
+   g_type_init ();
+   g_test_init (&argc, &argv, NULL);
+ 
+-  g_test_add ("/gdbus/connection/flush/busy", Fixture, NULL,
+-              setup, test_flush_busy, teardown);
+-  g_test_add ("/gdbus/connection/flush/idle", Fixture, NULL,
+-              setup, test_flush_idle, teardown);
+ 
+   ret = g_test_run();
+
+--- glib-2.34.3/gio/tests/gdbus-peer.c	2013-01-16 17:38:09.000000000 +0100
++++ glib-2.34.3/gio/tests/gdbus-peer.c	2013-01-16 17:38:12.000000000 +0100
+@@ -1828,11 +1828,6 @@ main (int   argc,
+ 
+   g_test_add_func ("/gdbus/peer-to-peer", test_peer);
+   g_test_add_func ("/gdbus/delayed-message-processing", delayed_message_processing);
+-  g_test_add_func ("/gdbus/nonce-tcp", test_nonce_tcp);
+-  g_test_add_func ("/gdbus/tcp-anonymous", test_tcp_anonymous);
+-  g_test_add_func ("/gdbus/credentials", test_credentials);
+-  g_test_add_func ("/gdbus/overflow", test_overflow);
+-  g_test_add_func ("/gdbus/codegen-peer-to-peer", codegen_test_peer);
+ 
+   ret = g_test_run();
+ 
+--- glib-2.34.3/gio/tests/gdbus-exit-on-close.c	2013-01-16 17:49:25.000000000 +0100
++++ glib-2.34.3/gio/tests/gdbus-exit-on-close.c	2013-01-16 17:49:30.000000000 +0100
+@@ -206,13 +206,6 @@ main (int   argc,
+   g_type_init ();
+   g_test_init (&argc, &argv, NULL);
+ 
+-  for (i = 0; cases[i].name != NULL; i++)
+-    {
+-      gchar *name = g_strdup_printf ("/gdbus/exit-on-close/%s", cases[i].name);
+-
+-      g_test_add_data_func (name, &cases[i], test_exit_on_close);
+-      g_free (name);
+-    }
+ 
+   return g_test_run();
+ }
+
+--- glib-2.34.3/gio/tests/gdbus-non-socket.c	2013-01-16 18:13:25.000000000 +0100
++++ glib-2.34.3/gio/tests/gdbus-non-socket.c	2013-01-16 18:13:27.000000000 +0100
+@@ -294,7 +294,6 @@ main (int   argc,
+   g_type_init ();
+   g_test_init (&argc, &argv, NULL);
+ 
+-  g_test_add_func ("/gdbus/non-socket", test_non_socket);
+ 
+   ret = g_test_run();
+ 
+
diff --git a/gnu/packages/patches/glib-tests-timezone.patch b/gnu/packages/patches/glib-tests-timezone.patch
new file mode 100644
index 0000000000..4b335c7ffb
--- /dev/null
+++ b/gnu/packages/patches/glib-tests-timezone.patch
@@ -0,0 +1,41 @@
+Since glibc 2.17 doesn't install timezone data by default (see
+http://thread.gmane.org/gmane.comp.lib.glibc.alpha/17516), and since we
+don't have that around, shamelessly skip this test.
+
+--- glib-2.34.3/glib/tests/gdatetime.c	2013-01-16 15:47:57.000000000 +0100
++++ glib-2.34.3/glib/tests/gdatetime.c	2013-01-16 15:47:58.000000000 +0100
+@@ -186,14 +186,6 @@ test_GDateTime_equal (void)
+   g_assert (g_date_time_equal (dt1, dt2));
+   g_date_time_unref (dt1);
+ 
+-  /* America/Recife is in UTC-0300 */
+-  tz = g_time_zone_new ("America/Recife");
+-  dt1 = g_date_time_new (tz, 2010, 5, 24,  8, 0, 0);
+-  g_time_zone_unref (tz);
+-  g_assert_cmpint (g_date_time_get_utc_offset (dt1) / G_USEC_PER_SEC, ==, (-3 * 3600));
+-  g_assert (g_date_time_equal (dt1, dt2));
+-  g_date_time_unref (dt1);
+-  g_date_time_unref (dt2);
+ }
+ 
+ static void
+@@ -608,7 +608,6 @@ test_GDateTime_new_full (void)
+   g_assert_cmpint (8, ==, g_date_time_get_hour (dt));
+   g_assert_cmpint (4, ==, g_date_time_get_minute (dt));
+   g_assert_cmpint (0, ==, g_date_time_get_second (dt));
+-  g_assert_cmpstr ("BRT", ==, g_date_time_get_timezone_abbreviation (dt));
+   g_assert (!g_date_time_is_daylight_savings (dt));
+   g_date_time_unref (dt);
+ }
+@@ -1354,11 +1354,8 @@ main (gint   argc,
+   g_test_add_func ("/GDateTime/to_timeval", test_GDateTime_to_timeval);
+   g_test_add_func ("/GDateTime/to_utc", test_GDateTime_to_utc);
+   g_test_add_func ("/GDateTime/now_utc", test_GDateTime_now_utc);
+-  g_test_add_func ("/GDateTime/dst", test_GDateTime_dst);
+   g_test_add_func ("/GDateTime/test_z", test_z);
+   g_test_add_func ("/GDateTime/test-all-dates", test_all_dates);
+-  g_test_add_func ("/GTimeZone/find-interval", test_find_interval);
+-  g_test_add_func ("/GTimeZone/adjust-time", test_adjust_time);
+   g_test_add_func ("/GTimeZone/no-header", test_no_header);
+ 
+   return g_test_run ();