From d7dc8e14c1e4b8430a9a2c45ac653aad426d5b55 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 18 Nov 2014 17:38:05 +0100 Subject: [PATCH] - added qt5 patch to fix PyQt5 module build - adjusted naming scheme to support multi-qt, multi-python packaging: base gets -qt4/-qt5 suffix python-qscintilla2 becomes python*-PyQt*-qscintilla2 python-qscintilla2-devel becomes sip-PyQt*-qscintilla2 --- qscintilla2-outoftree.patch | 4 +- qscintilla2-qt5.patch | 11 ++ qscintilla2.spec | 337 ++++++++++++++++++++++++++++++------ 3 files changed, 299 insertions(+), 53 deletions(-) create mode 100644 qscintilla2-qt5.patch diff --git a/qscintilla2-outoftree.patch b/qscintilla2-outoftree.patch index fe3c21c..64d5a17 100644 --- a/qscintilla2-outoftree.patch +++ b/qscintilla2-outoftree.patch @@ -1,5 +1,5 @@ ---- ../BUILD/QScintilla-gpl-2.8.4/Python/configure.py.orig 2014-11-04 16:22:47.229532126 +0100 -+++ ../BUILD/QScintilla-gpl-2.8.4/Python/configure.py 2014-11-07 22:03:55.811128882 +0100 +--- QScintilla-gpl-2.8.4/Python/configure.py.orig 2014-11-04 16:22:47.229532126 +0100 ++++ QScintilla-gpl-2.8.4/Python/configure.py 2014-11-07 22:03:55.811128882 +0100 @@ -278,7 +278,7 @@ return None diff --git a/qscintilla2-qt5.patch b/qscintilla2-qt5.patch new file mode 100644 index 0000000..eb5e073 --- /dev/null +++ b/qscintilla2-qt5.patch @@ -0,0 +1,11 @@ +--- QScintilla-gpl-2.8.4/Python/configure.py.orig 2014-11-12 22:27:21.379600943 +0100 ++++ QScintilla-gpl-2.8.4/Python/configure.py 2014-11-13 18:23:22.469922749 +0100 +@@ -289,7 +289,7 @@ + version of Qt. target_configuration is the target configuration. + """ + +- qmake = {'CONFIG': 'qscintilla2'} ++ qmake = {'CONFIG': 'qscintilla2', 'Qt5:QT': 'widgets printsupport'} + + if target_configuration.qsci_inc_dir is not None: + qmake['INCLUDEPATH'] = quote(target_configuration.qsci_inc_dir) diff --git a/qscintilla2.spec b/qscintilla2.spec index 7573ba1..576407b 100644 --- a/qscintilla2.spec +++ b/qscintilla2.spec @@ -3,7 +3,6 @@ # - fix building with qscintilla2(-devel) installed, remove BC # - how to successfully prepend -I../Qt4Qt5 before system qt include in qmake? # - QScintilla2 for Qt3 (does it make any sense nowadays?) -# - QScintilla2 for Qt5 # # Conditonal build: %bcond_without python2 # CPython 2.x module @@ -13,6 +12,8 @@ %define scintilla_ver 3.3.6 %define sip_ver 4.16 +%define pyqt4_ver 4.8.2 +%define pyqt5_ver 5.0 Summary: QScintilla2 - a port to Qt of the Scintilla editing component Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt Name: qscintilla2 @@ -26,13 +27,12 @@ Patch0: %{name}-internal_build.patch Patch1: %{name}-multiqt.patch Patch2: %{name}-make.patch Patch3: %{name}-outoftree.patch +Patch4: %{name}-qt5.patch URL: http://www.riverbankcomputing.co.uk/software/qscintilla/ %if %{with python2} -BuildRequires: python-PyQt4-devel >= 4.8.2 BuildRequires: python-sip-devel >= 2:%{sip_ver} %endif %if %{with python3} -BuildRequires: python3-PyQt4-devel >= 4.8.2 BuildRequires: python3-sip-devel >= 2:%{sip_ver} %endif BuildRequires: rpm-pythonprov @@ -42,12 +42,28 @@ BuildRequires: QtDesigner-devel >= 4.8 BuildRequires: QtGui-devel >= 4.8 BuildRequires: qt4-build >= 4.8 BuildRequires: qt4-qmake >= 4.8 +BuildRequires: sip-PyQt4 >= %{pyqt4_ver} +%if %{with python2} +BuildRequires: python-PyQt4 >= %{pyqt4_ver} +%endif +%if %{with python3} +BuildRequires: python3-PyQt4 >= %{pyqt4_ver} +%endif %endif %if %{with qt5} BuildRequires: Qt5Designer-devel >= 5 BuildRequires: Qt5Gui-devel >= 5 +BuildRequires: Qt5PrintSupport-devel >= 5 +BuildRequires: Qt5Widgets-devel >= 5 BuildRequires: qt5-build >= 5 BuildRequires: qt5-qmake >= 5 +BuildRequires: sip-PyQt5 >= %{pyqt5_ver} +%if %{with python2} +BuildRequires: python-PyQt5 >= %{pyqt5_ver} +%endif +%if %{with python3} +BuildRequires: python3-PyQt5 >= %{pyqt5_ver} +%endif %endif BuildConflicts: qscintilla2-devel BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -62,62 +78,210 @@ This version of QScintilla is based on Scintilla v%{scintilla_ver}. QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt. Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}. -%package devel -Summary: Development files for the QScintilla2 -Summary(pl.UTF-8): Pliki nagłówkowe dla komponentu QScintilla2 +%package apidocs +Summary: QScintilla2 API documentation +Summary(pl.UTF-8): Dokumentacja API biblioteki QScintilla2 +Group: Documentation + +%description apidocs +QScintilla2 API documentation. + +%description apidocs -l pl.UTF-8 +Dokumentacja API biblioteki QScintilla2. + +%package qt4 +Summary: QScintilla2 - a port to Qt 4 of the Scintilla editing component +Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 4 +Group: X11/Libraries +Requires: %{name}-common = %{version}-%{release} +%ifarch %{x8664} ppc64 s390x sparc64 +Provides: libqscintilla2.so.11()(64bit) +%else +Provides: libqscintilla2.so.11 +%endif +Obsoletes: qscintilla2 < 2.8.4 + +%description qt4 +QScintilla2 is a port to Qt of the Scintilla editing component. +This version of QScintilla is based on Scintilla v%{scintilla_ver}. + +This package contains the Qt 4 port. + +%description qt4 -l pl.UTF-8 +QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt. +Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}. + +Ten pakiet zawiera port Qt 4. + +%package qt4-devel +Summary: Development files for the QScintilla2 Qt 4 library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 4 Group: X11/Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires: QtGui-devel +Requires: %{name}-qt4 = %{version}-%{release} +Requires: QtGui-devel >= 4 +Obsoletes: qscintilla2-devel < 2.8.4 -%description devel +%description qt4-devel This package contains the header files necessary to develop -applications using QScintilla2. +applications using QScintilla2 for Qt 4. -%description devel -l pl.UTF-8 +%description qt4-devel -l pl.UTF-8 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z -użyciem komponentu QScintilla2. +użyciem komponentu QScintilla2 dla Qt 4. %package -n QtDesigner-plugin-%{name} Summary: QScintilla2 plugin for Qt Designer Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera Group: X11/Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires: QtDesigner +Requires: %{name}-qt4 = %{version}-%{release} +Requires: QtDesigner >= 4 %description -n QtDesigner-plugin-%{name} QScintilla2 plugin for Qt Designer that allows QScintilla instances to be included in GUI designs just like any other Qt widget. +This package contains the Qt 4 version. + %description -n QtDesigner-plugin-%{name} -l pl.UTF-8 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety Qt. -%package -n python-%{name} -Summary: Python bindings for the QScintilla2 -Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 +Ten pakiet zawiera wersję dla Qt 4. + +%package -n sip-PyQt4-%{name} +Summary: Python bindings for the QScintilla2 - SIP development files +Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP +Group: Development/Languages/Python +Requires: sip-PyQt4 >= %{pyqt4_ver} +Obsoletes: python-qscintilla2-devel < 2.8.4 + +%description -n sip-PyQt4-%{name} +Python bindings for the QScintilla2 - SIP development files. + +%description -n sip-PyQt4-%{name} -l pl.UTF-8 +Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne +SIP. + +%package -n python-PyQt4-%{name} +Summary: Python 2 bindings for the QScintilla2 (PyQt4 version) +Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4) Group: Libraries/Python -Requires: %{name} = %{version}-%{release} +Requires: %{name}-qt4 = %{version}-%{release} %requires_ge python-PyQt4 +Obsoletes: python-qscintilla2 < 2.8.4 + +%description -n python-PyQt4-%{name} +Python 2 bindings for the QScintilla2 (PyQt4 version). + +%description -n python-PyQt4-%{name} -l pl.UTF-8 +Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4). + +%package -n python3-PyQt4-%{name} +Summary: Python 3 bindings for the QScintilla2 (PyQt4 version) +Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4) +Group: Libraries/Python +Requires: %{name}-qt4 = %{version}-%{release} +%requires_ge python3-PyQt4 + +%description -n python3-PyQt4-%{name} +Python 3 bindings for the QScintilla2 (PyQt4 version). + +%description -n python3-PyQt4-%{name} -l pl.UTF-8 +Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4). + +%package qt5 +Summary: QScintilla2 - a port to Qt 5 of the Scintilla editing component +Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 5 +Group: X11/Libraries +Requires: %{name}-common = %{version}-%{release} + +%description qt5 +QScintilla2 is a port to Qt of the Scintilla editing component. +This version of QScintilla is based on Scintilla v%{scintilla_ver}. + +This package contains the Qt 5 port. + +%description qt5 -l pl.UTF-8 +QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt. +Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}. + +Ten pakiet zawiera port Qt 5. + +%package qt5-devel +Summary: Development files for the QScintilla2 Qt 5 library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 5 +Group: X11/Development/Libraries +Requires: %{name}-qt5 = %{version}-%{release} +Requires: Qt5Gui-devel >= 5 +Obsoletes: qscintilla2-devel < 2.8.4 + +%description qt5-devel +This package contains the header files necessary to develop +applications using QScintilla2 for Qt 5. + +%description qt5-devel -l pl.UTF-8 +Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z +użyciem komponentu QScintilla2 dla Qt 5. + +%package -n Qt5Designer-plugin-%{name} +Summary: QScintilla2 plugin for Qt Designer +Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera +Group: X11/Development/Libraries +Requires: %{name}-qt5 = %{version}-%{release} +Requires: Qt5Designer >= 5 + +%description -n Qt5Designer-plugin-%{name} +QScintilla2 plugin for Qt Designer that allows QScintilla instances +to be included in GUI designs just like any other Qt widget. + +This package contains the Qt 5 version. -%description -n python-%{name} -Python bindings for the QScintilla2. +%description -n Qt5Designer-plugin-%{name} -l pl.UTF-8 +Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie +instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety +Qt. -%description -n python-%{name} -l pl.UTF-8 -Wiązania Pythona dla komponentu QScintilla2. +Ten pakiet zawiera wersję dla Qt 5. -%package -n python-%{name}-devel -Summary: Python bindings for the QScintilla2 - development files -Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne +%package -n sip-PyQt5-%{name} +Summary: Python bindings for the QScintilla2 - SIP development files +Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP Group: Development/Languages/Python -Requires: python-%{name} = %{version}-%{release} -Requires: python-PyQt4-devel >= 4.8.2 +Requires: sip-PyQt5 >= %{pyqt5_ver} + +%description -n sip-PyQt5-%{name} +Python bindings for the QScintilla2 - SIP development files. -%description -n python-%{name}-devel -Python bindings for the QScintilla2 - development files. +%description -n sip-PyQt5-%{name} -l pl.UTF-8 +Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne +SIP. -%description -n python-%{name}-devel -l pl.UTF-8 -Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne. +%package -n python-PyQt5-%{name} +Summary: Python 2 bindings for the QScintilla2 (PyQt5 version) +Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5) +Group: Libraries/Python +Requires: %{name}-qt5 = %{version}-%{release} +%requires_ge python-PyQt5 + +%description -n python-PyQt5-%{name} +Python 2 bindings for the QScintilla2 (PyQt5 version). + +%description -n python-PyQt5-%{name} -l pl.UTF-8 +Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5). + +%package -n python3-PyQt5-%{name} +Summary: Python 3 bindings for the QScintilla2 (PyQt5 version) +Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5) +Group: Libraries/Python +Requires: %{name}-qt5 = %{version}-%{release} +%requires_ge python3-PyQt5 + +%description -n python3-PyQt5-%{name} +Python 3 bindings for the QScintilla2 (PyQt5 version). + +%description -n python3-PyQt5-%{name} -l pl.UTF-8 +Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5). %prep %setup -q -n QScintilla-gpl-%{version} @@ -125,6 +289,7 @@ Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do @@ -147,7 +312,8 @@ PATH=%{_libdir}/${qt}/bin:$PATH \ -c -j 3 \ -n ../../Qt4Qt5 \ -o ../Qt4Qt5 \ - --apidir=%{_datadir}/${qt}/qsci + --apidir=%{_datadir}/${qt}/qsci \ + --pyqt=PyQt${qt#qt} %{__make} cd .. %endif @@ -159,7 +325,8 @@ PATH=%{_libdir}/${qt}/bin:$PATH \ -c -j 3 \ -n ../../Qt4Qt5 \ -o ../Qt4Qt5 \ - --apidir=%{_datadir}/${qt}/qsci + --apidir=%{_datadir}/${qt}/qsci \ + --pyqt=PyQt${qt#qt} %{__make} cd .. %endif @@ -168,7 +335,6 @@ done %install rm -rf $RPM_BUILD_ROOT -#install -d $RPM_BUILD_ROOT%{_datadir}/qt5/qsci/api for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do %{__make} -C build-${qt}/Qt4Qt5 install \ @@ -185,6 +351,11 @@ for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do %endif done +# unnecessary symlink +%{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.11.3 + +%if %{with qt4} +# move Qt4 translations to PLD-specific directory scheme for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm do lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'` @@ -193,20 +364,32 @@ do mv -f $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm done -# unnecessary symlink -%{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11.3 +# compatibility symlinks +ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11 +ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so +%endif %clean rm -rf $RPM_BUILD_ROOT -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%post qt4 -p /sbin/ldconfig +%postun qt4 -p /sbin/ldconfig + +%post qt5 -p /sbin/ldconfig +%postun qt5 -p /sbin/ldconfig -%files +%files apidocs +%defattr(644,root,root,755) +%doc doc/{Scintilla,html-Qt4Qt5} + +%if %{with qt4} +%files qt4 %defattr(644,root,root,755) %doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README -%attr(755,root,root) %{_libdir}/libqscintilla2.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libqscintilla2.so.11 +%attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt4.so.11 +# compatibility symlink +%attr(755,root,root) %{_libdir}/libqscintilla2.so.11 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm @@ -214,12 +397,14 @@ rm -rf $RPM_BUILD_ROOT %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm %dir %{_datadir}/qt4/qsci %dir %{_datadir}/qt4/qsci/api -%dir %{_datadir}/qt5/qsci -%dir %{_datadir}/qt5/qsci/api +%dir %{_datadir}/qt4/qsci/api/python +%{_datadir}/qt4/qsci/api/python/Python-*.api +%{_datadir}/qt4/qsci/api/python/QScintilla2.api -%files devel +%files qt4-devel %defattr(644,root,root,755) -%doc doc/Scintilla/* +%attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so +# compatibility symlink %attr(755,root,root) %{_libdir}/libqscintilla2.so %{_includedir}/qt4/Qsci %{_datadir}/qt4/mkspecs/features/qscintilla2.prf @@ -228,13 +413,63 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so -%files -n python-%{name} +%files -n sip-PyQt4-%{name} +%defattr(644,root,root,755) +%{_sipfilesdir}/PyQt4/Qsci + +%if %{with python2} +%files -n python-PyQt4-%{name} %defattr(644,root,root,755) %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so -%dir %{_datadir}/qt4/qsci/api/python -%{_datadir}/qt4/qsci/api/python/Python-*.api -%{_datadir}/qt4/qsci/api/python/QScintilla2.api +%endif -%files -n python-%{name}-devel +%if %{with python3} +%files -n python3-PyQt4-%{name} %defattr(644,root,root,755) -%{_sipfilesdir}/PyQt4/Qsci +%attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so +%endif +%endif + +%if %{with qt5} +%files qt5 +%defattr(644,root,root,755) +%doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README +%attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt5.so.11 +%lang(cs) %{_datadir}/qt5/translations/qscintilla_cs.qm +%lang(de) %{_datadir}/qt5/translations/qscintilla_de.qm +%lang(es) %{_datadir}/qt5/translations/qscintilla_es.qm +%lang(fr) %{_datadir}/qt5/translations/qscintilla_fr.qm +%lang(pt_BR) %{_datadir}/qt5/translations/qscintilla_pt_br.qm +%dir %{_datadir}/qt5/qsci +%dir %{_datadir}/qt5/qsci/api +%dir %{_datadir}/qt5/qsci/api/python +%{_datadir}/qt5/qsci/api/python/Python-*.api +%{_datadir}/qt5/qsci/api/python/QScintilla2.api + +%files qt5-devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so +%{_includedir}/qt5/Qsci +%{_datadir}/qt5/mkspecs/features/qscintilla2.prf + +%files -n Qt5Designer-plugin-%{name} +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so + +%files -n sip-PyQt5-%{name} +%defattr(644,root,root,755) +%{_sipfilesdir}/PyQt5/Qsci + +%if %{with python2} +%files -n python-PyQt5-%{name} +%defattr(644,root,root,755) +%attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so +%endif + +%if %{with python3} +%files -n python3-PyQt5-%{name} +%defattr(644,root,root,755) +%attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so +%endif +%endif -- 2.44.0