[qscintilla] enable -qt5 support
Rex Dieter
rdieter at fedoraproject.org
Sun Jan 25 23:26:35 UTC 2015
commit e76762f288b0469c272729d667dcdd07d18b4168
Author: Rex Dieter <rdieter at math.unl.edu>
Date: Sun Jan 25 17:26:27 2015 -0600
enable -qt5 support
QScintilla-gpl-2.8.4-qt5.patch | 36 +++++++++++++++++++
qscintilla.spec | 75 +++++++++++++++++++++++++++++++++++-----
2 files changed, 102 insertions(+), 9 deletions(-)
---
diff --git a/QScintilla-gpl-2.8.4-qt5.patch b/QScintilla-gpl-2.8.4-qt5.patch
new file mode 100644
index 0000000..dcedbbc
--- /dev/null
+++ b/QScintilla-gpl-2.8.4-qt5.patch
@@ -0,0 +1,36 @@
+diff -up QScintilla-gpl-2.8.4/Qt4Qt5/features/qscintilla2.prf.qt5 QScintilla-gpl-2.8.4/Qt4Qt5/features/qscintilla2.prf
+--- QScintilla-gpl-2.8.4/Qt4Qt5/features/qscintilla2.prf.qt5 2014-09-11 12:15:15.000000000 -0500
++++ QScintilla-gpl-2.8.4/Qt4Qt5/features/qscintilla2.prf 2014-12-28 21:55:24.721885699 -0600
+@@ -17,9 +17,17 @@ CONFIG(debug, debug|release) {
+ win32: {
+ LIBS += -lqscintilla2d
+ } else {
++ greaterThan(QT_MAJOR_VERSION, 4) {
++ LIBS += -lqscintilla2-qt$${QT_MAJOR_VERSION}
++ } else {
+ LIBS += -lqscintilla2
+ }
++ }
+ }
+ } else {
++greaterThan(QT_MAJOR_VERSION, 4) {
++ LIBS += -lqscintilla2-qt$${QT_MAJOR_VERSION}
++} else {
+ LIBS += -lqscintilla2
+ }
++}
+diff -up QScintilla-gpl-2.8.4/Qt4Qt5/qscintilla.pro.qt5 QScintilla-gpl-2.8.4/Qt4Qt5/qscintilla.pro
+--- QScintilla-gpl-2.8.4/Qt4Qt5/qscintilla.pro.qt5 2014-09-11 12:15:15.000000000 -0500
++++ QScintilla-gpl-2.8.4/Qt4Qt5/qscintilla.pro 2014-12-28 21:13:49.164135542 -0600
+@@ -28,7 +28,11 @@
+ !win32:VERSION = 11.3.0
+
+ TEMPLATE = lib
++greaterThan(QT_MAJOR_VERSION, 4) {
++TARGET = qscintilla2-qt$${QT_MAJOR_VERSION}
++} else {
+ TARGET = qscintilla2
++}
+ CONFIG += qt warn_off release thread exceptions
+ INCLUDEPATH += . ../include ../lexlib ../src
+
diff --git a/qscintilla.spec b/qscintilla.spec
index 0520846..adc4ecc 100644
--- a/qscintilla.spec
+++ b/qscintilla.spec
@@ -5,14 +5,13 @@
# undef python macros if you'd like to build qscintilla sans -python subpkg (which requires PyQt4)
%global python 1
%global python3 1
-## experimental qt5 support, currently not packageable. Blockers include:
-# * libqscintilla soname conflicts with qt4 version, not parallel-installable
-#global qt5 1
+# experimental qt5 support
+%global qt5 1
Summary: A Scintilla port to Qt
Name: qscintilla
Version: 2.8.4
-Release: 1%{?dist}
+Release: 2%{?dist}
# matches up (pretty much) with qt4
License: GPLv3 or GPLv2 with exceptions
@@ -24,6 +23,8 @@ Source0: http://downloads.sf.net/pyqt/QScintilla-gpl-%{version}.tar.gz
%endif
## Upstreamable patches
+# make qt5 build parallel-installable
+Patch1: QScintilla-gpl-2.8.4-qt5.patch
BuildRequires: pkgconfig(QtDesigner) pkgconfig(QtGui) pkgconfig(QtScript) pkgconfig(QtXml)
%if 0%{?qt5}
@@ -92,16 +93,41 @@ Summary: A Scintilla port to Qt5
%package qt5-devel
Summary: QScintilla Development Files
-Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-qt5%{?_isa} = %{version}-%{release}
Requires: qt5-qtbase-devel
%description qt5-devel
%{summary}.
+
+%if 0%{?python3}
+%package -n python3-qscintilla-qt5
+Summary: QScintilla-qt5 python3 bindings
+BuildRequires: python3-qt5
+BuildRequires: python-qt5-devel
+BuildRequires: sip-devel >= 3.16
+Provides: %{name}-qt5-python3 = %{version}-%{release}
+Requires: %{name}-qt5%{?_isa} = %{version}-%{release}
+Requires: python3-qt5
+%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
+%description -n python3-qscintilla-qt5
+%{summary}.
+
+%package -n python3-qscintilla-qt5-devel
+Summary: Development files for QScintilla-qt5 python3 bindings
+Provides: %{name}-qt5-python3-devel = %{version}-%{release}
+Requires: python-qt5-devel
+BuildArch: noarch
+%description -n python3-qscintilla-qt5-devel
+%{summary}.
+
+%endif
%endif
%prep
%setup -n QScintilla-gpl-%{version}%{?snap:-snapshot-%{snap}}
+%patch1 -p1 -b .qt5
+
%build
PATH=%{_qt4_bindir}:$PATH; export PATH
@@ -152,18 +178,32 @@ PATH=%{_qt5_bindir}:$PATH; export PATH
cp -a Qt4Qt5 Qt5/
pushd Qt5
-%{_qt5_qmake} qscintilla.pro
+%{qmake_qt5} qscintilla.pro
make %{?_smp_mflags}
popd
cp -a designer-Qt4Qt5 designer-Qt5/
pushd designer-Qt5
QMAKEFEATURES=../Qt5/features \
-%{_qt5_qmake} designer.pro INCLUDEPATH+=../Qt5 LIBS+=-L../Qt5
+%{qmake_qt5} designer.pro INCLUDEPATH+=../Qt5 LIBS+=-L../Qt5
+make %{?_smp_mflags}
+popd
+
+%if 0%{?python3}
+cp -a Python Python3-qt5
+pushd Python3-qt5
+QMAKEFEATURES=../Qt5/features \
+%{__python3} \
+ configure.py \
+ --no-timestamp \
+ --pyqt=PyQt5 --qsci-incdir=../Qt5 --qsci-libdir=../Qt5
+
make %{?_smp_mflags}
popd
%endif
+%endif
+
%install
make -C Qt4 install INSTALL_ROOT=%{buildroot}
@@ -182,6 +222,11 @@ chmod a+x %{buildroot}%{python3_sitearch}/PyQt4/Qsci.so
%if 0%{?qt5}
make -C Qt5 install INSTALL_ROOT=%{buildroot}
make -C designer-Qt5 install INSTALL_ROOT=%{buildroot}
+%if 0%{?python3}
+make -C Python3-qt5 install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot}
+test -x %{buildroot}%{python3_sitearch}/PyQt5/Qsci.so || \
+chmod a+x %{buildroot}%{python3_sitearch}/PyQt5/Qsci.so
+%endif
%endif
%if !0%{?python} && !0%{?python3}
@@ -241,19 +286,31 @@ test -x %{buildroot}%{python2_sitearch}/PyQt4/Qsci.so
%doc NEWS README
%doc LICENSE.GPL3 LICENSE.GPL2
%doc GPL_EXCEPTION.TXT GPL_EXCEPTION_ADDENDUM.TXT
-%{_qt5_libdir}/libqscintilla2.so.11*
+%{_qt5_libdir}/libqscintilla2-qt5.so.11*
%{_qt5_plugindir}/designer/libqscintillaplugin.so
%{_qt5_translationdir}/*
%files qt5-devel
%doc doc/html-Qt4Qt5 doc/Scintilla example-Qt4Qt5
%{_qt5_headerdir}/Qsci/
-%{_qt5_libdir}/libqscintilla2.so
+%{_qt5_libdir}/libqscintilla2-qt5.so
%{_qt5_datadir}/mkspecs/features/qscintilla2.prf
+
+%if 0%{?python3}
+%files -n python3-qscintilla-qt5
+%{python3_sitearch}/PyQt5/Qsci.so
+%{_qt5_datadir}/qsci/
+
+%files -n python3-qscintilla-qt5-devel
+%{_datadir}/sip/PyQt5/Qsci/
+%endif
%endif
%changelog
+* Sun Dec 28 2014 Rex Dieter <rdieter at fedoraproject.org> 2.8.4-2
+- enable -qt5 support
+
* Mon Sep 15 2014 Rex Dieter <rdieter at fedoraproject.org> 2.8.4-1
- QScintiall-2.8.4
More information about the scm-commits
mailing list