From 12ab010dc4e9c83a3a34e103f94fdb16e04bc189 Mon Sep 17 00:00:00 2001 From: Alexpux Date: Tue, 18 Mar 2014 11:22:33 +0400 Subject: [PATCH] pygobject: Rebuild against Python-3.4. Fix Python libs finding. --- mingw-w64-pygobject/PKGBUILD | 9 ++++++--- mingw-w64-pygobject/no-undefined.patch | 17 +++++++++-------- mingw-w64-pygobject/python-m4.patch | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 mingw-w64-pygobject/python-m4.patch diff --git a/mingw-w64-pygobject/PKGBUILD b/mingw-w64-pygobject/PKGBUILD index 7d3b727a16..727256a2a5 100644 --- a/mingw-w64-pygobject/PKGBUILD +++ b/mingw-w64-pygobject/PKGBUILD @@ -4,7 +4,7 @@ _realname=pygobject _mingw_suff=mingw-w64-${CARCH} pkgname=("${_mingw_suff}-python2-gobject" "${_mingw_suff}-python3-gobject" "${_mingw_suff}-pygobject-devel") pkgver=3.11.5 -pkgrel=1 +pkgrel=2 pkgdesc="Allows you to load glade interface files in a program at runtime (mingw-w64)" arch=(any) url="http://www.pygtk.org" @@ -14,15 +14,18 @@ makedepends=("${_mingw_suff}-python2" "${_mingw_suff}-python3" "${_mingw_suff}-g options=('staticlibs' 'strip') source=(http://ftp.gnome.org/pub/gnome/sources/pygobject/${pkgver%.*}/${_realname}-${pkgver}.tar.xz Werror-format-remove.patch - no-undefined.patch) + no-undefined.patch + python-m4.patch) md5sums=('f4129a9cd6f2fe3ae15d1e63c8c7818f' '97364096214dcf2c43f731d4fc3c1d1f' - '61fbb1d7044bec6f76b12ca7ed289c20') + 'bf2b0ec3e4c50fc75eed72c7e577e07b' + 'bb9a4f77ae6f5bdad1b93f9199c31509') prepare() { cd "${srcdir}/${_realname}-${pkgver}" patch -p1 -i ${srcdir}/Werror-format-remove.patch patch -p1 -i ${srcdir}/no-undefined.patch + patch -p1 -i ${srcdir}/python-m4.patch autoreconf -fi #WANT_AUTOMAKE=latest ./autogen.sh } diff --git a/mingw-w64-pygobject/no-undefined.patch b/mingw-w64-pygobject/no-undefined.patch index fed63acd78..c66b5fe18b 100644 --- a/mingw-w64-pygobject/no-undefined.patch +++ b/mingw-w64-pygobject/no-undefined.patch @@ -5,7 +5,7 @@ nodist_libgimarshallingtests_la_SOURCES = $(GI_DATADIR)/tests/gimarshallingtests.c $(GI_DATADIR)/tests/gimarshallingtests.h libgimarshallingtests_la_CFLAGS = $(GLIB_CFLAGS) -libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) -+libgimarshallingtests_la_LDFLAGS = -module -avoid-version -no-undefined $(GLIB_LIBS) ++libgimarshallingtests_la_LDFLAGS = -module -avoid-version -shrext $(PYTHON_SO) -no-undefined $(GLIB_LIBS) # This is a hack to make sure a shared library is built libgimarshallingtests.la: $(libgimarshallingtests_la_OBJECTS) $(libgimarshallingtests_la_DEPENDENCIES) @@ -14,7 +14,7 @@ nodist_libregress_la_SOURCES = $(GI_DATADIR)/tests/regress.c $(GI_DATADIR)/tests/regress.h libregress_la_CFLAGS = $(GIO_CFLAGS) $(CAIRO_CFLAGS) -libregress_la_LDFLAGS = -module -avoid-version $(GIO_LIBS) $(CAIRO_LIBS) -+libregress_la_LDFLAGS = -module -avoid-version -no-undefined $(GIO_LIBS) $(CAIRO_LIBS) ++libregress_la_LDFLAGS = -module -avoid-version -shrext $(PYTHON_SO) -no-undefined $(GIO_LIBS) $(CAIRO_LIBS) libregress.la: $(libregress_la_OBJECTS) $(libregress_la_DEPENDENCIES) $(AM_V_GEN) $(LINK) -rpath $(pkgpyexecdir) $(libregress_la_LDFLAGS) $(libregress_la_OBJECTS) $(libregress_la_LIBADD) $(LIBS) @@ -23,7 +23,7 @@ testhelper_la_CFLAGS = -I$(top_srcdir)/gi $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -testhelper_la_LDFLAGS = -module -avoid-version -+testhelper_la_LDFLAGS = -module -avoid-version -no-undefined $(PYTHON_LIBS) ++testhelper_la_LDFLAGS = -module -avoid-version -shrext $(PYTHON_SO) -no-undefined $(PYTHON_LIBS) testhelper_la_LIBADD = $(GLIB_LIBS) testhelper_la_SOURCES = \ testhelpermodule.c \ @@ -32,12 +32,13 @@ -.la.so: -+.la.dll: - test -L $@ || $(LN_S) .libs/$@ $@ +- test -L $@ || $(LN_S) .libs/$@ $@ ++%$(PYTHON_SO): %.la ++ $(LN_S) -f .libs/$@ $@ -all: $(check_LTLIBRARIES:.la=.so) -+all: $(check_LTLIBRARIES:.la=.dll) ++all: $(check_LTLIBRARIES:.la=$(PYTHON_SO)) EXTRA_DIST = \ compathelper.py \ @@ -46,7 +47,7 @@ clean-local: - rm -f $(check_LTLIBRARIES:.la=.so) file.txt~ -+ rm -f $(check_LTLIBRARIES:.la=.dll) file.txt~ ++ rm -f $(check_LTLIBRARIES:.la=$(PYTHON_SO)) file.txt~ DBUS_LAUNCH=$(shell which dbus-launch) RUN_TESTS_ENV_VARS= \ @@ -55,7 +56,7 @@ # pygtkcompat tests need to be run in a separate process as they # clobber global name space -check-local: $(check_LTLIBRARIES:.la=.so) $(test_typelibs) gschemas.compiled -+check-local: $(check_LTLIBRARIES:.la=.dll) $(test_typelibs) gschemas.compiled ++check-local: $(check_LTLIBRARIES:.la=$(PYTHON_SO)) $(test_typelibs) gschemas.compiled export `$(DBUS_LAUNCH)` && \ $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd $(srcdir)/runtests.py; rc=$$?; \ [ "$$rc" -ne 0 ] || [ -n "$$TEST_NAMES" ] || { TEST_NAMES=compat_test_pygtk $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd -Werror::PendingDeprecationWarning -Werror::DeprecationWarning -Werror::RuntimeWarning $(srcdir)/runtests.py; rc=$$?; }; \ diff --git a/mingw-w64-pygobject/python-m4.patch b/mingw-w64-pygobject/python-m4.patch new file mode 100644 index 0000000000..22a4eb44a4 --- /dev/null +++ b/mingw-w64-pygobject/python-m4.patch @@ -0,0 +1,16 @@ +--- a/m4/python.m4.orig 2014-02-01 11:34:44.000000000 +0400 ++++ b/m4/python.m4 2014-03-18 10:56:05.343200000 +0400 +@@ -73,7 +73,12 @@ + dnl deduce PYTHON_LIBS + py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` + if test "x$PYTHON_LIBS" = x; then +- PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}" ++ PYTHON_CONFIG=`which $PYTHON`-config ++ if test -x "$PYTHON_CONFIG"; then ++ PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null` ++ else ++ PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}" ++ fi + fi + if test "x$PYTHON_LIB_LOC" = x; then + PYTHON_LIB_LOC="${py_prefix}/lib"