]> git.pld-linux.org Git - packages/gegl-qt.git/commitdiff
- added qmake patch (fixes out-of-tree build, enables optflags for python binding)
authorJakub Bogusz <qboosh@pld-linux.org>
Thu, 16 Oct 2014 18:49:19 +0000 (20:49 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Thu, 16 Oct 2014 18:49:19 +0000 (20:49 +0200)
- added qt5 patch (fixes build with Qt5, except qml plugin)
- build qt5 packages

gegl-qt-qmake.patch [new file with mode: 0644]
gegl-qt-qt5.patch [new file with mode: 0644]
gegl-qt.spec

diff --git a/gegl-qt-qmake.patch b/gegl-qt-qmake.patch
new file mode 100644 (file)
index 0000000..1dd3fbd
--- /dev/null
@@ -0,0 +1,42 @@
+--- gegl-qt-0.0.7/pygegl-qt/pygegl-qt.pro.orig 2014-10-15 18:57:31.885719725 +0200
++++ gegl-qt-0.0.7/pygegl-qt/pygegl-qt.pro      2014-10-15 20:39:37.055462675 +0200
+@@ -49,7 +49,8 @@
+ # Generate
+ QMAKE_EXTRA_TARGETS += generate
+-generate.target = generate
++generate.depends = global.h typesystem_gegl-qt.xml
++generate.target = geglqt
+ generate.commands += shiboken \
+                 global.h \
+                 --include-paths=$$GEN_INCLUDE_PATHS \
+@@ -61,8 +62,9 @@
+ QMAKE_EXTRA_TARGETS += compile
+ compile.depends += generate
+ compile.target = compile
+-compile.commands += g++ -DNO_IMPORT_PYGOBJECT geglqt/geglqt_*.cpp $$INCLUDES -Wall -fPIC -c;
+-compile.commands += g++ geglqt/geglqt_module_wrapper.cpp $$INCLUDES -Wall -fPIC -c
++compile.commands += $$QMAKE_CXX $$QMAKE_CXXFLAGS_RELEASE -DNO_IMPORT_PYGOBJECT geglqt/geglqt_*.cpp $$INCLUDES -Wall -fPIC -c;
++compile.commands += $$QMAKE_CXX $$QMAKE_CXXFLAGS_RELEASE geglqt/geglqt_module_wrapper.cpp $$INCLUDES -Wall -fPIC -c;
++compile.commands += touch compile
+ LIBRARIES += -L../../gegl-qt -l$$GEGLQT_LIBNAME
+@@ -74,7 +75,7 @@
+ link.target = $$GEGLQT_LIBNAME/geglqt.so
+ link.commands += mkdir -p $$GEGLQT_LIBNAME;
+ link.commands += cd $$GEGLQT_LIBNAME;
+-link.commands += g++ ../geglqt*wrapper.o $$LIBRARIES -fPIC -shared -Wl,-soname,geglqt.so -o geglqt.so
++link.commands += $$QMAKE_CXX $$QMAKE_LFLAGS_RELEASE ../geglqt*wrapper.o $$LIBRARIES -fPIC -shared -Wl,-soname,geglqt.so -o geglqt.so
+ # Install
+ PYTHON_SITE_PACKAGES = $$system(`echo $PYTHON` -c \"from distutils.sysconfig import get_python_lib; print get_python_lib(True)\")
+@@ -83,7 +84,7 @@
+ }
+-modules.files = $$GEGLQT_LIBNAME/geglqt.so
++modules.files = $$OUT_PWD/$$GEGLQT_LIBNAME/geglqt.so
+ modules.CONFIG += no_check_exist
+ modules.path = $$PYTHON_SITE_PACKAGES/$$GEGLQT_LIBNAME
diff --git a/gegl-qt-qt5.patch b/gegl-qt-qt5.patch
new file mode 100644 (file)
index 0000000..8fb0d58
--- /dev/null
@@ -0,0 +1,47 @@
+--- gegl-qt-0.0.7/config.pri.orig      2014-10-15 21:31:05.125333082 +0200
++++ gegl-qt-0.0.7/config.pri   2014-10-16 20:21:36.518548768 +0200
+@@ -67,7 +67,7 @@
+ # QtDeclarative
+ HAVE_QT_DECLARATIVE = yes
+ contains(QT_MAJOR_VERSION, 5) {
+-    !contains(QT_CONFIG, declarative) {
++    !system(pkg-config Qt5Declarative_disabled) {
+         HAVE_QT_DECLARATIVE = no
+     }
+ } else {
+@@ -79,22 +79,16 @@
+ # QtQuick1 provides QDeclarativeView and QDeclarativeItem
+ # On Qt4 it is actually a part of the QtDeclarative module
+ HAVE_QT_QUICK1 = yes
+-contains(QT_MAJOR_VERSION, 5) {
+-    !contains(QT_CONFIG, quick1) {
+-        HAVE_QT_QUICK1 = no
+-    }
+-} else {
+-    !contains(HAVE_QT_DECLARATIVE, yes) {
+-        HAVE_QT_QUICK1 = no
+-    }
++!contains(HAVE_QT_DECLARATIVE, yes) {
++     HAVE_QT_QUICK1 = no
+ }
+ # On Qt5, quick or quick1 is required in addition to declarative for "QT" option
+ # On Qt4, it should only contain declarative
+ contains(QT_MAJOR_VERSION, 5) {
+-    QT_DECLARATIVE = declarative quick
++    QT_DECLARATIVE = declarative
+     contains(HAVE_QT_QUICK1, yes) {
+-        QT_DECLARATIVE += quick1
++       QT_DECLARATIVE += quick1
+     }
+ } else {
+     QT_DECLARATIVE = declarative
+@@ -135,7 +129,7 @@
+ # QtWidgets
+ HAVE_QT_WIDGETS = yes
+ contains(QT_MAJOR_VERSION, 5) {
+-    !system(pkg-config QtWidgets) {
++    !system(pkg-config Qt5Widgets) {
+         HAVE_QT_WIDGETS = no
+     }
+ } else {
index 3bfe9476b692cabba6824f139f479bafcc37b0a7..5b1796a3a0618edac4ec673a09f6970ee3fc697e 100644 (file)
@@ -1,8 +1,9 @@
-# TODO:
-# - qt5
+# TODO: qml plugin for qt5
 #
 # Conditional build:
-%bcond_without python  # Python (PySide) binding
+%bcond_without python  # Python (PySide) binding for Qt4 library
+%bcond_without qt4     # Qt4 library
+%bcond_without qt5     # Qt5 library
 #
 Summary:       Qt utility library for GEGL
 Summary(pl.UTF-8):     Biblioteka narzędziowa Qt dla biblioteki GEGL
@@ -17,14 +18,25 @@ Source0:    ftp://ftp.gimp.org/pub/gegl-qt/0.0/%{name}-%{version}.tar.bz2
 # (then adjusted to apply on dist tarball)
 Patch0:                %{name}-git.patch
 Patch1:                %{name}-shiboken.patch
+Patch2:                %{name}-qmake.patch
+Patch3:                %{name}-qt5.patch
 URL:           http://www.gegl.org/
-BuildRequires: QtCore-devel
-BuildRequires: QtDeclarative-devel
-BuildRequires: QtGui-devel
+%if %{with qt4}
+BuildRequires: QtCore-devel >= 4
+BuildRequires: QtDeclarative-devel >= 4
+BuildRequires: QtGui-devel >= 4
+%endif
+%if %{with qt5}
+BuildRequires: Qt5Core-devel >= 5
+BuildRequires: Qt5Declarative-devel >= 5
+BuildRequires: Qt5Gui-devel >= 5
+BuildRequires: Qt5Widgets-devel >= 5
+%endif
 BuildRequires: doxygen
 BuildRequires: gegl-devel >= 0.2.0
 BuildRequires: pkgconfig
-BuildRequires: qt4-qmake
+%{?with_qt4:BuildRequires:     qt4-qmake >= 4}
+%{?with_qt5:BuildRequires:     qt5-qmake >= 5}
 BuildRequires: rpmbuild(macros) >= 1.219
 BuildRequires: texlive-format-pdflatex
 BuildRequires: texlive-latex-extend
@@ -42,7 +54,7 @@ Biblioteka narzędziowa Qt dla biblioteki GEGL.
 
 %package -n gegl-qt4
 Summary:       Qt 4 utility library for GEGL
-Summary(pl.UTF-8):     Biblioteka narzędziowa Qt dla biblioteki GEGL
+Summary(pl.UTF-8):     Biblioteka narzędziowa Qt dla biblioteki GEGL
 Group:         X11/Libraries
 Requires:      gegl >= 0.2.0
 
@@ -56,9 +68,9 @@ Biblioteka narzędziowa Qt 4 dla biblioteki GEGL.
 Summary:       Header files for gegl-qt4 library
 Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki gegl-qt4
 Group:         Development/Libraries
-Requires:      QtCore-devel
-Requires:      QtDeclarative-devel
-Requires:      QtGui-devel
+Requires:      QtCore-devel >= 4
+Requires:      QtDeclarative-devel >= 4
+Requires:      QtGui-devel >= 4
 Requires:      gegl-qt4 = %{version}-%{release}
 Requires:      gegl-devel >= 0.2.0
 
@@ -81,6 +93,34 @@ 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 -n gegl-qt5
+Summary:       Qt 5 utility library for GEGL
+Summary(pl.UTF-8):     Biblioteka narzędziowa Qt 5 dla biblioteki GEGL
+Group:         X11/Libraries
+Requires:      gegl >= 0.2.0
+
+%description -n gegl-qt5
+Qt 5 utility library for GEGL.
+
+%description -n gegl-qt5 -l pl.UTF-8
+Biblioteka narzędziowa Qt 5 dla biblioteki GEGL.
+
+%package -n gegl-qt5-devel
+Summary:       Header files for gegl-qt5 library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki gegl-qt5
+Group:         Development/Libraries
+Requires:      Qt5Core-devel >= 5
+Requires:      Qt5Declarative-devel >= 5
+Requires:      Qt5Gui-devel >= 5
+Requires:      gegl-qt5 = %{version}-%{release}
+Requires:      gegl-devel >= 0.2.0
+
+%description -n gegl-qt5-devel
+Header files for gegl-qt5 library.
+
+%description -n gegl-qt5-devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki gegl-qt5.
+
 %package apidocs
 Summary:       gegl library API documentation
 Summary(pl.UTF-8):     Dokumentacja API biblioteki gegl
@@ -97,20 +137,42 @@ Dokumentacja API biblioteki gegl.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
-qmake-qt4 \
+%if %{with qt4}
+install -d build-qt4
+cd build-qt4
+qmake-qt4 ../gegl-qt.pro \
        QMAKE_CXX="%{__cxx}" \
        QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
        QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \
        %{!?with_python:HAVE_PYSIDE=no}
 
 %{__make}
+cd ..
+ln -snf build-qt4 build
+%endif
+
+%if %{with qt5}
+install -d build-qt5
+cd build-qt5
+qmake-qt5 ../gegl-qt.pro \
+       QMAKE_CXX="%{__cxx}" \
+       QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
+       QMAKE_LFLAGS_RELEASE="%{rpmldflags}"
+
+%{__make}
+cd ..
+test -L build || ln -snf build-qt5 build
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
+%if %{with qt4}
+%{__make} -C build-qt4 install \
        INSTALL_ROOT=$RPM_BUILD_ROOT
 
 # extraneous symlink
@@ -121,6 +183,15 @@ rm -rf $RPM_BUILD_ROOT
 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
 %py_postclean
 %endif
+%endif
+
+%if %{with qt5}
+%{__make} -C build-qt5 install \
+       INSTALL_ROOT=$RPM_BUILD_ROOT
+
+# extraneous symlink
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgegl-qt5-0.1.so.0.0
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -128,6 +199,7 @@ rm -rf $RPM_BUILD_ROOT
 %post  -p /sbin/ldconfig
 %postun        -p /sbin/ldconfig
 
+%if %{with qt4}
 %files -n gegl-qt4
 %defattr(644,root,root,755)
 %doc README.txt
@@ -150,7 +222,27 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{py_sitedir}/gegl-qt4-0.1/geglqt.so
 %{py_sitedir}/pygeglqt4.py[co]
 %endif
+%endif
+
+%if %{with qt5}
+%files -n gegl-qt5
+%defattr(644,root,root,755)
+%doc README.txt
+%attr(755,root,root) %{_libdir}/libgegl-qt5-0.1.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libgegl-qt5-0.1.so.0
+%attr(755,root,root) %{_libdir}/gegl-0.2/libgegl-qt5-display.so
+# not ready for qt5 plugin format (_disabled in qt5 patch)
+#%dir %{_libdir}/qt4/imports/GeglQt4
+#%attr(755,root,root) %{_libdir}/qt4/imports/GeglQt4/libgegl-qt4-0.1.so
+#%{_libdir}/qt4/imports/GeglQt4/qmldir
+
+%files -n gegl-qt5-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgegl-qt5-0.1.so
+%{_includedir}/gegl-qt5-0.1
+%{_pkgconfigdir}/gegl-qt5-0.1.pc
+%endif
 
 %files apidocs
 %defattr(644,root,root,755)
-%doc doc/html/*
+%doc build/doc/html/*
This page took 0.116067 seconds and 4 git commands to generate.