Fix build on systems which don't provide openat() such as NetBSD 6

https://bugzilla.gnome.org/show_bug.cgi?id=735974
This commit is contained in:
prlw1 2014-09-11 14:00:18 +00:00
parent 8f2d552dca
commit 9e3bcf772f
6 changed files with 122 additions and 21 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.17 2014/05/05 00:48:28 ryoon Exp $
# $NetBSD: Makefile,v 1.18 2014/09/11 14:00:18 prlw1 Exp $
DISTNAME= gnome-desktop-3.10.2
PKGNAME= ${DISTNAME:S/desktop/desktop3/}
PKGREVISION= 1
PKGREVISION= 2
CATEGORIES= x11 gnome
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gnome-desktop/${PKGVERSION_NOREV:R}/}
EXTRACT_SUFX= .tar.xz
@ -17,6 +17,14 @@ USE_LIBTOOL= yes
USE_TOOLS+= gmake intltool msgfmt pkg-config
USE_PKGLOCALEDIR= yes
# For https://bugzilla.gnome.org/show_bug.cgi?id=735974
# to fix build on systems which lack openat()
USE_TOOLS+= autoconf automake
pre-configure:
cd ${WRKSRC} && autoreconf -i
#
PKGCONFIG_OVERRIDE+= libgnome-desktop/gnome-desktop-3.0.pc.in
CONFIGURE_ARGS+= --with-gnome-distributor="The NetBSD Foundation"

View file

@ -1,7 +1,8 @@
$NetBSD: distinfo,v 1.6 2014/08/21 10:37:47 wiz Exp $
$NetBSD: distinfo,v 1.7 2014/09/11 14:00:18 prlw1 Exp $
SHA1 (gnome-desktop-3.10.2.tar.xz) = fd13640ad7f096f29267366bcdf4cf8dc95af07a
RMD160 (gnome-desktop-3.10.2.tar.xz) = 9d59c58c497eafa75a5ae7a38edaa740c8c77726
Size (gnome-desktop-3.10.2.tar.xz) = 1062876 bytes
SHA1 (patch-aa) = 0553828a17b36a1a7ce2fb66ed1ae0ce6eaa8075
SHA1 (patch-libgnome-desktop_libgsystem_gsystem-file-utils.c) = 9c015507b6ab5bb820651d326979e00f86c5a59f
SHA1 (patch-aa) = 7172c842aff2999e546ad9ee2f42786bba1fcd53
SHA1 (patch-configure.ac) = 54c79facb6f4953034866e23da9514c09e6ba06c
SHA1 (patch-libgnome-desktop_Makefile.am) = a9c2584b041e4ff01a073b779a3a92551368316a

View file

@ -1,9 +1,40 @@
$NetBSD: patch-aa,v 1.2 2014/02/12 01:23:33 prlw1 Exp $
$NetBSD: patch-aa,v 1.3 2014/09/11 14:00:18 prlw1 Exp $
Fix build on systems which don't provide openat()
https://bugzilla.gnome.org/show_bug.cgi?id=735974
allow 64-bit time_t on 32-bit system
--- libgnome-desktop/gnome-desktop-thumbnail.c.orig 2012-08-23 17:49:46.000000000 +0000
+++ libgnome-desktop/gnome-desktop-thumbnail.c
@@ -43,7 +43,9 @@
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include "gnome-desktop-thumbnail.h"
#include <glib/gstdio.h>
+#ifdef HAVE_OPENAT
#include <libgsystem.h>
+#endif
#define SECONDS_BETWEEN_STATS 10
@@ -376,14 +378,16 @@ _gdk_pixbuf_new_from_uri_at_scale (const
}
if (input_stream == NULL) {
+#ifdef HAVE_OPENAT
if (g_file_is_native (file))
input_stream = gs_file_read_noatime (file, NULL, &error);
else
+#endif
input_stream = G_INPUT_STREAM (g_file_read (file, NULL, &error));
if (input_stream == NULL) {
g_warning ("Unable to create an input stream for %s: %s", uri, error->message);
g_clear_error (&error);
- g_object_unref (file);
+ g_object_unref (file);
return NULL;
}
}
@@ -1613,7 +1613,7 @@ gnome_desktop_thumbnail_is_valid (GdkPix
thumb_mtime_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::MTime");
if (!thumb_mtime_str)

View file

@ -0,0 +1,17 @@
$NetBSD: patch-configure.ac,v 1.1 2014/09/11 14:00:18 prlw1 Exp $
Fix build on systems which don't provide openat()
https://bugzilla.gnome.org/show_bug.cgi?id=735974
--- configure.ac.orig 2013-11-21 11:14:58.000000000 +0000
+++ configure.ac
@@ -127,6 +127,9 @@ AC_SUBST(XEXT_REQUIRED)
AC_CHECK_LIBM
AC_SUBST(LIBM)
+AC_CHECK_FUNCS([openat])
+AM_CONDITIONAL([USE_LIBGSYSTEM], [test $ac_cv_func_openat = yes])
+
dnl we need x11 for GnomeBG
PKG_CHECK_MODULES(XLIB, x11,

View file

@ -0,0 +1,59 @@
$NetBSD: patch-libgnome-desktop_Makefile.am,v 1.1 2014/09/11 14:00:18 prlw1 Exp $
Fix build on systems which don't provide openat()
https://bugzilla.gnome.org/show_bug.cgi?id=735974
--- libgnome-desktop/Makefile.am.orig 2013-10-04 22:18:41.000000000 +0000
+++ libgnome-desktop/Makefile.am
@@ -6,7 +6,6 @@ lib_LTLIBRARIES = libgnome-desktop-3.la
AM_CPPFLAGS = \
-I$(top_srcdir) \
- -I$(srcdir)/libgsystem \
$(GNOME_DESKTOP_CFLAGS) \
$(XLIB_CFLAGS) \
-DG_LOG_DOMAIN=\"GnomeDesktop\" \
@@ -17,14 +16,20 @@ AM_CPPFLAGS = \
-DXKB_BASE=\""$(XKB_BASE)"\" \
$(DISABLE_DEPRECATED_CFLAGS)
+if USE_LIBGSYSTEM
+AM_CPPFLAGS += -I$(srcdir)/libgsystem
+endif
+
AM_CFLAGS = $(WARN_CFLAGS)
+if USE_LIBGSYSTEM
libgsystem_srcpath := libgsystem
libgsystem_cflags = $(GNOME_DESKTOP_CFLAGS)
libgsystem_libs = $(GNOME_DESKTOP_LIBS)
include libgsystem/Makefile-libgsystem.am
noinst_LTLIBRARIES += libgsystem.la
+endif
introspection_sources = \
gnome-desktop-thumbnail.c \
@@ -79,9 +84,12 @@ libgnome_desktop_3_la_LIBADD = \
$(XLIB_LIBS) \
$(LIBM) \
$(GNOME_DESKTOP_LIBS) \
- libgsystem.la \
-lrt
+if USE_LIBGSYSTEM
+libgnome_desktop_3_la_LIBADD += libgsystem.la
+endif
+
libgnome_desktop_3_la_LDFLAGS = \
-version-info $(LT_VERSION) \
-export-symbols-regex "^gnome_.*" \
@@ -143,7 +151,7 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
-EXTRA_DIST = \
+EXTRA_DIST += \
idle-monitor.xml \
xrandr.xml \
gnome-desktop-3.0.pc.in \

View file

@ -1,15 +0,0 @@
$NetBSD: patch-libgnome-desktop_libgsystem_gsystem-file-utils.c,v 1.1 2014/08/21 10:37:48 wiz Exp $
Add fcntl.h for openat().
--- libgnome-desktop/libgsystem/gsystem-file-utils.c.orig 2013-10-04 22:18:43.000000000 +0000
+++ libgnome-desktop/libgsystem/gsystem-file-utils.c
@@ -37,6 +37,8 @@
#include <glib-unix.h>
#include <limits.h>
#include <dirent.h>
+/* for openat() */
+#include <fcntl.h>
static int
close_nointr (int fd)