--- /dev/null
+--- QScintilla-gpl-2.8.4/Qt4Qt5/qscintilla.pro.orig 2014-09-11 19:15:15.000000000 +0200
++++ QScintilla-gpl-2.8.4/Qt4Qt5/qscintilla.pro 2014-11-03 20:11:22.685915741 +0100
+@@ -28,7 +28,7 @@
+ !win32:VERSION = 11.3.0
+
+ TEMPLATE = lib
+-TARGET = qscintilla2
++TARGET = qscintilla2-qt$$QT_MAJOR_VERSION
+ CONFIG += qt warn_off release thread exceptions
+ INCLUDEPATH += . ../include ../lexlib ../src
+
+--- QScintilla-gpl-2.8.4/Qt4Qt5/features/qscintilla2.prf.orig 2014-09-11 19:15:15.000000000 +0200
++++ QScintilla-gpl-2.8.4/Qt4Qt5/features/qscintilla2.prf 2014-11-03 20:35:52.655854645 +0100
+@@ -6,20 +6,22 @@
+ }
+ }
+
++QTSUF = -qt$QT_MAJOR_VERSION
++
+ INCLUDEPATH += $$[QT_INSTALL_HEADERS]
+
+ LIBS += -L$$[QT_INSTALL_LIBS]
+
+ CONFIG(debug, debug|release) {
+ mac: {
+- LIBS += -lqscintilla2_debug
++ LIBS += -lqscintilla2$$[QTSUF]_debug
+ } else {
+ win32: {
+- LIBS += -lqscintilla2d
++ LIBS += -lqscintilla2$$[QTSUF]d
+ } else {
+- LIBS += -lqscintilla2
++ LIBS += -lqscintilla2$$[QTSUF]
+ }
+ }
+ } else {
+- LIBS += -lqscintilla2
++ LIBS += -lqscintilla2$$[QTSUF]
+ }
--- /dev/null
+--- ../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
+@@ -278,7 +278,7 @@
+ return None
+
+ path = os.path.join(target_configuration.qsci_sip_dir, 'Qsci')
+- files = glob.glob('sip/*.sip')
++ files = glob.glob(os.path.join(target_configuration.src_dir, 'sip/*.sip'))
+
+ return path, files
+
+@@ -1257,7 +1257,7 @@
+ argv.append('-c')
+ argv.append('.')
+
+- argv.append(module_config.get_sip_file(target_config))
++ argv.append(os.path.join(target_config.src_dir, module_config.get_sip_file(target_config)))
+
+ check_file = 'sipAPI%s.h' % module_config.name
+ _remove_file(check_file)
+@@ -1611,8 +1611,11 @@
+ line arguments. module_config is the module configuration.
+ """
+
++ src_dir = os.path.dirname(os.path.abspath(__file__))
++
+ # Create the default target configuration.
+ target_config = _TargetConfiguration(module_config)
++ target_config.src_dir = src_dir
+
+ # Parse the command line.
+ p = _create_optparser(target_config, module_config)
#
# TODO:
# - 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
#
-%define scintilla_ver 3.2.3
+# Conditonal build:
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+%bcond_without qt4 # Qt4 library and modules
+%bcond_without qt5 # Qt5 library and modules
+
+%define scintilla_ver 3.3.6
+%define sip_ver 4.16
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
-Version: 2.8
-Release: 2
+Version: 2.8.4
+Release: 1
License: GPL v2 or GPL v3 with Riverbank GPL Exception v1.1
Group: X11/Libraries
Source0: http://downloads.sourceforge.net/pyqt/QScintilla-gpl-%{version}.tar.gz
-# Source0-md5: 02c406d8cd5db661f127303e91775c0b
+# Source0-md5: 28aec903ff48ae541295a4fb9c96f8ea
Patch0: %{name}-internal_build.patch
+Patch1: %{name}-multiqt.patch
+Patch2: %{name}-make.patch
+Patch3: %{name}-outoftree.patch
URL: http://www.riverbankcomputing.co.uk/software/qscintilla/
-BuildRequires: QtDesigner-devel
-BuildRequires: QtGui-devel
+%if %{with python2}
BuildRequires: python-PyQt4-devel >= 4.8.2
-BuildRequires: python-sip-devel >= 2:4.14
-BuildRequires: qt4-build >= 4.8
-BuildRequires: qt4-qmake >= 4.8
+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
BuildRequires: rpmbuild(macros) >= 1.558
-BuildConflicts: qscintilla2
+%if %{with qt4}
+BuildRequires: QtDesigner-devel >= 4.8
+BuildRequires: QtGui-devel >= 4.8
+BuildRequires: qt4-build >= 4.8
+BuildRequires: qt4-qmake >= 4.8
+%endif
+%if %{with qt5}
+BuildRequires: Qt5Designer-devel >= 5
+BuildRequires: Qt5Gui-devel >= 5
+BuildRequires: qt5-build >= 5
+BuildRequires: qt5-qmake >= 5
+%endif
+BuildConflicts: qscintilla2-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sipfilesdir %{_datadir}/sip
Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2
Group: Libraries/Python
Requires: %{name} = %{version}-%{release}
-%requires_ge python-PyQt4
+%requires_ge python-PyQt4
%description -n python-%{name}
Python bindings for the QScintilla2.
%prep
%setup -q -n QScintilla-gpl-%{version}
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
%build
-cd Qt4Qt5
-qmake-qt4 qscintilla.pro
+for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
+install -d build-${qt}/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
+cd build-${qt}/Qt4Qt5
+qmake-${qt} ../../Qt4Qt5/qscintilla.pro
%{__make}
-cd -
-
-cd designer-Qt4Qt5
-qmake-qt4 designer.pro
+cd ../designer-Qt4Qt5
+qmake-${qt} ../../designer-Qt4Qt5/designer.pro
%{__make}
-cd -
+cd ..
-cd Python
+%if %{with python2}
+cd Python2
# setup PATH to get proper qmake
# pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
-PATH=%{_libdir}/qt4/bin:$PATH \
-%{__python} configure.py \
+PATH=%{_libdir}/${qt}/bin:$PATH \
+%{__python} ../../Python/configure.py \
+ --verbose \
-c -j 3 \
- -n ../Qt4Qt5 \
+ -n ../../Qt4Qt5 \
-o ../Qt4Qt5 \
- --apidir=%{_datadir}/qt4/qsci
+ --apidir=%{_datadir}/${qt}/qsci
%{__make}
-cd -
+cd ..
+%endif
+%if %{with python3}
+cd Python3
+PATH=%{_libdir}/${qt}/bin:$PATH \
+%{__python3} ../../Python/configure.py \
+ --verbose \
+ -c -j 3 \
+ -n ../../Qt4Qt5 \
+ -o ../Qt4Qt5 \
+ --apidir=%{_datadir}/${qt}/qsci
+%{__make}
+cd ..
+%endif
+cd ..
+done
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_datadir}/qt5/qsci/api
+#install -d $RPM_BUILD_ROOT%{_datadir}/qt5/qsci/api
-%{__make} -C Qt4Qt5 install \
+for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
+%{__make} -C build-${qt}/Qt4Qt5 install \
INSTALL_ROOT=$RPM_BUILD_ROOT
-%{__make} -C designer-Qt4Qt5 install \
+%{__make} -C build-${qt}/designer-Qt4Qt5 install \
INSTALL_ROOT=$RPM_BUILD_ROOT
-%{__make} -C Python install \
+%if %{with python3}
+%{__make} -C build-${qt}/Python3 install \
INSTALL_ROOT=$RPM_BUILD_ROOT
+%endif
+%if %{with python2}
+%{__make} -C build-${qt}/Python2 install \
+ INSTALL_ROOT=$RPM_BUILD_ROOT
+%endif
+done
for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
do
done
# unnecessary symlink
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11.0
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11.3
%clean
rm -rf $RPM_BUILD_ROOT
%lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
%lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
%lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
-%lang(ru) %{_datadir}/locale/ru/LC_MESSAGES/qscintilla2.qm
%dir %{_datadir}/qt4/qsci
%dir %{_datadir}/qt4/qsci/api
%dir %{_datadir}/qt5/qsci
%doc doc/Scintilla/*
%attr(755,root,root) %{_libdir}/libqscintilla2.so
%{_includedir}/qt4/Qsci
+%{_datadir}/qt4/mkspecs/features/qscintilla2.prf
%files -n QtDesigner-plugin-%{name}
%defattr(644,root,root,755)