gamin: Fix building shared libraries and python module

This commit is contained in:
Alexpux
2014-09-26 12:16:45 +04:00
parent 0e971d08ac
commit 7bdf00b60c
4 changed files with 140 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
--- gamin-0.1.10/libgamin/Makefile.am.orig 2007-07-04 17:36:48.000000000 +0400
+++ gamin-0.1.10/libgamin/Makefile.am 2014-09-26 10:31:01.008000000 +0400
@@ -40,12 +40,12 @@
libgamin_1_la_LIBADD =
libgamin_1_la_LDFLAGS = -Wl,--version-script=$(srcdir)/gamin_sym.version \
- -version-info @GAMIN_VERSION_INFO@ @THREAD_LIBS@
+ -version-info @GAMIN_VERSION_INFO@ @THREAD_LIBS@ -no-undefined
libfam_la_SOURCES = $(libgamin_1_la_SOURCES)
libfam_la_LIBADD = $(libgamin_1_la_LIBADD)
libfam_la_LDFLAGS = -Wl,--version-script=$(srcdir)/gamin_sym.version \
- -version-info @FAM_VERSION_INFO@ @THREAD_LIBS@
+ -version-info @FAM_VERSION_INFO@ @THREAD_LIBS@ -no-undefined
#
# Compile a program locally to check
--- gamin-0.1.10/python/Makefile.am.orig 2007-07-04 17:36:48.000000000 +0400
+++ gamin-0.1.10/python/Makefile.am 2014-09-26 10:31:01.008000000 +0400
@@ -11,7 +11,7 @@
_gamin_la_SOURCES = gamin.c
_gamin_la_LIBADD = $(top_builddir)/libgamin/libgamin-1.la
-_gamin_la_LDFLAGS = -module -avoid-version
+_gamin_la_LDFLAGS = -module -avoid-version -no-undefined
python_PYTHON = gamin.py

View File

@@ -0,0 +1,56 @@
Description: Don't use deprecated G_CONST_RETURN. Fixes building with newer glib versions.
Author: Matthias Klose <doko@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/829504
Index: gamin/server/gam_node.c
===================================================================
--- gamin.orig/server/gam_node.c 2011-10-18 16:09:04.873780685 +0200
+++ gamin/server/gam_node.c 2011-10-18 16:09:01.965780543 +0200
@@ -122,7 +122,7 @@
* 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);
Index: gamin/server/gam_node.h
===================================================================
--- gamin.orig/server/gam_node.h 2011-10-18 16:09:04.729780677 +0200
+++ gamin/server/gam_node.h 2011-10-18 16:09:01.961780544 +0200
@@ -58,7 +58,7 @@
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);
Index: gamin/server/gam_subscription.c
===================================================================
--- gamin.orig/server/gam_subscription.c 2011-10-18 16:09:04.817780682 +0200
+++ gamin/server/gam_subscription.c 2011-10-18 16:09:01.965780543 +0200
@@ -141,7 +141,7 @@
* @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)
Index: gamin/server/gam_subscription.h
===================================================================
--- gamin.orig/server/gam_subscription.h 2011-10-18 16:09:04.929780687 +0200
+++ gamin/server/gam_subscription.h 2011-10-18 16:09:01.965780543 +0200
@@ -21,7 +21,7 @@
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);

View File

@@ -0,0 +1,37 @@
--- gamin-0.1.10/configure.in.orig 2014-09-26 12:01:20.799200000 +0400
+++ gamin-0.1.10/configure.in 2014-09-26 12:07:42.214200000 +0400
@@ -453,6 +453,7 @@
PYTHON_VERSION=
PYTHON_INCLUDES=
+PYTHON_LIBS=
PYTHON_SITE_PACKAGES=
PYTHON_TESTS=
pythondir=
@@ -479,6 +480,7 @@
if test "$PYTHON" != ""
then
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
+ PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
echo Found Python version $PYTHON_VERSION
fi
if test "$PYTHON_VERSION" != ""
@@ -527,6 +529,7 @@
AC_SUBST(pythondir)
AC_SUBST(PYTHON_VERSION)
AC_SUBST(PYTHON_INCLUDES)
+AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_SITE_PACKAGES)
dnl After all config-related tweaking of CFLAGS, set it to its "build" value
--- gamin-0.1.10/python/Makefile.am.orig 2014-09-26 12:09:39.370200000 +0400
+++ gamin-0.1.10/python/Makefile.am 2014-09-26 12:09:45.157800000 +0400
@@ -11,7 +11,7 @@
_gamin_la_SOURCES = gamin.c
_gamin_la_LIBADD = $(top_builddir)/libgamin/libgamin-1.la
-_gamin_la_LDFLAGS = -module -avoid-version -no-undefined
+_gamin_la_LDFLAGS = $(PYTHON_LIBS) -module -avoid-version -no-undefined
python_PYTHON = gamin.py

View File

@@ -3,25 +3,39 @@
pkgname="gamin"
pkgver=0.1.10
pkgrel=1
pkgdesc="the File Alteration Monitor (development)"
pkgdesc="File and directory monitoring system defined to be a subset of the FAM (File Alteration Monitor)"
arch=('i686' 'x86_64')
url="https://people.gnome.org/~veillard/gamin/"
license=('LGPL')
groups=('development')
makedepends=('gcc' 'gtk-doc' 'glib2-devel' 'pcre-devel')
makedepends=('gcc' 'gtk-doc' 'glib2-devel' 'pcre-devel' 'python2')
optdepends=('python2: for the python module')
depends=()
options=()
source=("ftp://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2")
sha256sums=('a59948b20ce2f14136c013f155abb8c8d51db2ea167c063ff33461e453fec10a')
source=("ftp://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2"
001-no-undefined.patch
002-fix-deprecated-const.patch
003-python-link.patch)
sha256sums=('a59948b20ce2f14136c013f155abb8c8d51db2ea167c063ff33461e453fec10a'
'ab3d63b9ec568fbfe597216135b1e210b92299da0d2556be70fa7c01b3600e06'
'33af6c9a94b459506fc48892c169d89cb4ad7c68e160f0c4bc74475f19ce5a2f'
'1f11906d4d4dc5159ca647167899ccfb5efec4648ea77b6e96397142293bbab7')
prepare() {
cd "$srcdir/$pkgname-$pkgver"
patch -p1 -i ${srcdir}/001-no-undefined.patch
patch -p1 -i ${srcdir}/002-fix-deprecated-const.patch
patch -p1 -i ${srcdir}/003-python-link.patch
autoreconf -ivf
}
build() {
cd "$srcdir/$pkgname-$pkgver"
./configure --prefix=/usr --disable-server
./configure \
--prefix=/usr \
--libexecdir=/usr/lib/gamin \
--disable-server \
--with-python=/usr/bin/python2
make
}