Skip to contentSkip to conversation

python-sip: new package

PATCH Superseded Gwenhael Goavec-Merou 3 participants 8 messages Apr 13, 2015 – Apr 15, 2015

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python-sip: new package

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

---
 package/Config.in                       |  1 +
 package/python-sip/0001-configure.patch | 43 ++++++++++++++++++++++
 package/python-sip/Config.in            | 11 ++++++
 package/python-sip/python-sip.hash      |  4 +++
 package/python-sip/python-sip.mk        | 64 +++++++++++++++++++++++++++++++++
 5 files changed, 123 insertions(+)
 create mode 100644 package/python-sip/0001-configure.patch
 create mode 100644 package/python-sip/Config.in
 create mode 100644 package/python-sip/python-sip.hash
 create mode 100644 package/python-sip/python-sip.mk
package/Config.in +1 -0
index 248e18b..546a9e5 100644
@@ -605,6 +605,7 @@ menu "external python modules"
 	source "package/python-serial/Config.in"
 	source "package/python-setuptools/Config.in"
 	source "package/python-simplejson/Config.in"
+	source "package/python-sip/Config.in"
 	source "package/python-six/Config.in"
 	source "package/python-spidev/Config.in"
 	source "package/python-thrift/Config.in"
package/python-sip/0001-configure.patch new file +43 -0

44 lines not on this page · raw message

package/python-sip/Config.in new file +11 -0
new file mode 100644
index 0000000..fdbf7c2
@@ -0,0 +1,11 @@
+comment "python-sip needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_PYTHON_SIP
+	bool "python-sip"
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  SIP is a tool for C/C++ libraries binding. It was developed
+	  to create PyQt
+
+	  http://www.riverbankcomputing.com/software/sip/intro
package/python-sip/python-sip.hash new file +4 -0
new file mode 100644
index 0000000..c0b2db3
@@ -0,0 +1,4 @@
+# Locally calculated:
+md5 a63172f744370698a27a3a1cc902ce65 sip-4.16.tar.gz
+
+sha256 d769ce2486bab4cb0b3bea8868153c7e5c27b50ee74fec3329e35ed50a346398 sip-4.16.tar.gz
package/python-sip/python-sip.mk new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.0.5
#1 lore raw

PATCH 2/2 python-pyqt: new package

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080831.html

---
 package/Config.in                                  |  1 +
 .../python-pyqt/0001-configure-skip-qtdetail.patch | 13 ++++
 .../0002-configure-set-python-pathes.patch         | 14 +++++
 package/python-pyqt/0003-sip-QtCore-add-qws.patch  | 41 +++++++++++++
 ...004-sip-QtGuit-hide-qfont-cachestatistics.patch | 16 +++++
 package/python-pyqt/0005-configure-set-qws.patch   | 11 ++++
 package/python-pyqt/0006-QtGui-add-wid.patch       | 12 ++++
 package/python-pyqt/Config.in                      | 17 ++++++
 package/python-pyqt/python-pyqt.hash               |  4 ++
 package/python-pyqt/python-pyqt.mk                 | 71 ++++++++++++++++++++++
 10 files changed, 200 insertions(+)
 create mode 100644 package/python-pyqt/0001-configure-skip-qtdetail.patch
 create mode 100644 package/python-pyqt/0002-configure-set-python-pathes.patch
 create mode 100644 package/python-pyqt/0003-sip-QtCore-add-qws.patch
 create mode 100644 package/python-pyqt/0004-sip-QtGuit-hide-qfont-cachestatistics.patch
 create mode 100644 package/python-pyqt/0005-configure-set-qws.patch
 create mode 100644 package/python-pyqt/0006-QtGui-add-wid.patch
 create mode 100644 package/python-pyqt/Config.in
 create mode 100644 package/python-pyqt/python-pyqt.hash
 create mode 100644 package/python-pyqt/python-pyqt.mk
package/Config.in +1 -0
index 546a9e5..a7f05de 100644
@@ -592,6 +592,7 @@ menu "external python modules"
 	source "package/python-pyinotify/Config.in"
 	source "package/python-pyparsing/Config.in"
 	source "package/python-pypcap/Config.in"
+	source "package/python-pyqt/Config.in"
 	source "package/python-pyro/Config.in"
 	source "package/python-pysendfile/Config.in"
 	source "package/python-pysnmp/Config.in"
package/python-pyqt/0001-configure-skip-qtdetail.patch new file +13 -0
new file mode 100644
index 0000000..bfe488a
@@ -0,0 +1,13 @@
+--- a/configure-ng.py	2013-06-16 16:06:06.000000000 +0100
++++ b/configure-ng_new.py	2015-03-05 09:20:01.549911407 +0000
+@@ -516,8 +516,8 @@ int main(int argc, char **argv)
+             error("Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.")
+ 
+         # Create the output file, first making sure it doesn't exist.
+-        remove_file(out_file)
+-        run_command(cmd, verbose)
++        #remove_file(out_file)
++        #run_command(cmd, verbose)
+ 
+         if not os.access(out_file, os.F_OK):
+             error("%s failed to create %s. Make sure your Qt installation is correct." % (exe_file, out_file))
package/python-pyqt/0002-configure-set-python-pathes.patch new file +14 -0
new file mode 100644
index 0000000..dfa22fc
@@ -0,0 +1,14 @@
+--- a/configure-ng.py	2013-10-18 19:36:57.969234500 +0400
++++ b/configure-ng.py	2013-10-18 19:10:58.000000000 +0400
+@@ -960,9 +960,11 @@ int main(int argc, char **argv)
+ 
+         if opts.vendincdir is not None:
+             self.vend_inc_dir = opts.vendincdir
++            self.py_inc_dir = opts.vendincdir
+ 
+         if opts.vendlibdir is not None:
+             self.vend_lib_dir = opts.vendlibdir
++            self.py_lib_dir = opts.vendlibdir
+ 
+         # Handle any conflicts.
+         if self.qt_shared:
\ No newline at end of file
package/python-pyqt/0003-sip-QtCore-add-qws.patch new file +41 -0

42 lines not on this page · raw message

package/python-pyqt/0004-sip-QtGuit-hide-qfont-cachestatistics.patch new file +16 -0
new file mode 100644
index 0000000..edf3cf9
@@ -0,0 +1,16 @@
+Hide QFont::cacheStatistics which itn't available in QWS
+
+Signed-off-by: Sergey Kostanbaev <[email protected]>
+diff -ur PyQt-x11-gpl-4.9.6/sip/QtGui/qfont.sip pyqt-4.9.6/sip/QtGui/qfont.sip
+--- PyQt-x11-gpl-4.9.6/sip/QtGui/qfont.sip	2012-12-08 13:51:38.000000000 +0400
++++ pyqt-4.9.6/sip/QtGui/qfont.sip	2013-05-22 14:06:38.335000022 +0400
+@@ -185,7 +185,9 @@
+ %End
+     static void initialize();
+     static void cleanup();
++%If (!WS_QWS)
+     static void cacheStatistics();
++%End
+     QString defaultFamily() const;
+     QString lastResortFamily() const;
+     QString lastResortFont() const;
\ No newline at end of file
package/python-pyqt/0005-configure-set-qws.patch new file +11 -0
new file mode 100644
index 0000000..cbda91f
@@ -0,0 +1,11 @@
+--- a/configure-ng.py	2015-03-06 09:00:41.268046125 +0000
++++ b/configure-ng_new.py	2015-03-06 09:28:02.584081699 +0000
+@@ -1947,7 +1947,7 @@ def get_sip_flags(target_config):
+     elif target_config.py_platform == 'darwin':
+         plattag = 'WS_MACX'
+     else:
+-        plattag = 'WS_X11'
++        plattag = 'WS_QWS'
+ 
+     sip_flags.append('-t')
+     sip_flags.append(plattag)
package/python-pyqt/0006-QtGui-add-wid.patch new file +12 -0
new file mode 100644
index 0000000..cfb15f1
@@ -0,0 +1,12 @@
+--- a/sip/QtGui/qwindowdefs.sip	2013-06-16 16:06:29.000000000 +0100
++++ b/sip/QtGui/qwindowdefs.sip	2015-03-06 09:46:58.188106312 +0000
+@@ -46,6 +46,9 @@ typedef HWND WId;
+ // MacOS/X specific definitions.
+ typedef long WId;
+ %End
++%If (WS_QWS)
++typedef unsigned long  WId;
++%End
+ %End
+ %If (Qt_5_0_0 -)
+ typedef quintptr WId;
package/python-pyqt/Config.in new file +17 -0
new file mode 100644
index 0000000..7402fc2
@@ -0,0 +1,17 @@
+comment "python-pyqt needs a toolchain w/ C++, threads"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL
+
+
+config BR2_PACKAGE_PYTHON_PYQT
+	bool "python-pyqt"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # qt
+	depends on BR2_USE_MMU # qt
+	select BR2_PACKAGE_PYTHON_SIP
+	select BR2_PACKAGE_QT
+	help
+	  PyQt4 for Qt Embedded 4 bindings.
+
+	  http://www.riverbankcomputing.com/software/pyqt/
package/python-pyqt/python-pyqt.hash new file +4 -0
new file mode 100644
index 0000000..def02c9
@@ -0,0 +1,4 @@
+# Locally calculated:
+md5 20940f6b2c957269cdd02d0efe537515 PyQt-x11-gpl-4.10.4.tar.gz
+
+sha256 8554e27b42d1ce3d667290c3e6c0e17d8c33354604d3c457c64c7783920a4edb PyQt-x11-gpl-4.10.4.tar.gz
package/python-pyqt/python-pyqt.mk new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
2.0.5
#2 lore raw

PATCH 2/2 python-pyqt: new package

Dear Gwenhael Goavec-Merou,

Quoted 5 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080831.html

Below is a rather quick review, making some initial suggestions.

package/python-pyqt/0001-configure-skip-qtdetail.patch

Quoted 6 lines
package/python-pyqt/0001-configure-skip-qtdetail.patch new file +0 -0
new file mode 100644
index 0000000..bfe488a
@@ -0,0 +1,13 @@

All patches should have a description and Signed-off-by.

package/python-pyqt/0001-configure-skip-qtdetail.patch line 10

Quoted 10 lines
package/python-pyqt/0001-configure-skip-qtdetail.patch new file +10 -0
+--- a/configure-ng.py	2013-06-16 16:06:06.000000000 +0100
++++ b/configure-ng_new.py	2015-03-05 09:20:01.549911407 +0000
+@@ -516,8 +516,8 @@ int main(int argc, char **argv)
+             error("Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.")
+ 
+         # Create the output file, first making sure it doesn't exist.
+-        remove_file(out_file)
+-        run_command(cmd, verbose)
++        #remove_file(out_file)
++        #run_command(cmd, verbose)

So why not simply removing the code instead of commenting it?

package/python-pyqt/0002-configure-set-python-pathes.patch

Quoted 5 lines
package/python-pyqt/0002-configure-set-python-pathes.patch new file +0 -0
new file mode 100644
index 0000000..dfa22fc

Description + SoB.

package/python-pyqt/0003-sip-QtCore-add-qws.patch line 2

Quoted 8 lines
package/python-pyqt/0003-sip-QtCore-add-qws.patch new file +2 -0
new file mode 100644
index 0000000..ad3a897
@@ -0,0 +1,41 @@
+Add WS_QWS platform configuration in QtCore. Change HANDLE to void* to get rid
+of error during compilation

This needs a bit more explanation I'd say. Also, any chance this can be submitted upstream?

Quoted 69 lines
package/python-pyqt/0003-sip-QtCore-add-qws.patch new file +39 -0
+
+Signed-off-by: Sergey Kostanbaev <[email protected]>
+diff -ur PyQt-x11-gpl-4.9.6/sip/QtCore/qnamespace.sip pyqt-4.9.6/sip/QtCore/qnamespace.sip
+--- PyQt-x11-gpl-4.9.6/sip/QtCore/qnamespace.sip	2012-12-08 13:51:38.000000000 +0400
++++ pyqt-4.9.6/sip/QtCore/qnamespace.sip	2013-04-24 17:50:22.845000018 +0400
+@@ -1670,7 +1670,7 @@
+ %End
+ %End
+ %If (- Qt_5_0_0)
+-%If (WS_X11)
+-    typedef unsigned long HANDLE;
++%If (WS_X11 || WS_QWS)
++    typedef void* HANDLE;
+ %End
+ %End
+diff -ur PyQt-x11-gpl-4.9.6/sip/QtCore/qprocess.sip pyqt-4.9.6/sip/QtCore/qprocess.sip
+--- PyQt-x11-gpl-4.9.6/sip/QtCore/qprocess.sip	2012-12-08 13:51:38.000000000 +0400
++++ pyqt-4.9.6/sip/QtCore/qprocess.sip	2013-04-24 17:47:46.808000017 +0400
+@@ -28,7 +28,7 @@
+ %If (WS_WIN)
+ typedef void *Q_PID;
+ %End
+-%If (WS_X11 || WS_MACX)
++%If (WS_X11 || WS_MACX || WS_QWS)
+ typedef qint64 Q_PID;
+ %End
+ 
+diff -ur PyQt-x11-gpl-4.9.6/sip/QtCore/QtCoremod.sip pyqt-4.9.6/sip/QtCore/QtCoremod.sip
+--- PyQt-x11-gpl-4.9.6/sip/QtCore/QtCoremod.sip	2012-12-08 13:51:39.000000000 +0400
++++ pyqt-4.9.6/sip/QtCore/QtCoremod.sip	2013-04-24 17:48:37.599000018 +0400
+@@ -29,7 +29,7 @@
+ 
+ %Timeline {Qt_4_1_1 Qt_4_1_2 Qt_4_1_3 Qt_4_2_0 Qt_4_2_2 Qt_4_2_3 Qt_4_3_0 Qt_4_3_1 Qt_4_3_2 Qt_4_3_3 Qt_4_3_4 Qt_4_4_0 Qt_4_4_1 Qt_4_4_2 Qt_4_5_0 Qt_4_5_1 Qt_4_5_2 Qt_4_5_3 Qt_4_6_0 Qt_4_6_1 Qt_4_6_2 Qt_4_6_3 Qt_4_7_0 Qt_4_7_1 Qt_4_7_2 Qt_4_7_3 Qt_4_7_4 Qt_4_8_0 Qt_4_8_1 Qt_4_8_2 Qt_4_8_3 Qt_4_8_4 Qt_5_0_0}
+ 
+-%Platforms {WS_X11 WS_WIN WS_MACX}
++%Platforms {WS_X11 WS_WIN WS_MACX WS_QWS}
+ 
+ %Feature PyQt_Accessibility
+ %Feature PyQt_SessionManager
\ No newline at end of file
package/python-pyqt/0004-sip-QtGuit-hide-qfont-cachestatistics.patch new file +16 -0
new file mode 100644
index 0000000..edf3cf9
@@ -0,0 +1,16 @@
+Hide QFont::cacheStatistics which itn't available in QWS
+
+Signed-off-by: Sergey Kostanbaev <[email protected]>
+diff -ur PyQt-x11-gpl-4.9.6/sip/QtGui/qfont.sip pyqt-4.9.6/sip/QtGui/qfont.sip
+--- PyQt-x11-gpl-4.9.6/sip/QtGui/qfont.sip	2012-12-08 13:51:38.000000000 +0400
++++ pyqt-4.9.6/sip/QtGui/qfont.sip	2013-05-22 14:06:38.335000022 +0400
+@@ -185,7 +185,9 @@
+ %End
+     static void initialize();
+     static void cleanup();
++%If (!WS_QWS)
+     static void cacheStatistics();
++%End
+     QString defaultFamily() const;
+     QString lastResortFamily() const;
+     QString lastResortFont() const;
\ No newline at end of file
package/python-pyqt/0005-configure-set-qws.patch new file +0 -0
new file mode 100644
index 0000000..cbda91f

package/python-pyqt/0005-configure-set-qws.patch line 8

Quoted 8 lines
package/python-pyqt/0005-configure-set-qws.patch new file +8 -0
@@ -0,0 +1,11 @@
+--- a/configure-ng.py	2015-03-06 09:00:41.268046125 +0000
++++ b/configure-ng_new.py	2015-03-06 09:28:02.584081699 +0000
+@@ -1947,7 +1947,7 @@ def get_sip_flags(target_config):
+     elif target_config.py_platform == 'darwin':
+         plattag = 'WS_MACX'
+     else:
+-        plattag = 'WS_X11'
++        plattag = 'WS_QWS'

Does this means Qt4 on X11 is no longer supported by python-pyqt ?

package/python-pyqt/0006-QtGui-add-wid.patch

Quoted 5 lines
package/python-pyqt/0006-QtGui-add-wid.patch new file +0 -0
new file mode 100644
index 0000000..cfb15f1

Description + SoB.

Quoted 19 lines
package/python-pyqt/0006-QtGui-add-wid.patch new file +12 -0
@@ -0,0 +1,12 @@
+--- a/sip/QtGui/qwindowdefs.sip	2013-06-16 16:06:29.000000000 +0100
++++ b/sip/QtGui/qwindowdefs.sip	2015-03-06 09:46:58.188106312 +0000
+@@ -46,6 +46,9 @@ typedef HWND WId;
+ // MacOS/X specific definitions.
+ typedef long WId;
+ %End
++%If (WS_QWS)
++typedef unsigned long  WId;
++%End
+ %End
+ %If (Qt_5_0_0 -)
+ typedef quintptr WId;
package/python-pyqt/Config.in new file +0 -0
new file mode 100644
index 0000000..7402fc2

package/python-pyqt/Config.in line 10

Quoted 10 lines
package/python-pyqt/Config.in new file +10 -0
@@ -0,0 +1,17 @@
+comment "python-pyqt needs a toolchain w/ C++, threads"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS_NPTL
+
+
+config BR2_PACKAGE_PYTHON_PYQT
+	bool "python-pyqt"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # qt

Why NPTL ? package/qt/Config.in only depends on thread support, not NPTL threads.

package/python-pyqt/Config.in line 13

Quoted 3 lines
package/python-pyqt/Config.in new file +3 -0
+	depends on BR2_USE_MMU # qt
+	select BR2_PACKAGE_PYTHON_SIP
+	select BR2_PACKAGE_QT

Is this package both Python and Python 3 compatible?

Quoted 10 lines
package/python-pyqt/Config.in new file +4 -0
+	help
+	  PyQt4 for Qt Embedded 4 bindings.
+
+	  http://www.riverbankcomputing.com/software/pyqt/
package/python-pyqt/python-pyqt.hash new file +0 -0
new file mode 100644
index 0000000..def02c9

package/python-pyqt/python-pyqt.hash line 4

Quoted 4 lines
package/python-pyqt/python-pyqt.hash new file +4 -0
@@ -0,0 +1,4 @@
+# Locally calculated:
+md5 20940f6b2c957269cdd02d0efe537515 PyQt-x11-gpl-4.10.4.tar.gz
+
+sha256 8554e27b42d1ce3d667290c3e6c0e17d8c33354604d3c457c64c7783920a4edb PyQt-x11-gpl-4.10.4.tar.gz

Only the sha256 needed if locally calculated.

package/python-pyqt/python-pyqt.mk line 5

Quoted 11 lines
package/python-pyqt/python-pyqt.mk new file +5 -0
new file mode 100644
index 0000000..1ac1c6e
@@ -0,0 +1,71 @@
+################################################################################
+#
+# python-pyqt
+#
+################################################################################

One empty new line needed here.

package/python-pyqt/python-pyqt.mk line 10

Quoted 5 lines
package/python-pyqt/python-pyqt.mk new file +5 -0
+PYTHON_PYQT_VERSION = 4.10.4
+PYTHON_PYQT_SOURCE = PyQt-x11-gpl-$(PYTHON_PYQT_VERSION).tar.gz
+PYTHON_PYQT_SITE = http://downloads.sourceforge.net/project/pyqt/PyQt4/PyQt-$(PYTHON_PYQT_VERSION) 
+PYTHON_PYQT_LICENSE = GPLv2, GPLv3
+PYTHON_PYQT_LICENSE_FILES = LICENSE.GPL2, LICENSE.GPL3

space separated list, not comma separated.

Quoted 6 lines
package/python-pyqt/python-pyqt.mk new file +6 -0
+
+PYTHON_PYQT_DEPENDENCIES = python-sip qt
+
+define PYTHON_PYQT_QTDETAIL
+    echo $(1) >> $(2)/qtdetail.out
+endef

package/python-pyqt/python-pyqt.mk line 26

Quoted 10 lines
package/python-pyqt/python-pyqt.mk new file +10 -0
+
+PYTHON_PYQT_QTDETAIL_LIC = "Open Source"
+
+ifeq ($(BR2_PACKAGE_QT_SHARED),y)
+    PYTHON_PYQT_QTDETAIL_TYPE = "shared"
+else
+    PYTHON_PYQT_QTDETAIL_TYPE = ""
+endif
+
+# Turn off features that isn't availabe in QWS and current qt configuration.

isn't -> aren't
availabe -> available

package/python-pyqt/python-pyqt.mk line 29

Quoted 3 lines
package/python-pyqt/python-pyqt.mk new file +3 -0
+PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES = PyQt_Accessibility PyQt_SessionManager PyQt_qreal_double PyQt_Shortcut PyQt_RawFont WS_MACX WS_WIN
+
+ifneq ($(BR2_PACKAGE_QT_OPENSSL),y)

ifeq ($(BR2_PACKAGE_QT_OPENSSL),)

package/python-pyqt/python-pyqt.mk line 39

Quoted 10 lines
package/python-pyqt/python-pyqt.mk new file +10 -0
+    PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES += PyQt_OpenSSL
+endif
+
+# Since we can't run generate qtdetail.out by running qtdetail on target device
+# we must generate the configuration.
+define PYTHON_PYQT_GENERATE_QTDETAIL
+    rm -f $(1)/qtdetail.out
+
+    $(call PYTHON_PYQT_QTDETAIL, $(PYTHON_PYQT_QTDETAIL_LIC), $(1))
+    $(call PYTHON_PYQT_QTDETAIL, $(PYTHON_PYQT_QTDETAIL_TYPE), $(1))

No space between arguments.

package/python-pyqt/python-pyqt.mk line 42

Quoted 3 lines
package/python-pyqt/python-pyqt.mk new file +3 -0
+
+    for i in $(PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES); do \
+        $(call PYTHON_PYQT_QTDETAIL, $$i, $(1)); \

I think you can use a make $(foreach ...) loop here instead.

Quoted 10 lines
package/python-pyqt/python-pyqt.mk new file +10 -0
+    done
+endef
+
+define PYTHON_PYQT_CONFIGURE_CMDS
+    $(call PYTHON_PYQT_GENERATE_QTDETAIL, $(@D))
+
+    ( cd $(@D); \
+	$(TARGET_CONFIGURE_OPTS) \
+	$(HOST_DIR)/usr/bin/python configure-ng.py \
+		--bindir $(TARGET_DIR)/usr/bin \

package/python-pyqt/python-pyqt.mk line 62

Quoted 10 lines
package/python-pyqt/python-pyqt.mk new file +10 -0
+		--destdir $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+		--vendorid-incdir $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)  \
+		--vendorid-libdir $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/config \
+		--qmake $(HOST_DIR)/usr/bin/qmake \
+		--spec $(BUILD_DIR)/qt-$(QT_VERSION)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++ \
+		-w --confirm-license \
+		--no-designer-plugin \
+		--no-docstrings \
+		--no-sip-files \
+		--static \

--static in all cases? Is it static vs. shared or something else?

package/python-pyqt/python-pyqt.mk line 71

Quoted 9 lines
package/python-pyqt/python-pyqt.mk new file +9 -0
+    )
+endef
+
+define PYTHON_PYQT_INSTALL_TARGET_CMDS
+    $(TARGET_CONFIGURE_OPTS)  $(MAKE) install -C $(@D)
+    touch $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/PyQt4/__init__.py 
+endef
+
+$(eval $(autotools-package))

Why is it an autotools package if it uses a completely custom configure script? Most likely it should be a generic-package.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 python-sip: new package

In reply to Gwenhael Goavec-Merou

Dear Gwenhael Goavec-Merou,

Quoted 5 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

Thanks a lot for refusing the work on this package and python-pyqt! Some comments below.

package/python-sip/0001-configure.patch line 4

Quoted 10 lines
package/python-sip/0001-configure.patch new file +4 -0
new file mode 100644
index 0000000..4353bd1
@@ -0,0 +1,43 @@
+Add cross compilation options for using satged python
+config, libraries and includes
+
+Signed-off-by Sergey Kostanbaev <[email protected]>

The formatting of this patch is a bit weird, with no empty line between SoB and the patch. Also, the SoB e-mail is strange, and is it really gamil.com and not gmail.com ?

Is there any chance of submitting this patch upstream?

Quoted 46 lines
package/python-sip/0001-configure.patch new file +39 -0
+====================================================================
+--- a/configure.py	2013-04-24 12:41:35.382000017 +0400
++++ b/configure.py	2013-04-24 13:09:30.000000000 +0400
+@@ -273,9 +273,9 @@
+         "default_mod_dir":  plat_py_site_dir,
+         "default_sip_dir":  opts.sipsipdir,
+         "py_version":       py_version,
+-        "py_inc_dir":       plat_py_inc_dir,
+-        "py_conf_inc_dir":  plat_py_conf_inc_dir,
+-        "py_lib_dir":       plat_py_lib_dir,
++        "py_inc_dir":       opts.py_inc_dir,
++        "py_conf_inc_dir":  opts.py_conf_inc_dir,
++        "py_lib_dir":       opts.py_lib_dir,
+         "universal":        opts.universal,
+         "arch":             opts.arch,
+         "deployment_target":    opts.deployment_target
+@@ -399,6 +399,22 @@
+             "macros")
+     p.add_option_group(g)
+ 
++    # Python configuration
++    g = optparse.OptionGroup(p, title="Python include path")
++    g.add_option("-i", "--py_inc_dir", action="callback",
++	    default=plat_py_inc_dir, type="string", metavar="DIR",
++	    dest="py_inc_dir", callback=store_abspath, help="where the Python "
++	    "include directory located [default: %s]" % plat_py_inc_dir)
++    g.add_option("-c", "--py_conf_inc_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_conf_inc_dir", callback=store_abspath, help="where the Python "
++	    "Configuration include directory located [default: %s]" % plat_py_conf_inc_dir)
++    g.add_option("-l", "--py_lib_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_lib_dir", callback=store_abspath, help="where the Python "
++	    "library located [default: %s]" % plat_py_lib_dir)
++
++
+     # Installation.
+     g = optparse.OptionGroup(p, title="Installation")
+     g.add_option("-b", "--bindir", action="callback",
\ No newline at end of file
package/python-sip/Config.in new file +0 -0
new file mode 100644
index 0000000..fdbf7c2

package/python-sip/Config.in line 6

Quoted 6 lines
package/python-sip/Config.in new file +6 -0
@@ -0,0 +1,11 @@
+comment "python-sip needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_PYTHON_SIP
+	bool "python-sip"
+	depends on BR2_INSTALL_LIBSTDCPP

Is it Python 2 *and* Python 3 compatible?

Quoted 11 lines
package/python-sip/Config.in new file +5 -0
+	help
+	  SIP is a tool for C/C++ libraries binding. It was developed
+	  to create PyQt
+
+	  http://www.riverbankcomputing.com/software/sip/intro
package/python-sip/python-sip.hash new file +0 -0
new file mode 100644
index 0000000..c0b2db3

package/python-sip/python-sip.hash line 4

Quoted 4 lines
package/python-sip/python-sip.hash new file +4 -0
@@ -0,0 +1,4 @@
+# Locally calculated:
+md5 a63172f744370698a27a3a1cc902ce65 sip-4.16.tar.gz
+
+sha256 d769ce2486bab4cb0b3bea8868153c7e5c27b50ee74fec3329e35ed50a346398 sip-4.16.tar.gz

If both are locally calculated, then only the sha256 is needed, you can remove the md5.

Quoted 7 lines
package/python-sip/python-sip.mk new file +1 -0
new file mode 100644
index 0000000..a8051a8
@@ -0,0 +1,64 @@
+################################################################################

package/python-sip/python-sip.mk line 11

Quoted 10 lines
package/python-sip/python-sip.mk new file +10 -0
+#
+# python-sip
+#
+################################################################################
+
+PYTHON_SIP_VERSION = 4.16
+PYTHON_SIP_SOURCE = sip-$(PYTHON_SIP_VERSION).tar.gz
+PYTHON_SIP_SITE = http://downloads.sourceforge.net/project/pyqt/sip/sip-$(PYTHON_SIP_VERSION)
+PYTHON_SIP_LICENSE = SIP, GPLv2, GPLv3
+PYTHON_SIP_LICENSE_FILES = LICENSE, LICENSE-GPL2, LICENSE-GPL3

<pkg>_LICENSE_FILES is space-separated, not comma separated.

package/python-sip/python-sip.mk line 12

Quoted 1 line
package/python-sip/python-sip.mk new file +1 -0
+PYTHON_SIP_DEPENDENCIES = host-python-sip python

Can you clarify why both a host and a target package are needed? Preferably in the commit log.

package/python-sip/python-sip.mk line 19

Quoted 7 lines
package/python-sip/python-sip.mk new file +7 -0
+HOST_PYTHON_SIP_DEPENDENCIES = host-python
+
+define HOST_PYTHON_SIP_CONFIGURE_CMDS
+    (cd $(@D); \
+	$(HOST_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python configure.py;\
+    )
+endef

This is the only command for the host package. Is it really doing something?

package/python-sip/python-sip.mk line 26

Quoted 7 lines
package/python-sip/python-sip.mk new file +7 -0
+
+
+ifeq ($(BR2_arm)$(BR2_armeb),y)
+PYTHON_SIP_PLATFORM = arm
+else
+PYTHON_SIP_PLATFORM =
+endif

So for everything except ARM, the specs file is:

	linux--g++

?

package/python-sip/python-sip.mk line 29

Quoted 3 lines
package/python-sip/python-sip.mk new file +3 -0
+
+define PYTHON_SIP_SET
+  $(SED) '/$(1)[[:space:]]/c\$(1) = $(2)' $(3)/specs/linux-$(PYTHON_SIP_PLATFORM)-g++

Use one tab for indentation here.

Quoted 5 lines
package/python-sip/python-sip.mk new file +5 -0
+endef
+
+define PYTHON_SIP_CONFIGURE_CMDS
+# Fix compilers path and flags
+    $(call PYTHON_SIP_SET,QMAKE_CC,$(TARGET_CC),$(@D))

package/python-sip/python-sip.mk line 44

Quoted 10 lines
package/python-sip/python-sip.mk new file +10 -0
+    $(call PYTHON_SIP_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LFLAGS,$(TARGET_LDFLAGS),$(@D))

Ditto one tab for indentation.

package/python-sip/python-sip.mk line 47

Quoted 3 lines
package/python-sip/python-sip.mk new file +3 -0
+
+    ( cd $(@D); \
+	cp specs/linux-$(PYTHON_SIP_PLATFORM)-g++ specs;  \

This doesn't really have to be in the cd $(@D), you can do:

	cp $(@D)/specs/linux-.... $(@D)/specs
Quoted 7 lines
package/python-sip/python-sip.mk new file +7 -0
+	$(HOST_DIR)/usr/bin/python configure.py \
+		-b $(TARGET_DIR)/usr/bin \
+		-d $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+		-e $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)  \
+		-v $(TARGET_DIR)/usr/share/sip \
+		-i $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
+		-c $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/config \

package/python-sip/python-sip.mk line 64

Quoted 10 lines
package/python-sip/python-sip.mk new file +10 -0
+		-p linux-$(PYTHON_SIP_PLATFORM)-g++; \
+    )
+endef
+
+define PYTHON_SIP_INSTALL_TARGET_CMDS
+    $(TARGET_CONFIGURE_OPTS) $(MAKE) install -C $(@D)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))

So overall the main question is why do we need both a host and a target package? Is it a code generator that should be only on the host? Something else?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/2 python-sip: new package

Hello,

Quoted 1 line · Thomas Petazzoni

Thanks a lot for refusing the work on this package and python-pyqt!

Obviously: s/refusing/re-using/.

Thanks Yann for spotting!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/2 python-sip: new package

In reply to Thomas Petazzoni
Quoted 8 lines · Thomas Petazzoni

Dear Gwenhael Goavec-Merou,

Quoted 5 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

You should keep the original author somewhere around, either as author (if your
changes are just cosmetic), or in Cc (if you completely turned it around).

If you keep the original author, the easist is to fetch the patch from
patchwork with pwclient:

pwclient git-am 284873

Also don't forget to add v3 and changelog.

Quoted 2 lines

Thanks a lot for refusing the work on this package and python-pyqt!

Refusing? I hope reusing :-)

Quoted 16 lines

Some comments below.

package/python-sip/0001-configure.patch line 4

Quoted 10 lines
package/python-sip/0001-configure.patch new file +4 -0
new file mode 100644
index 0000000..4353bd1
@@ -0,0 +1,43 @@
+Add cross compilation options for using satged python
+config, libraries and includes
+
+Signed-off-by Sergey Kostanbaev <[email protected]>

The formatting of this patch is a bit weird, with no empty line between SoB and the patch. Also, the SoB e-mail is strange, and is it really gamil.com and not gmail.com ?

I guess the at is from cut&paste from the pipermail archive. The gamil was
wrong in the original patch.

Quoted 29 lines

Is there any chance of submitting this patch upstream?

Quoted 26 lines
package/python-sip/0001-configure.patch new file +26 -0
+====================================================================
+--- a/configure.py	2013-04-24 12:41:35.382000017 +0400
++++ b/configure.py	2013-04-24 13:09:30.000000000 +0400
+@@ -273,9 +273,9 @@
+         "default_mod_dir":  plat_py_site_dir,
+         "default_sip_dir":  opts.sipsipdir,
+         "py_version":       py_version,
+-        "py_inc_dir":       plat_py_inc_dir,
+-        "py_conf_inc_dir":  plat_py_conf_inc_dir,
+-        "py_lib_dir":       plat_py_lib_dir,
++        "py_inc_dir":       opts.py_inc_dir,
++        "py_conf_inc_dir":  opts.py_conf_inc_dir,
++        "py_lib_dir":       opts.py_lib_dir,
+         "universal":        opts.universal,
+         "arch":             opts.arch,
+         "deployment_target":    opts.deployment_target
+@@ -399,6 +399,22 @@
+             "macros")
+     p.add_option_group(g)
+ 
++    # Python configuration
++    g = optparse.OptionGroup(p, title="Python include path")
++    g.add_option("-i", "--py_inc_dir", action="callback",
++	    default=plat_py_inc_dir, type="string", metavar="DIR",
++	    dest="py_inc_dir", callback=store_abspath, help="where the Python "
++	    "include directory located [default: %s]" % plat_py_inc_dir)

missing verb in help text, probably should be "where the Python include
directory is located"

Quoted 4 lines

package/python-sip/0001-configure.patch line 34

Quoted 4 lines
package/python-sip/0001-configure.patch new file +4 -0
++    g.add_option("-c", "--py_conf_inc_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_conf_inc_dir", callback=store_abspath, help="where the Python "
++	    "Configuration include directory located [default: %s]" % plat_py_conf_inc_dir)

Same here.

Quoted 4 lines

package/python-sip/0001-configure.patch line 38

Quoted 4 lines
package/python-sip/0001-configure.patch new file +4 -0
++    g.add_option("-l", "--py_lib_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_lib_dir", callback=store_abspath, help="where the Python "
++	    "library located [default: %s]" % plat_py_lib_dir)

Same here.

Quoted 6 lines

package/python-sip/0001-configure.patch line 43

Quoted 6 lines
package/python-sip/0001-configure.patch new file +5 -0
++
++
+     # Installation.
+     g = optparse.OptionGroup(p, title="Installation")
+     g.add_option("-b", "--bindir", action="callback",
\ No newline at end of file

That's weird... the original patch didn't have this missing newline.

Quoted 34 lines

package/python-sip/Config.in line 6

Quoted 12 lines
package/python-sip/Config.in new file +6 -0
new file mode 100644
index 0000000..fdbf7c2
@@ -0,0 +1,11 @@
+comment "python-sip needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_PYTHON_SIP
+	bool "python-sip"
+	depends on BR2_INSTALL_LIBSTDCPP

Is it Python 2 *and* Python 3 compatible?

Quoted 11 lines
package/python-sip/Config.in new file +5 -0
+	help
+	  SIP is a tool for C/C++ libraries binding. It was developed
+	  to create PyQt
+
+	  http://www.riverbankcomputing.com/software/sip/intro
package/python-sip/python-sip.hash new file +0 -0
new file mode 100644
index 0000000..c0b2db3

package/python-sip/python-sip.hash line 4

Quoted 4 lines
package/python-sip/python-sip.hash new file +4 -0
@@ -0,0 +1,4 @@
+# Locally calculated:
+md5 a63172f744370698a27a3a1cc902ce65 sip-4.16.tar.gz
+
+sha256 d769ce2486bab4cb0b3bea8868153c7e5c27b50ee74fec3329e35ed50a346398 sip-4.16.tar.gz

If both are locally calculated, then only the sha256 is needed, you can remove the md5.

Quoted 13 lines

package/python-sip/python-sip.mk line 7

Quoted 13 lines
package/python-sip/python-sip.mk new file +7 -0
new file mode 100644
index 0000000..a8051a8
@@ -0,0 +1,64 @@
+################################################################################
+#
+# python-sip
+#
+################################################################################
+
+PYTHON_SIP_VERSION = 4.16

4.16 is almost a year old, 4.16.7 has been released a couple of weeks ago...

Quoted 1 line

package/python-sip/python-sip.mk line 8

Quoted 1 line
package/python-sip/python-sip.mk new file +1 -0
+PYTHON_SIP_SOURCE = sip-$(PYTHON_SIP_VERSION).tar.gz

This is the default so not needed.

Quoted 2 lines

package/python-sip/python-sip.mk line 10

Quoted 2 lines
package/python-sip/python-sip.mk new file +2 -0
+PYTHON_SIP_SITE = http://downloads.sourceforge.net/project/pyqt/sip/sip-$(PYTHON_SIP_VERSION)
+PYTHON_SIP_LICENSE = SIP, GPLv2, GPLv3

We use an explicit 'or' if the user has the choice (otherwise it may look like
it's an 'and', which is the case for some packages).

Also, SIP is not really a standard license, so it should be the full title:
"Riverbank Computing Limited License agreement for SIP" (without the quotes). But that's a bit too long, so let's say "Riverbank license for SIP".

Quoted 30 lines

package/python-sip/python-sip.mk line 11

Quoted 1 line
package/python-sip/python-sip.mk new file +1 -0
+PYTHON_SIP_LICENSE_FILES = LICENSE, LICENSE-GPL2, LICENSE-GPL3

<pkg>_LICENSE_FILES is space-separated, not comma separated.

package/python-sip/python-sip.mk line 12

Quoted 1 line
package/python-sip/python-sip.mk new file +1 -0
+PYTHON_SIP_DEPENDENCIES = host-python-sip python

Can you clarify why both a host and a target package are needed? Preferably in the commit log.

package/python-sip/python-sip.mk line 19

Quoted 7 lines
package/python-sip/python-sip.mk new file +7 -0
+HOST_PYTHON_SIP_DEPENDENCIES = host-python
+
+define HOST_PYTHON_SIP_CONFIGURE_CMDS
+    (cd $(@D); \
+	$(HOST_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python configure.py;\
+    )
+endef

This is the only command for the host package. Is it really doing something?

package/python-sip/python-sip.mk line 26

Quoted 7 lines
package/python-sip/python-sip.mk new file +7 -0
+
+
+ifeq ($(BR2_arm)$(BR2_armeb),y)
+PYTHON_SIP_PLATFORM = arm
+else
+PYTHON_SIP_PLATFORM =
+endif

So for everything except ARM, the specs file is:

Quoted 1 line
	linux--g++

To avoid that issue, you could just patch all the specs files by putting a *
instead of PYTHON_SIP_PLATFORM.

Quoted 8 lines

?

package/python-sip/python-sip.mk line 29

Quoted 3 lines
package/python-sip/python-sip.mk new file +3 -0
+
+define PYTHON_SIP_SET
+  $(SED) '/$(1)[[:space:]]/c\$(1) = $(2)' $(3)/specs/linux-$(PYTHON_SIP_PLATFORM)-g++

Use one tab for indentation here.

Also, drop the $(3) and use $(@D) directly.

Quoted 25 lines
Quoted 6 lines
package/python-sip/python-sip.mk new file +5 -0
+endef
+
+define PYTHON_SIP_CONFIGURE_CMDS
+# Fix compilers path and flags
+    $(call PYTHON_SIP_SET,QMAKE_CC,$(TARGET_CC),$(@D))

package/python-sip/python-sip.mk line 44

Quoted 10 lines
package/python-sip/python-sip.mk new file +10 -0
+    $(call PYTHON_SIP_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LFLAGS,$(TARGET_LDFLAGS),$(@D))

Ditto one tab for indentation.

package/python-sip/python-sip.mk line 47

Quoted 3 lines
package/python-sip/python-sip.mk new file +3 -0
+
+    ( cd $(@D); \
+	cp specs/linux-$(PYTHON_SIP_PLATFORM)-g++ specs;  \

This doesn't really have to be in the cd $(@D), you can do:

Quoted 4 lines
	cp $(@D)/specs/linux-.... $(@D)/specs

package/python-sip/python-sip.mk line 49

Quoted 2 lines
package/python-sip/python-sip.mk new file +2 -0
+	$(HOST_DIR)/usr/bin/python configure.py \
+		-b $(TARGET_DIR)/usr/bin \

Please use long option names, so --bindir.

However, doesn't the same approach that we use in python-package work:

PKG_PYTHON_DISTUTILS_ENV = \
        PATH=$(BR_PATH) \
...
        _python_sysroot=$(STAGING_DIR) \
        _python_prefix=/usr \
        _python_exec_prefix=/usr

Regards,
Arnout

Quoted 24 lines
Quoted 5 lines
package/python-sip/python-sip.mk new file +5 -0
+		-d $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+		-e $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)  \
+		-v $(TARGET_DIR)/usr/share/sip \
+		-i $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
+		-c $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/config \

package/python-sip/python-sip.mk line 64

Quoted 10 lines
package/python-sip/python-sip.mk new file +10 -0
+		-p linux-$(PYTHON_SIP_PLATFORM)-g++; \
+    )
+endef
+
+define PYTHON_SIP_INSTALL_TARGET_CMDS
+    $(TARGET_CONFIGURE_OPTS) $(MAKE) install -C $(@D)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))

So overall the main question is why do we need both a host and a target package? Is it a code generator that should be only on the host? Something else?

Thanks,

Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#6 lore raw

PATCH 1/2 python-sip: new package

Quoted 4 lines · On Mon, 13 Apr 2015 23:40:59 +0200 Arnout Vandecappelle <[email protected]> wrote:
Quoted 3 lines · Thomas Petazzoni

Dear Gwenhael Goavec-Merou,

On Mon, 13 Apr 2015 17:11:47 +0200, Gwenhael Goavec-Merou wrote:

Quoted 9 lines
Quoted 5 lines
Quoted 5 lines

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

You should keep the original author somewhere around, either as author (if your
changes are just cosmetic), or in Cc (if you completely turned it around).

Ok

Quoted 7 lines

If you keep the original author, the easist is to fetch the patch from
patchwork with pwclient:

pwclient git-am 284873

Also don't forget to add v3 and changelog.

Ok

Quoted 23 lines
Quoted 3 lines

Thanks a lot for refusing the work on this package and python-pyqt!

Refusing? I hope reusing :-)

Quoted 16 lines

Some comments below.

package/python-sip/0001-configure.patch line 4

Quoted 10 lines
package/python-sip/0001-configure.patch new file +4 -0
new file mode 100644
index 0000000..4353bd1
@@ -0,0 +1,43 @@
+Add cross compilation options for using satged python
+config, libraries and includes
+
+Signed-off-by Sergey Kostanbaev <[email protected]>

The formatting of this patch is a bit weird, with no empty line between SoB and the patch. Also, the SoB e-mail is strange, and is it really gamil.com and not gmail.com ?

Quoted 2 lines

I guess the at is from cut&paste from the pipermail archive. The gamil was
wrong in the original patch.

yes

Quoted 48 lines
Quoted 30 lines

Is there any chance of submitting this patch upstream?

Quoted 26 lines
package/python-sip/0001-configure.patch new file +26 -0
+====================================================================
+--- a/configure.py	2013-04-24 12:41:35.382000017 +0400
++++ b/configure.py	2013-04-24 13:09:30.000000000 +0400
+@@ -273,9 +273,9 @@
+         "default_mod_dir":  plat_py_site_dir,
+         "default_sip_dir":  opts.sipsipdir,
+         "py_version":       py_version,
+-        "py_inc_dir":       plat_py_inc_dir,
+-        "py_conf_inc_dir":  plat_py_conf_inc_dir,
+-        "py_lib_dir":       plat_py_lib_dir,
++        "py_inc_dir":       opts.py_inc_dir,
++        "py_conf_inc_dir":  opts.py_conf_inc_dir,
++        "py_lib_dir":       opts.py_lib_dir,
+         "universal":        opts.universal,
+         "arch":             opts.arch,
+         "deployment_target":    opts.deployment_target
+@@ -399,6 +399,22 @@
+             "macros")
+     p.add_option_group(g)
+ 
++    # Python configuration
++    g = optparse.OptionGroup(p, title="Python include path")
++    g.add_option("-i", "--py_inc_dir", action="callback",
++	    default=plat_py_inc_dir, type="string", metavar="DIR",
++	    dest="py_inc_dir", callback=store_abspath, help="where the Python "
++	    "include directory located [default: %s]" % plat_py_inc_dir)

missing verb in help text, probably should be "where the Python include
directory is located"

Quoted 4 lines

package/python-sip/0001-configure.patch line 34

Quoted 4 lines
package/python-sip/0001-configure.patch new file +4 -0
++    g.add_option("-c", "--py_conf_inc_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_conf_inc_dir", callback=store_abspath, help="where the Python "
++	    "Configuration include directory located [default: %s]" % plat_py_conf_inc_dir)

Same here.

Quoted 4 lines

package/python-sip/0001-configure.patch line 38

Quoted 4 lines
package/python-sip/0001-configure.patch new file +4 -0
++    g.add_option("-l", "--py_lib_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_lib_dir", callback=store_abspath, help="where the Python "
++	    "library located [default: %s]" % plat_py_lib_dir)

Same here.

Quoted 9 lines
Quoted 6 lines

package/python-sip/0001-configure.patch line 43

Quoted 6 lines
package/python-sip/0001-configure.patch new file +5 -0
++
++
+     # Installation.
+     g = optparse.OptionGroup(p, title="Installation")
+     g.add_option("-b", "--bindir", action="callback",
\ No newline at end of file

That's weird... the original patch didn't have this missing newline.

This patch is no more needed.

Quoted 34 lines
Quoted 34 lines

package/python-sip/Config.in line 6

Quoted 12 lines
package/python-sip/Config.in new file +6 -0
new file mode 100644
index 0000000..fdbf7c2
@@ -0,0 +1,11 @@
+comment "python-sip needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_PYTHON_SIP
+	bool "python-sip"
+	depends on BR2_INSTALL_LIBSTDCPP

Is it Python 2 *and* Python 3 compatible?

Quoted 11 lines
package/python-sip/Config.in new file +5 -0
+	help
+	  SIP is a tool for C/C++ libraries binding. It was developed
+	  to create PyQt
+
+	  http://www.riverbankcomputing.com/software/sip/intro
package/python-sip/python-sip.hash new file +0 -0
new file mode 100644
index 0000000..c0b2db3

package/python-sip/python-sip.hash line 4

Quoted 4 lines
package/python-sip/python-sip.hash new file +4 -0
@@ -0,0 +1,4 @@
+# Locally calculated:
+md5 a63172f744370698a27a3a1cc902ce65 sip-4.16.tar.gz
+
+sha256 d769ce2486bab4cb0b3bea8868153c7e5c27b50ee74fec3329e35ed50a346398 sip-4.16.tar.gz

If both are locally calculated, then only the sha256 is needed, you can remove the md5.

Quoted 16 lines
Quoted 5 lines
Quoted 5 lines
package/python-sip/python-sip.mk new file +0 -0
new file mode 100644
index 0000000..a8051a8
Quoted 8 lines

package/python-sip/python-sip.mk line 7

Quoted 8 lines
package/python-sip/python-sip.mk new file +7 -0
@@ -0,0 +1,64 @@
+################################################################################
+#
+# python-sip
+#
+################################################################################
+
+PYTHON_SIP_VERSION = 4.16

4.16 is almost a year old, 4.16.7 has been released a couple of weeks ago...

Yes. Done for the next version

Quoted 4 lines
Quoted 1 line

package/python-sip/python-sip.mk line 8

Quoted 1 line
package/python-sip/python-sip.mk new file +1 -0
+PYTHON_SIP_SOURCE = sip-$(PYTHON_SIP_VERSION).tar.gz

This is the default so not needed.

Without this buildroot try to download python-sip-xxx.tar.gz instead of sip-xxx.tar.gz

Quoted 6 lines
Quoted 2 lines

package/python-sip/python-sip.mk line 10

Quoted 2 lines
package/python-sip/python-sip.mk new file +2 -0
+PYTHON_SIP_SITE = http://downloads.sourceforge.net/project/pyqt/sip/sip-$(PYTHON_SIP_VERSION)
+PYTHON_SIP_LICENSE = SIP, GPLv2, GPLv3

We use an explicit 'or' if the user has the choice (otherwise it may look like
it's an 'and', which is the case for some packages).

Ok

Quoted 4 lines

Also, SIP is not really a standard license, so it should be the full title:
"Riverbank Computing Limited License agreement for SIP" (without the quotes). But that's a bit too long, so let's say "Riverbank license for SIP".

Ok
[SNIP]

Quoted 10 lines
Quoted 10 lines

package/python-sip/python-sip.mk line 26

Quoted 7 lines
package/python-sip/python-sip.mk new file +7 -0
+
+
+ifeq ($(BR2_arm)$(BR2_armeb),y)
+PYTHON_SIP_PLATFORM = arm
+else
+PYTHON_SIP_PLATFORM =
+endif

So for everything except ARM, the specs file is:

Quoted 5 lines
Quoted 1 line
	linux--g++

To avoid that issue, you could just patch all the specs files by putting a *
instead of PYTHON_SIP_PLATFORM.

I have simplified this by using qmake. All configurations are now provided by this tool.

Quoted 12 lines
Quoted 8 lines

?

package/python-sip/python-sip.mk line 29

Quoted 3 lines
package/python-sip/python-sip.mk new file +3 -0
+
+define PYTHON_SIP_SET
+  $(SED) '/$(1)[[:space:]]/c\$(1) = $(2)' $(3)/specs/linux-$(PYTHON_SIP_PLATFORM)-g++

Use one tab for indentation here.

Also, drop the $(3) and use $(@D) directly.

Quoted 1 line

[SNIP]

Quoted 6 lines
Quoted 3 lines

package/python-sip/python-sip.mk line 49

Quoted 3 lines
package/python-sip/python-sip.mk new file +2 -0
+	$(HOST_DIR)/usr/bin/python configure.py \
+		-b $(TARGET_DIR)/usr/bin \

Please use long option names, so --bindir.

Quoted 9 lines

However, doesn't the same approach that we use in python-package work:

PKG_PYTHON_DISTUTILS_ENV = \
        PATH=$(BR_PATH) \
...
        _python_sysroot=$(STAGING_DIR) \
        _python_prefix=/usr \
        _python_exec_prefix=/usr

Done

Quoted 6 lines

Regards,
Arnout

[SNIP]

Regards,
Gwen

#7 lore raw

PATCH 1/2 python-sip: new package

In reply to Thomas Petazzoni
Quoted 27 lines · On Mon, 13 Apr 2015 22:54:48 +0200 Thomas Petazzoni…

Dear Gwenhael Goavec-Merou,

Quoted 5 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Based on http://lists.busybox.net/pipermail/buildroot/2013-October/080830.html

Thanks a lot for refusing the work on this package and python-pyqt! Some comments below.

package/python-sip/0001-configure.patch line 4

Quoted 10 lines
package/python-sip/0001-configure.patch new file +4 -0
new file mode 100644
index 0000000..4353bd1
@@ -0,0 +1,43 @@
+Add cross compilation options for using satged python
+config, libraries and includes
+
+Signed-off-by Sergey Kostanbaev <[email protected]>

The formatting of this patch is a bit weird, with no empty line between SoB and the patch. Also, the SoB e-mail is strange, and is it really gamil.com and not gmail.com ?

Quoted 2 lines

Is there any chance of submitting this patch upstream?

In fact with newer sip version this patch is no more needed.

Quoted 46 lines
Quoted 46 lines
package/python-sip/0001-configure.patch new file +39 -0
+====================================================================
+--- a/configure.py	2013-04-24 12:41:35.382000017 +0400
++++ b/configure.py	2013-04-24 13:09:30.000000000 +0400
+@@ -273,9 +273,9 @@
+         "default_mod_dir":  plat_py_site_dir,
+         "default_sip_dir":  opts.sipsipdir,
+         "py_version":       py_version,
+-        "py_inc_dir":       plat_py_inc_dir,
+-        "py_conf_inc_dir":  plat_py_conf_inc_dir,
+-        "py_lib_dir":       plat_py_lib_dir,
++        "py_inc_dir":       opts.py_inc_dir,
++        "py_conf_inc_dir":  opts.py_conf_inc_dir,
++        "py_lib_dir":       opts.py_lib_dir,
+         "universal":        opts.universal,
+         "arch":             opts.arch,
+         "deployment_target":    opts.deployment_target
+@@ -399,6 +399,22 @@
+             "macros")
+     p.add_option_group(g)
+ 
++    # Python configuration
++    g = optparse.OptionGroup(p, title="Python include path")
++    g.add_option("-i", "--py_inc_dir", action="callback",
++	    default=plat_py_inc_dir, type="string", metavar="DIR",
++	    dest="py_inc_dir", callback=store_abspath, help="where the Python "
++	    "include directory located [default: %s]" % plat_py_inc_dir)
++    g.add_option("-c", "--py_conf_inc_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_conf_inc_dir", callback=store_abspath, help="where the Python "
++	    "Configuration include directory located [default: %s]" % plat_py_conf_inc_dir)
++    g.add_option("-l", "--py_lib_dir", action="callback",
++	    default=plat_py_conf_inc_dir, type="string", metavar="DIR",
++	    dest="py_lib_dir", callback=store_abspath, help="where the Python "
++	    "library located [default: %s]" % plat_py_lib_dir)
++
++
+     # Installation.
+     g = optparse.OptionGroup(p, title="Installation")
+     g.add_option("-b", "--bindir", action="callback",
\ No newline at end of file
package/python-sip/Config.in new file +0 -0
new file mode 100644
index 0000000..fdbf7c2
@@ -0,0 +1,11 @@
Quoted 9 lines

package/python-sip/Config.in line 6

Quoted 6 lines
package/python-sip/Config.in new file +6 -0
+comment "python-sip needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_PYTHON_SIP
+	bool "python-sip"
+	depends on BR2_INSTALL_LIBSTDCPP

Is it Python 2 *and* Python 3 compatible?

Yes

Quoted 5 lines
Quoted 5 lines
package/python-sip/Config.in new file +5 -0
+	help
+	  SIP is a tool for C/C++ libraries binding. It was developed
+	  to create PyQt
+
+	  http://www.riverbankcomputing.com/software/sip/intro

[SNIP]

Quoted 6 lines
Quoted 2 lines

+PYTHON_SIP_DEPENDENCIES = host-python-sip python

Can you clarify why both a host and a target package are needed? Preferably in the commit log.

host-python-sip provides a tools used for configuration and python-sip provides headers.

Quoted 11 lines

package/python-sip/Config.in

Quoted 7 lines
package/python-sip/Config.in new file +7 -0
+HOST_PYTHON_SIP_DEPENDENCIES = host-python
+
+define HOST_PYTHON_SIP_CONFIGURE_CMDS
+    (cd $(@D); \
+	$(HOST_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python configure.py;\
+    )
+endef

This is the only command for the host package. Is it really doing something?

Yes with default configs

Quoted 29 lines

package/python-sip/Config.in

Quoted 7 lines
package/python-sip/Config.in new file +7 -0
+
+
+ifeq ($(BR2_arm)$(BR2_armeb),y)
+PYTHON_SIP_PLATFORM = arm
+else
+PYTHON_SIP_PLATFORM =
+endif

So for everything except ARM, the specs file is:

	linux--g++

?

package/python-sip/Config.in

Quoted 3 lines
package/python-sip/Config.in new file +3 -0
+
+define PYTHON_SIP_SET
+  $(SED) '/$(1)[[:space:]]/c\$(1) = $(2)' $(3)/specs/linux-$(PYTHON_SIP_PLATFORM)-g++

Use one tab for indentation here.

Quoted 9 lines
package/python-sip/Config.in new file +9 -0
+endef
+
+define PYTHON_SIP_CONFIGURE_CMDS
+# Fix compilers path and flags
+    $(call PYTHON_SIP_SET,QMAKE_CC,$(TARGET_CC),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CXX,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LINK,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LINK_SHLIB,$(TARGET_CXX),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_AR,$(TARGET_AR) cqs,$(@D))
Quoted 9 lines

package/python-sip/Config.in

Quoted 6 lines
package/python-sip/Config.in new file +6 -0
+    $(call PYTHON_SIP_SET,QMAKE_OBJCOPY,$(TARGET_OBJCOPY),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_RANLIB,$(TARGET_RANLIB),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_STRIP,$(TARGET_STRIP),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
+    $(call PYTHON_SIP_SET,QMAKE_LFLAGS,$(TARGET_LDFLAGS),$(@D))

Ditto one tab for indentation.

This part is no more needed too

Quoted 7 lines

package/python-sip/Config.in

Quoted 3 lines
package/python-sip/Config.in new file +3 -0
+
+    ( cd $(@D); \
+	cp specs/linux-$(PYTHON_SIP_PLATFORM)-g++ specs;  \

This doesn't really have to be in the cd $(@D), you can do:

	cp $(@D)/specs/linux-.... $(@D)/specs

No because configure.py generates some files in a current directory (ie. buildroot root dir)

Quoted 23 lines
Quoted 8 lines
package/python-sip/Config.in new file +7 -0
+	$(HOST_DIR)/usr/bin/python configure.py \
+		-b $(TARGET_DIR)/usr/bin \
+		-d $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+		-e $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)  \
+		-v $(TARGET_DIR)/usr/share/sip \
+		-i $(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
+		-c $(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/config \

package/python-sip/Config.in

Quoted 10 lines
package/python-sip/Config.in new file +10 -0
+		-p linux-$(PYTHON_SIP_PLATFORM)-g++; \
+    )
+endef
+
+define PYTHON_SIP_INSTALL_TARGET_CMDS
+    $(TARGET_CONFIGURE_OPTS) $(MAKE) install -C $(@D)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))

So overall the main question is why do we need both a host and a target package? Is it a code generator that should be only on the host? Something else?

Quoted 3 lines

Thanks,

Thomas

Gwen