[packages/gegl-qt] - build python binding - added shiboken patch (adjust to call shiboken directly, now it works that w

qboosh qboosh at pld-linux.org
Fri Jul 12 21:48:37 CEST 2013


commit f733a8fb55dd68a00155a2fc65f50af6219a77b0
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Jul 12 21:48:19 2013 +0200

    - build python binding
    - added shiboken patch (adjust to call shiboken directly, now it works that way)

 gegl-qt-shiboken.patch | 20 ++++++++++++++++++++
 gegl-qt.spec           | 45 +++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 63 insertions(+), 2 deletions(-)
---
diff --git a/gegl-qt.spec b/gegl-qt.spec
index 72978a9..3bfe947 100644
--- a/gegl-qt.spec
+++ b/gegl-qt.spec
@@ -1,6 +1,9 @@
 # TODO:
-# - python support (PySide)
 # - qt5
+#
+# Conditional build:
+%bcond_without	python	# Python (PySide) binding
+#
 Summary:	Qt utility library for GEGL
 Summary(pl.UTF-8):	Biblioteka narzędziowa Qt dla biblioteki GEGL
 Name:		gegl-qt
@@ -13,6 +16,7 @@ Source0:	ftp://ftp.gimp.org/pub/gegl-qt/0.0/%{name}-%{version}.tar.bz2
 # git diff 0.0.7 4f46898e7dfaade23553f167bb03caf95171c0e7 (before switch to gegl 0.3)
 # (then adjusted to apply on dist tarball)
 Patch0:		%{name}-git.patch
+Patch1:		%{name}-shiboken.patch
 URL:		http://www.gegl.org/
 BuildRequires:	QtCore-devel
 BuildRequires:	QtDeclarative-devel
@@ -21,7 +25,13 @@ BuildRequires:	doxygen
 BuildRequires:	gegl-devel >= 0.2.0
 BuildRequires:	pkgconfig
 BuildRequires:	qt4-qmake
+BuildRequires:	rpmbuild(macros) >= 1.219
+BuildRequires:	texlive-format-pdflatex
 BuildRequires:	texlive-latex-extend
+%if %{with python}
+BuildRequires:	python-PySide-devel
+BuildRequires:	shiboken
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -58,6 +68,19 @@ Header files for gegl-qt4 library.
 %description -n gegl-qt4-devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki gegl-qt4.
 
+%package -n python-gegl-qt4
+Summary:	Python (PySide) binding for gegl-qt4 library
+Summary(pl.UTF-8):	Wiązania Pythona (PySide) do biblioteki gegl-qt4
+Group:		Libraries/Python
+Requires:	gegl-qt4 = %{version}-%{release}
+Requires:	python-PySide
+
+%description -n python-gegl-qt4
+Python (PySide) binding for gegl-qt4 library.
+
+%description -n python-gegl-qt4 -l pl.UTF-8
+Wiązania Pythona (PySide) do biblioteki gegl-qt4.
+
 %package apidocs
 Summary:	gegl library API documentation
 Summary(pl.UTF-8):	Dokumentacja API biblioteki gegl
@@ -73,12 +96,14 @@ Dokumentacja API biblioteki gegl.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 qmake-qt4 \
 	QMAKE_CXX="%{__cxx}" \
 	QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
-	QMAKE_LFLAGS_RELEASE="%{rpmldflags}"
+	QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \
+	%{!?with_python:HAVE_PYSIDE=no}
 
 %{__make}
 
@@ -88,6 +113,15 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	INSTALL_ROOT=$RPM_BUILD_ROOT
 
+# extraneous symlink
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgegl-qt4-0.1.so.0.0
+
+%if %{with python}
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_postclean
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -110,6 +144,13 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/gegl-qt4-0.1
 %{_pkgconfigdir}/gegl-qt4-0.1.pc
 
+%if %{with python}
+%files -n python-gegl-qt4
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/gegl-qt4-0.1/geglqt.so
+%{py_sitedir}/pygeglqt4.py[co]
+%endif
+
 %files apidocs
 %defattr(644,root,root,755)
 %doc doc/html/*
diff --git a/gegl-qt-shiboken.patch b/gegl-qt-shiboken.patch
new file mode 100644
index 0000000..1ce3c64
--- /dev/null
+++ b/gegl-qt-shiboken.patch
@@ -0,0 +1,20 @@
+--- gegl-qt-0.0.7/pygegl-qt/pygegl-qt.pro.orig	2013-07-12 19:13:36.533142354 +0200
++++ gegl-qt-0.0.7/pygegl-qt/pygegl-qt.pro	2013-07-12 20:19:08.606310673 +0200
+@@ -33,7 +33,7 @@
+         -I$$[QT_INSTALL_HEADERS]/QtNetwork
+ }
+ 
+-INCLUDES += $$system(pkg-config --cflags gegl pygobject-2.0 gobject-2.0 pyside)
++INCLUDES += $$system(pkg-config --cflags gegl-0.2 pygobject-2.0 gobject-2.0 pyside shiboken QtCore)
+ 
+ # pkg-config --libs pyside is buggy for pyside<1.0.5 due
+ # http://bugs.pyside.org/show_bug.cgi?id=929
+@@ -50,7 +50,7 @@
+ # Generate
+ QMAKE_EXTRA_TARGETS += generate
+ generate.target = generate
+-generate.commands += generatorrunner --generatorSet=shiboken \
++generate.commands += shiboken \
+                 global.h \
+                 --include-paths=$$GEN_INCLUDE_PATHS \
+                 --typesystem-paths=$$OUT_PWD:$$IN_PWD:$$TYPESYSTEM_DIR \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gegl-qt.git/commitdiff/f733a8fb55dd68a00155a2fc65f50af6219a77b0



More information about the pld-cvs-commit mailing list