summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-05-09 03:45:05 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-05-12 07:35:56 +0700
commita8752f2c4465b28a62bbcb90ba2faa4199fdbc66 (patch)
treee8428d2cde1202b9c56a0ecf00e54503b532afd8
parent5cfe8c0a9a78c4eaff23ced8781029acd4518a2d (diff)
downloadslackbuilds-a8752f2c4465b28a62bbcb90ba2faa4199fdbc66.tar.gz
python/pygobject3: Added Python3 detection + Update README.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--python/pygobject3/README4
-rw-r--r--python/pygobject3/pygobject3.SlackBuild24
-rw-r--r--python/pygobject3/python3.4.patch96
3 files changed, 114 insertions, 10 deletions
diff --git a/python/pygobject3/README b/python/pygobject3/README
index 5900fdab94..40f7f4e359 100644
--- a/python/pygobject3/README
+++ b/python/pygobject3/README
@@ -1,3 +1,7 @@
This archive contains bindings for the GObject, to be used in Python.
It is a fairly complete set of bindings, it's already rather useful,
and is usable to write moderately complex programs.
+
+Note:
+If you have python3 installed, then you will need an additional
+dependencies: gnome-common and py3cairo
diff --git a/python/pygobject3/pygobject3.SlackBuild b/python/pygobject3/pygobject3.SlackBuild
index 587b06ee0a..e4a8fff48a 100644
--- a/python/pygobject3/pygobject3.SlackBuild
+++ b/python/pygobject3/pygobject3.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=pygobject3
SRCNAM=pygobject
VERSION=${VERSION:-3.10.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -65,10 +65,16 @@ tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
cd $SRCNAM-$VERSION
chown -R root:root .
find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+if $(python3 -c 'import sys' 2>/dev/null); then
+ patch -p1 < $CWD/python3.4.patch
+ PYTHON=python3
+ ./autogen.sh
+fi
CFLAGS="$SLKCFLAGS" \
./configure \
@@ -81,12 +87,11 @@ CFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
-find $PKG | xargs file | grep -e "executable" -e "shared object" \
- | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- INSTALL AUTHORS COPYING* NEWS README* \
+cp -a INSTALL AUTHORS COPYING* NEWS README* \
$PKG/usr/doc/$PRGNAM-$VERSION
( cd $PKG/usr/doc/$PRGNAM-$VERSION
ln -s ../../share/gtk-doc/html/pygobject html
@@ -97,4 +102,3 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
-
diff --git a/python/pygobject3/python3.4.patch b/python/pygobject3/python3.4.patch
new file mode 100644
index 0000000000..c71af55b50
--- /dev/null
+++ b/python/pygobject3/python3.4.patch
@@ -0,0 +1,96 @@
+From 2ff095ea0b0c05fbf6cc332eeadf26cfeb9e69f7 Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Tue, 24 Dec 2013 22:19:02 +0000
+Subject: build: Avoid clash between gi/types.py and stdlib
+
+Use non-recursive make for the Python modules in gi/ to work around a
+clash between gi/types.py and the standard library's types module when
+running py-compile.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=721025
+
+Signed-off-by: Martin Pitt <martinpitt@gnome.org>
+
+diff --git a/Makefile.am b/Makefile.am
+index 5051b54..58d720f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,9 @@
+ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+ AUTOMAKE_OPTIONS = 1.7
+
++# Part of the gi subdirectory is handled with non-recursive make to avoid
++# py-compile getting confused between gi/types.py and Python's standard
++# types module.
+ SUBDIRS = examples gi tests pygtkcompat
+
+ PLATFORM_VERSION = 3.0
+@@ -49,6 +52,27 @@ MAINTAINERCLEANFILES = \
+ BUILT_EXTRA_DIST = \
+ ChangeLog
+
++nobase_pyexec_PYTHON = \
++ gi/__init__.py \
++ gi/types.py \
++ gi/module.py \
++ gi/importer.py \
++ gi/pygtkcompat.py \
++ gi/docstring.py
++
++# if we build in a separate tree, we need to symlink the *.py files from the
++# source tree; Python does not accept the extensions and modules in different
++# paths
++build_pylinks:
++ for f in $(nobase_pyexec_PYTHON); do \
++ [ -e $(builddir)/$$f ] || \
++ $(LN_S) $(abs_srcdir)/$$f $(builddir)/$$f; \
++ done
++
++all-local: build_pylinks
++
++check-local: build_pylinks
++
+ # pkg-config files
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc
+diff --git a/gi/Makefile.am b/gi/Makefile.am
+index fc11ff8..aa91a46 100644
+--- a/gi/Makefile.am
++++ b/gi/Makefile.am
+@@ -26,14 +26,6 @@ endif
+
+ pygidir = $(pyexecdir)/gi
+
+-pygi_PYTHON = \
+- __init__.py \
+- types.py \
+- module.py \
+- importer.py \
+- pygtkcompat.py \
+- docstring.py
+-
+ pygi_LTLIBRARIES = _gi.la
+
+ _gi_la_SOURCES = \
+@@ -118,16 +110,8 @@ _gi_cairo_la_LDFLAGS = \
+ %$(PYTHON_SO): %.la
+ $(LN_S) -f .libs/$@ $@
+
+-# if we build in a separate tree, we need to symlink the *.py files from the
+-# source tree; Python does not accept the extensions and modules in different
+-# paths
+-build_pylinks:
+- for f in $(pygi_PYTHON); do \
+- [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
+- done
+-
+-all-local: $(LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks
++all-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
+
+-check-local: $(LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks
++check-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
+ clean-local:
+ rm -f $(LTLIBRARIES:.la=$(PYTHON_SO))
+--
+cgit v0.10.1
+