[packages/qscintilla2] - now that we have a working version of PyQt4 package, we can build python support again here - fixe

baggins baggins at pld-linux.org
Sun Oct 6 11:43:52 CEST 2019


commit 7f136b4ddf8e960442d4e76389aa4ec53ac0a5c1
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Oct 6 11:41:24 2019 +0200

    - now that we have a working version of PyQt4 package, we can build python support again here
    - fixed configure script to get sip built and installed correctly
    - rel 2

 py-config.patch        |  18 +++++++
 python-install.patch   |  12 +++++
 qscintilla2-link.patch |  16 ------
 qscintilla2.spec       | 129 +++++++++++++------------------------------------
 4 files changed, 64 insertions(+), 111 deletions(-)
---
diff --git a/qscintilla2.spec b/qscintilla2.spec
index 56fa08d..b272d23 100644
--- a/qscintilla2.spec
+++ b/qscintilla2.spec
@@ -3,22 +3,20 @@
 #   - how to successfully prepend -I../Qt4Qt5 before system qt include in qmake?
 #
 # Conditonal build:
-%bcond_with	python2	# CPython 2.x module
-%bcond_with	python3	# CPython 3.x module
+%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
-%bcond_without	pyqt4	# PyQt4 modules
-%bcond_without	pyqt5	# PyQt5 modules
 
 %define		scintilla_ver	3.3.6
 %define		sip_ver		4.19
-%define		pyqt4_ver	4.12
+%define		pyqt4_ver	1:4.12.1
 %define		pyqt5_ver	5.7.1
 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.11.2
-Release:	1
+Release:	2
 License:	GPL v3
 Group:		X11/Libraries
 Source0:	https://www.riverbankcomputing.com/static/Downloads/QScintilla/%{version}/QScintilla_gpl-%{version}.tar.gz
@@ -26,7 +24,7 @@ Source0:	https://www.riverbankcomputing.com/static/Downloads/QScintilla/%{versio
 Patch0:		%{name}-internal_build.patch
 Patch3:		%{name}-outoftree.patch
 Patch4:		%{name}-qt5.patch
-Patch5:		%{name}-link.patch
+Patch5:		py-config.patch
 Patch6:		python-install.patch
 Patch7:		sip-check.patch
 Patch8:		missing-header.patch
@@ -301,130 +299,67 @@ Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
 %patch8 -p1
 
 %build
-%if %{with qt4}
-install -d build-qt4/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
-cd build-qt4/Qt4Qt5
-qmake-qt4 ../../Qt4Qt5/qscintilla.pro
-%{__make}
-cd ../designer-Qt4Qt5
-qmake-qt4 ../../designer-Qt4Qt5/designer.pro
-%{__make}
-cd ..
-
-%if %{with pyqt4}
-%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} ../../Python/configure.py \
-	--verbose \
-	-c -j 3 \
-	-n ../../Qt4Qt5 \
-	-o ../Qt4Qt5 \
-	--apidir=%{_datadir}/qt4/qsci \
-	--pyqt=PyQt4
-%{__make}
-cd ..
-%endif
-%if %{with python3}
-cd Python3
-PATH=%{_libdir}/qt4/bin:$PATH \
-%{__python3} ../../Python/configure.py \
-	--verbose \
-	-c -j 3 \
-	-n ../../Qt4Qt5 \
-	-o ../Qt4Qt5 \
-	--apidir=%{_datadir}/qt4/qsci \
-	--pyqt=PyQt4
-%{__make}
-cd ..
-%endif
-%endif
-cd ..
-%endif
-
-# Qt5
-%if %{with qt5}
-install -d build-qt5/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
-cd build-qt5/Qt4Qt5
-qmake-qt5 ../../Qt4Qt5/qscintilla.pro \
-	QMAKE_MKSPECS=%{_libdir}/qt5/mkspecs
+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 \
+	$(test "$qt" = "qt4" || echo QMAKE_MKSPECS=%{_libdir}/$qt/mkspecs)
 %{__make}
 cd ../designer-Qt4Qt5
-qmake-qt5 ../../designer-Qt4Qt5/designer.pro
+qmake-${qt} ../../designer-Qt4Qt5/designer.pro
 %{__make}
 cd ..
 
-%if %{with pyqt5}
 %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}/qt5/bin:$PATH \
+PATH=%{_libdir}/${qt}/bin:$PATH \
 %{__python} ../../Python/configure.py \
 	--verbose \
-	-c -j 3 \
+	--concatenate \
+	--concatenate-split 3 \
 	-n ../../Qt4Qt5 \
 	-o ../Qt4Qt5 \
-	--apidir=%{_datadir}/qt5/qsci \
-	--pyqt=PyQt5
+	--apidir=%{_datadir}/${qt}/qsci \
+	--pyqt=PyQt${qt#qt}
 %{__make}
 cd ..
 %endif
 %if %{with python3}
 cd Python3
-PATH=%{_libdir}/qt5/bin:$PATH \
+PATH=%{_libdir}/${qt}/bin:$PATH \
 %{__python3} ../../Python/configure.py \
 	--verbose \
-	-c -j 3 \
+	--concatenate \
+	--concatenate-split 3 \
 	-n ../../Qt4Qt5 \
 	-o ../Qt4Qt5 \
-	--apidir=%{_datadir}/qt5/qsci \
-	--pyqt=PyQt5
+	--apidir=%{_datadir}/${qt}/qsci \
+	--pyqt=PyQt${qt#qt}
 %{__make}
 cd ..
 %endif
-%endif
 cd ..
-%endif
+done
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with qt4}
-%{__make} -C build-qt4/Qt4Qt5 install \
+for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
+%{__make} -j1 -C build-${qt}/Qt4Qt5 install \
 	INSTALL_ROOT=$RPM_BUILD_ROOT
-%{__make} -C build-qt4/designer-Qt4Qt5 install \
+%{__make} -j1 -C build-${qt}/designer-Qt4Qt5 install \
 	INSTALL_ROOT=$RPM_BUILD_ROOT
-%if %{with pyqt4}
 %if %{with python3}
-%{__make} -C build-${qt4/Python3 install \
+%{__make} -j1 -C build-${qt}/Python3 install \
 	INSTALL_ROOT=$RPM_BUILD_ROOT
 %endif
 %if %{with python2}
-%{__make} -C build-${qt4/Python2 install \
+%{__make} -j1 -C build-${qt}/Python2 install \
 	INSTALL_ROOT=$RPM_BUILD_ROOT
 %endif
-%endif
-%endif
-
-%if %{with qt5}
-%{__make} -C build-qt5/Qt4Qt5 install \
-	INSTALL_ROOT=$RPM_BUILD_ROOT
-%{__make} -C build-qt5/designer-Qt4Qt5 install \
-	INSTALL_ROOT=$RPM_BUILD_ROOT
-%if %{with pyqt5}
-%if %{with python3}
-%{__make} -C build-qt5/Python3 install \
-	INSTALL_ROOT=$RPM_BUILD_ROOT
-%endif
-%if %{with python2}
-%{__make} -C build-qt5/Python2 install \
-	INSTALL_ROOT=$RPM_BUILD_ROOT
-%endif
-%endif
-%endif
+done
 
 # unnecessary symlink
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.15.0
@@ -468,7 +403,7 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_datadir}/qt4/qsci/api
 %dir %{_datadir}/qt4/qsci/api/python
 %{_datadir}/qt4/qsci/api/python/Python-*.api
-#%{_datadir}/qt4/qsci/api/python/QScintilla2.api
+%{_datadir}/qt4/qsci/api/python/QScintilla2.api
 
 %files qt4-devel
 %defattr(644,root,root,755)
@@ -490,12 +425,14 @@ rm -rf $RPM_BUILD_ROOT
 %files -n python-PyQt4-%{name}
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
+%{py_sitedir}/PyQt4/Qsci.pyi
 %endif
 
 %if %{with python3}
 %files -n python3-PyQt4-%{name}
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
+%{py3_sitedir}/PyQt4/Qsci.pyi
 %endif
 %endif
 
@@ -514,7 +451,7 @@ rm -rf $RPM_BUILD_ROOT
 %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
+%{_datadir}/qt5/qsci/api/python/QScintilla2.api
 
 %files qt5-devel
 %defattr(644,root,root,755)
@@ -536,11 +473,13 @@ rm -rf $RPM_BUILD_ROOT
 %files -n python-PyQt5-%{name}
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
+%{py_sitedir}/PyQt5/Qsci.pyi
 %endif
 
 %if %{with python3}
 %files -n python3-PyQt5-%{name}
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so
+%{py3_sitedir}/PyQt5/Qsci.pyi
 %endif
 %endif
diff --git a/py-config.patch b/py-config.patch
new file mode 100644
index 0000000..af84d31
--- /dev/null
+++ b/py-config.patch
@@ -0,0 +1,18 @@
+
+target_config.src_dir and thus sip_file is an absolute path,
+this means the head from os.path.split() winn _never_be empty,
+it will always contain at least a '/'. This whole while loop
+does not make any sense to me since config seems to be interested
+in checking if sip_file is a full path or only a file name.
+
+--- QScintilla_gpl-2.11.2/Python/configure.py~	2019-10-06 09:53:25.000000000 +0200
++++ QScintilla_gpl-2.11.2/Python/configure.py	2019-10-06 09:53:37.516896207 +0200
+@@ -1354,8 +1354,6 @@
+     sip_file = os.path.join(target_config.src_dir, module_config.get_sip_file(target_config))
+ 
+     head, tail = os.path.split(sip_file)
+-    while head:
+-        head, tail = os.path.split(head)
+ 
+     if tail != sip_file:
+         argv.append('-I')
diff --git a/python-install.patch b/python-install.patch
index 346b927..ea15a75 100644
--- a/python-install.patch
+++ b/python-install.patch
@@ -9,3 +9,15 @@
          self.debug = hasattr(sys, 'gettotalrefcount')
  
          if sys.platform == 'win32':
+@@ -1564,7 +1564,10 @@
+             fn = fn.replace(os.sep, '/')
+             fn = os.path.normpath(fn)
+ 
+-            pro.write(' \\\n    ../%s' % fn)
++            if os.path.isabs(fn):
++                pro.write(' \\\n    %s' % fn)
++            else:
++                pro.write(' \\\n    ../%s' % fn)
+ 
+         pro.write('''
+ INSTALLS += sip
diff --git a/qscintilla2-link.patch b/qscintilla2-link.patch
deleted file mode 100644
index 999b229..0000000
--- a/qscintilla2-link.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: qscintilla2-2.8.4+dfsg/Python/configure.py
-===================================================================
---- qscintilla2-2.8.4+dfsg.orig/Python/configure.py	2014-09-21 22:26:07.110346928 -0400
-+++ qscintilla2-2.8.4+dfsg/Python/configure.py	2014-09-21 22:26:07.106346928 -0400
-@@ -1440,7 +1440,10 @@
- 
-     libs = qmake_config.get('LIBS')
-     if libs:
--        pro.write('LIBS += %s\n' % libs)
-+        if target_config.pyqt_package == 'PyQt5':
-+            pro.write('LIBS += %s -lqscintilla2-qt5\n' % libs)
-+        else:
-+            pro.write('LIBS += %s -lqscintilla2-qt4\n' % libs)
- 
-     if not opts.static:
-         pro.write('''
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qscintilla2.git/commitdiff/7f136b4ddf8e960442d4e76389aa4ec53ac0a5c1



More information about the pld-cvs-commit mailing list