From 9d6d7111f40be4d0b0416ed98141c3d3ea432100 Mon Sep 17 00:00:00 2001 From: yopito Date: Wed, 29 Mar 2017 07:52:20 +0200 Subject: [PATCH] New package: gamin 0.1.10 --- common/shlibs | 2 + srcpkgs/gamin-devel | 1 + .../patches/0001-Poll-files-on-nfs4.patch | 24 ++++++++ ...of-recent-glib-removing-G_CONST_RETU.patch | 59 ++++++++++++++++++ ...ble-server-deadlock-in-ih_sub_cancel.patch | 60 +++++++++++++++++++ .../disable-tests-for-cross-build.patch | 53 ++++++++++++++++ srcpkgs/gamin/patches/gamin-manape.patch | 16 +++++ srcpkgs/gamin/patches/musl.patch | 16 +++++ srcpkgs/gamin/template | 34 +++++++++++ 9 files changed, 265 insertions(+) create mode 120000 srcpkgs/gamin-devel create mode 100644 srcpkgs/gamin/patches/0001-Poll-files-on-nfs4.patch create mode 100644 srcpkgs/gamin/patches/0002-Fix-compilation-of-recent-glib-removing-G_CONST_RETU.patch create mode 100644 srcpkgs/gamin/patches/0004-fix-possible-server-deadlock-in-ih_sub_cancel.patch create mode 100644 srcpkgs/gamin/patches/disable-tests-for-cross-build.patch create mode 100644 srcpkgs/gamin/patches/gamin-manape.patch create mode 100644 srcpkgs/gamin/patches/musl.patch create mode 100644 srcpkgs/gamin/template diff --git a/common/shlibs b/common/shlibs index d46ec8976f4..38fadc7759e 100644 --- a/common/shlibs +++ b/common/shlibs @@ -456,6 +456,8 @@ libvhd.so.1.0 xen-libs-4.2.2_2 libxenstat.so.0 xen-libs-4.2.2_2 libblktapctl.so.1.0 xen-libs-4.2.2_2 libfsimage.so.1.0 xen-libs-4.2.2_2 +libfam.so.0 gamin-0.1.10_1 +libgamin-1.so.0 gamin-0.1.10_1 libKF5SyntaxHighlighting.so.5 syntax-highlighting-5.29.0_1 libbabl-0.1.so.0 babl-0.1.10_1 libbamf3.so.2 bamf-0.5.1_1 diff --git a/srcpkgs/gamin-devel b/srcpkgs/gamin-devel new file mode 120000 index 00000000000..50e9e178917 --- /dev/null +++ b/srcpkgs/gamin-devel @@ -0,0 +1 @@ +gamin \ No newline at end of file diff --git a/srcpkgs/gamin/patches/0001-Poll-files-on-nfs4.patch b/srcpkgs/gamin/patches/0001-Poll-files-on-nfs4.patch new file mode 100644 index 00000000000..3aebbd6a382 --- /dev/null +++ b/srcpkgs/gamin/patches/0001-Poll-files-on-nfs4.patch @@ -0,0 +1,24 @@ +source: https://src.fedoraproject.org/cgit/rpms/gamin.git/plain/0001-Poll-files-on-nfs4.patch + +From b92b17ecced6df463da73d6de566740cf5cd00d4 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Fri, 1 Feb 2013 15:19:58 +0100 +Subject: [PATCH 1/2] Poll files on nfs4 + +Add nfs4 among polled filesystems. + +https://bugzilla.gnome.org/show_bug.cgi?id=693006 +--- + server/gam_fs.c | 1 + + 1 file changed, 1 insertion(+) + +--- server/gam_fs.c.orig ++++ server/gam_fs.c +@@ -178,6 +178,7 @@ gam_fs_init (void) + gam_fs_set ("reiserfs", GFS_MT_DEFAULT, 0); + gam_fs_set ("novfs", GFS_MT_POLL, 30); + gam_fs_set ("nfs", GFS_MT_POLL, 5); ++ gam_fs_set ("nfs4", GFS_MT_POLL, 5); + if (stat("/etc/mtab", &mtab_sbuf) != 0) + { + GAM_DEBUG(DEBUG_INFO, "Could not stat /etc/mtab\n"); diff --git a/srcpkgs/gamin/patches/0002-Fix-compilation-of-recent-glib-removing-G_CONST_RETU.patch b/srcpkgs/gamin/patches/0002-Fix-compilation-of-recent-glib-removing-G_CONST_RETU.patch new file mode 100644 index 00000000000..caf627ef553 --- /dev/null +++ b/srcpkgs/gamin/patches/0002-Fix-compilation-of-recent-glib-removing-G_CONST_RETU.patch @@ -0,0 +1,59 @@ +source: https://src.fedoraproject.org/cgit/rpms/gamin.git/plain/0002-Fix-compilation-of-recent-glib-removing-G_CONST_RETU.patch + +From 77fe68f43ce75e920b0a94b0bc572cf3a21714f2 Mon Sep 17 00:00:00 2001 +From: Maciej Piechotka +Date: Tue, 13 Sep 2011 09:47:05 +0200 +Subject: [PATCH 2/2] Fix compilation of recent glib removing G_CONST_RETURN + +https://bugzilla.gnome.org/show_bug.cgi?id=658884 +--- + server/gam_node.c | 2 +- + server/gam_node.h | 2 +- + server/gam_subscription.c | 2 +- + server/gam_subscription.h | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- server/gam_node.c.orig ++++ server/gam_node.c +@@ -122,7 +122,7 @@ gam_node_set_is_dir(GamNode * node, gboolean is_dir) + * it has finished with the string. If it must keep it longer, it + * should makes its own copy. The returned string must not be freed. + */ +-G_CONST_RETURN char * ++const char * + gam_node_get_path(GamNode * node) + { + g_assert(node); +--- server/gam_node.h.orig ++++ server/gam_node.h +@@ -58,7 +58,7 @@ gboolean gam_node_is_dir (GamNode *node); + void gam_node_set_is_dir (GamNode *node, + gboolean is_dir); + +-G_CONST_RETURN char *gam_node_get_path (GamNode *node); ++const char *gam_node_get_path (GamNode *node); + + GList *gam_node_get_subscriptions (GamNode *node); + +--- server/gam_subscription.c.orig ++++ server/gam_subscription.c +@@ -141,7 +141,7 @@ gam_subscription_pathlen(GamSubscription * sub) + * @param sub the GamSubscription + * @returns The path being monitored. It should not be freed. + */ +-G_CONST_RETURN char * ++const char * + gam_subscription_get_path(GamSubscription * sub) + { + if (sub == NULL) +--- server/gam_subscription.h.orig ++++ server/gam_subscription.h +@@ -21,7 +21,7 @@ int gam_subscription_pathlen (GamSubscription *sub); + + int gam_subscription_get_reqno (GamSubscription *sub); + +-G_CONST_RETURN char *gam_subscription_get_path (GamSubscription *sub); ++const char *gam_subscription_get_path (GamSubscription *sub); + + GamListener *gam_subscription_get_listener (GamSubscription *sub); + diff --git a/srcpkgs/gamin/patches/0004-fix-possible-server-deadlock-in-ih_sub_cancel.patch b/srcpkgs/gamin/patches/0004-fix-possible-server-deadlock-in-ih_sub_cancel.patch new file mode 100644 index 00000000000..d738b7b3fb0 --- /dev/null +++ b/srcpkgs/gamin/patches/0004-fix-possible-server-deadlock-in-ih_sub_cancel.patch @@ -0,0 +1,60 @@ +source: https://src.fedoraproject.org/cgit/rpms/gamin.git/plain/0004-fix-possible-server-deadlock-in-ih_sub_cancel.patch + +From f9c67a13af33f389429e4e760f2023a23a9ac19f Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Wed, 4 Jan 2012 00:23:55 +0200 +Subject: [PATCH 4/4] fix possible server deadlock in ih_sub_cancel + +ih_sub_foreach() calls ih_sub_cancel() while inotify_lock is locked. +However, ih_sub_cancel() locks it again, and locking GMutex recursively +causes undefined behaviour. + +Fix that by removing locking from ih_sub_cancel() as ih_sub_foreach() +is its only user. Also make the function static so that it won't +accidentally get used by other files without locking (inotify-helper.h +is an internal server header). + +This should fix the intermittent deadlocks I've been experiencing +causing KDE applications to no longer start, and probably also +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542361 +--- + server/inotify-helper.c | 7 ++----- + server/inotify-helper.h | 1 - + 2 files changed, 2 insertions(+), 6 deletions(-) + +--- server/inotify-helper.c.orig ++++ server/inotify-helper.c +@@ -123,13 +123,11 @@ ih_sub_add (ih_sub_t * sub) + + /** + * Cancels a subscription which was being monitored. ++ * inotify_lock must be held when calling. + */ +-gboolean ++static gboolean + ih_sub_cancel (ih_sub_t * sub) + { +- G_LOCK(inotify_lock); +- +- + if (!sub->cancelled) + { + IH_W("cancelling %s\n", sub->pathname); +@@ -140,7 +138,6 @@ ih_sub_cancel (ih_sub_t * sub) + sub_list = g_list_remove (sub_list, sub); + } + +- G_UNLOCK(inotify_lock); + return TRUE; + } + +--- server/inotify-helper.h.orig ++++ server/inotify-helper.h +@@ -34,7 +34,6 @@ gboolean ih_startup (event_callback_t ecb, + found_callback_t fcb); + gboolean ih_running (void); + gboolean ih_sub_add (ih_sub_t *sub); +-gboolean ih_sub_cancel (ih_sub_t *sub); + + /* Return FALSE from 'f' if the subscription should be cancelled */ + void ih_sub_foreach (void *callerdata, gboolean (*f)(ih_sub_t *sub, void *callerdata)); diff --git a/srcpkgs/gamin/patches/disable-tests-for-cross-build.patch b/srcpkgs/gamin/patches/disable-tests-for-cross-build.patch new file mode 100644 index 00000000000..91c8ae83611 --- /dev/null +++ b/srcpkgs/gamin/patches/disable-tests-for-cross-build.patch @@ -0,0 +1,53 @@ +Disable abstract socket namespace test since can't be achieved while cross-building. +--- configure.in.ORIG ++++ configure.in +@@ -388,47 +388,9 @@ + #### Abstract sockets + + AC_MSG_CHECKING(abstract socket namespace) +-AC_LANG_PUSH(C) +-AC_RUN_IFELSE([AC_LANG_PROGRAM( +-[[ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-]], +-[[ +- int listen_fd; +- struct sockaddr_un addr; +- +- listen_fd = socket (PF_UNIX, SOCK_STREAM, 0); +- +- if (listen_fd < 0) +- { +- fprintf (stderr, "socket() failed: %s\n", strerror (errno)); +- exit (1); +- } +- +- memset (&addr, '\0', sizeof (addr)); +- addr.sun_family = AF_UNIX; +- strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test"); +- addr.sun_path[0] = '\0'; /* this is what makes it abstract */ +- +- if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0) +- { +- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", +- strerror (errno)); +- exit (1); +- } +- else +- exit (0); +-]])], +- [have_abstract_sockets=yes], +- [have_abstract_sockets=no]) +-AC_LANG_POP(C) ++have_abstract_sockets=yes + AC_MSG_RESULT($have_abstract_sockets) ++AC_MSG_WARN([Emptied abstract socket namespace test for cross-building]) + + if test x$enable_abstract_sockets = xyes; then + if test x$have_abstract_sockets = xno; then diff --git a/srcpkgs/gamin/patches/gamin-manape.patch b/srcpkgs/gamin/patches/gamin-manape.patch new file mode 100644 index 00000000000..68e0f870533 --- /dev/null +++ b/srcpkgs/gamin/patches/gamin-manape.patch @@ -0,0 +1,16 @@ +Don't try to build with -DG_DISABLE_DEPRECATED - glib has moved on + +source: https://src.fedoraproject.org/cgit/rpms/gamin.git/plain/gamin-manape.patch + +--- server/Makefile.am.manape 2008-11-12 15:45:28.000000000 -0500 ++++ server/Makefile.am 2011-07-20 21:06:37.465307638 -0400 +@@ -6,8 +6,7 @@ INCLUDES = \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/libgamin \ + $(DAEMON_CFLAGS) \ +- -DBINDIR=\""$(libexecdir)"\" \ +- -DG_DISABLE_DEPRECATED ++ -DBINDIR=\""$(libexecdir)"\" + + if GAMIN_DEBUG + INCLUDES += -DGAM_DEBUG_ENABLED diff --git a/srcpkgs/gamin/patches/musl.patch b/srcpkgs/gamin/patches/musl.patch new file mode 100644 index 00000000000..30d78387666 --- /dev/null +++ b/srcpkgs/gamin/patches/musl.patch @@ -0,0 +1,16 @@ +source: https://mail.gnome.org/archives/gamin-list/2016-April/msg00000.html + +The musl C library does not provide the non portable +PTHREAD_MUTEX_RECURSIVE_NP. Test for PTHREAD_MUTEX_RECURSIVE_NP only. + +--- libgamin/gam_data.c.orig ++++ libgamin/gam_data.c +@@ -470,7 +470,7 @@ gamin_data_new(void) + } + if (is_threaded > 0) { + pthread_mutexattr_init(&attr); +-#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP) ++#if defined(PTHREAD_MUTEX_RECURSIVE_NP) + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); + #else + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); diff --git a/srcpkgs/gamin/template b/srcpkgs/gamin/template new file mode 100644 index 00000000000..ddf074f1ce1 --- /dev/null +++ b/srcpkgs/gamin/template @@ -0,0 +1,34 @@ +# Template file for 'gamin' +pkgname=gamin +version=0.1.10 +revision=1 +build_style=gnu-configure +configure_args="--disable-static" +# no -python subpackage: failed to cross build for armv7hf +hostmakedepends="automake libtool pkg-config" +makedepends="glib-devel" +short_desc="Library providing the FAM File Alteration Monitor API" +maintainer="yopito " +license="GPL-2" +homepage="http://www.gnome.org/~veillard/gamin/" +distfiles="$GNOME_SITE/gamin/0.1/gamin-${version}.tar.bz2" +checksum=a59948b20ce2f14136c013f155abb8c8d51db2ea167c063ff33461e453fec10a + +pre_configure() { + autoreconf -fi +} + +post_install() { + # "--disable-static" configure arg has no effect + rm ${DESTDIR}/usr/lib/libgamin_shared.a +} + +gamin-devel_package() { + short_desc+=" - development" + depends="${makedepends} ${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove usr/lib/*.so + vmove usr/lib/pkgconfig/gamin.pc + } +}