From patchwork Fri Aug 19 13:42:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Manuel_V=C3=B6gele?= X-Patchwork-Id: 660880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sG40L4Gj7z9sC4 for ; Fri, 19 Aug 2016 23:42:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 212948AAC8; Fri, 19 Aug 2016 13:42:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n8S6OlcX1hON; Fri, 19 Aug 2016 13:42:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E8B358AACD; Fri, 19 Aug 2016 13:42:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id F3DB81C0FFC for ; Fri, 19 Aug 2016 13:42:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EDF24C08C0 for ; Fri, 19 Aug 2016 13:42:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MBvcnDAyZ5lY for ; Fri, 19 Aug 2016 13:42:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ccn.li (ccn.li [78.47.166.189]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A1D46C08B6 for ; Fri, 19 Aug 2016 13:42:32 +0000 (UTC) Received: from localhost.localdomain (unknown [176.4.54.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ccn.li (Postfix) with ESMTPSA id BDF693CD1E for ; Fri, 19 Aug 2016 13:42:29 +0000 (UTC) From: =?UTF-8?q?Manuel=20V=C3=B6gele?= To: buildroot@buildroot.org Date: Fri, 19 Aug 2016 15:42:25 +0200 Message-Id: <20160819134225.1490-3-develop@manuel-voegele.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160819134225.1490-1-develop@manuel-voegele.de> References: <20160819134225.1490-1-develop@manuel-voegele.de> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] python-pyqt5: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Manuel Vögele --- package/Config.in | 1 + .../0001-configure-skip-qtdetail.patch | 29 +++++++ package/python-pyqt5/Config.in | 23 ++++++ package/python-pyqt5/python-pyqt5.hash | 3 + package/python-pyqt5/python-pyqt5.mk | 88 ++++++++++++++++++++++ 5 files changed, 144 insertions(+) create mode 100644 package/python-pyqt5/0001-configure-skip-qtdetail.patch create mode 100644 package/python-pyqt5/Config.in create mode 100644 package/python-pyqt5/python-pyqt5.hash create mode 100644 package/python-pyqt5/python-pyqt5.mk diff --git a/package/Config.in b/package/Config.in index 1e51a45..c4b4ed1 100644 --- a/package/Config.in +++ b/package/Config.in @@ -734,6 +734,7 @@ menu "External python modules" source "package/python-pyparted/Config.in" source "package/python-pypcap/Config.in" source "package/python-pyqt/Config.in" + source "package/python-pyqt5/Config.in" source "package/python-pyratemp/Config.in" source "package/python-pyro/Config.in" source "package/python-pyroute2/Config.in" diff --git a/package/python-pyqt5/0001-configure-skip-qtdetail.patch b/package/python-pyqt5/0001-configure-skip-qtdetail.patch new file mode 100644 index 0000000..2e7b331 --- /dev/null +++ b/package/python-pyqt5/0001-configure-skip-qtdetail.patch @@ -0,0 +1,29 @@ +Do not run qtdetail + +qtdetail is a tool that generates qtdetail.out. Since this program is +cross-compiled, it's not possible to run it on the host. + +Consequently, python-pyqt5.mk generates the qtdetail.out file before +calling configure.py. + +Therefore, this patch makes sure that the pre-generated qtdetail.out +file is kept, and that qtdetail is not executed. + +Signed-off-by: Gwenhael Goavec-Merou +Signed-off-by: Sergey Kostanbaev +--- +Index: PyQt5_gpl-5.7/configure.py +=================================================================== +--- PyQt5_gpl-5.7.orig/configure.py ++++ PyQt5_gpl-5.7/configure.py +@@ -672,10 +672,6 @@ int main(int argc, char **argv) + if cmd is None: + 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) +- + if not os.access(out_file, os.F_OK): + error("%s failed to create %s. Make sure your Qt installation is correct." % (cmd, out_file)) + diff --git a/package/python-pyqt5/Config.in b/package/python-pyqt5/Config.in new file mode 100644 index 0000000..6dcdd84 --- /dev/null +++ b/package/python-pyqt5/Config.in @@ -0,0 +1,23 @@ +comment "python-pyqt5 needs a toolchain w/ C++, threads" + depends on BR2_USE_MMU + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_PYTHON_PYQT5 + bool "python-pyqt5" + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS # qt + depends on BR2_USE_MMU # qt + select BR2_PACKAGE_QT5 + select BR2_PACKAGE_PYTHON_SIP + help + PyQt4 for Qt Embedded 4 bindings. + + http://www.riverbankcomputing.com/software/pyqt/ + +if BR2_PACKAGE_PYTHON_PYQT5 + +config BR2_PACKAGE_PYTHON_PYQT5_ARCH_USES_QREAL_FLOAT + bool + default y if BR2_arm || BR2_armeb + default y if BR2_sh4 || BR2_sh4eb || BR2_sh4a || BR2_sh4aeb +endif diff --git a/package/python-pyqt5/python-pyqt5.hash b/package/python-pyqt5/python-pyqt5.hash new file mode 100644 index 0000000..2a7d05b --- /dev/null +++ b/package/python-pyqt5/python-pyqt5.hash @@ -0,0 +1,3 @@ +# md5 from http://http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.7, sha256 locally computed +md5 e3dc21f31fd714659f0688e1eb31bacf PyQt5_gpl-5.7.tar.gz +sha256 892693ba5f79989abb2061dad2d5c4e6f127e9dd3240f73f8220c7152cd35b05 PyQt5_gpl-5.7.tar.gz diff --git a/package/python-pyqt5/python-pyqt5.mk b/package/python-pyqt5/python-pyqt5.mk new file mode 100644 index 0000000..a2defa3 --- /dev/null +++ b/package/python-pyqt5/python-pyqt5.mk @@ -0,0 +1,88 @@ +################################################################################ +# +# python-pyqt5 +# +################################################################################ + +PYTHON_PYQT5_VERSION = 5.7 +PYTHON_PYQT5_SOURCE = PyQt5_gpl-$(PYTHON_PYQT5_VERSION).tar.gz +PYTHON_PYQT5_SITE = http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-$(PYTHON_PYQT5_VERSION) +PYTHON_PYQT5_LICENSE = GPLv3 +PYTHON_PYQT5_LICENSE_FILES = LICENSE + +PYTHON_PYQT5_DEPENDENCIES = python-sip host-python-sip qt5base + +ifeq ($(BR2_PACKAGE_PYTHON),y) +PYTHON_PYQT5_PYTHON_DIR = python$(PYTHON_VERSION_MAJOR) +PYTHON_PYQT5_RM_PORT_BASE = port_v3 +else ifeq ($(BR2_PACKAGE_PYTHON3),y) +PYTHON_PYQT5_PYTHON_DIR = python$(PYTHON3_VERSION_MAJOR) +PYTHON_PYQT5_RM_PORT_BASE = port_v2 +endif + +PYTHON_PYQT5_QTDETAIL_LICENSE = Open Source + +PYTHON_PYQT5_QTDETAIL_TYPE = shared + +# Turn off features that aren't available in current qt configuration + +PYTHON_PYQT5_QTDETAIL_DISABLE_FEATURES += $(if $(BR2_PACKAGE_OPENSSL),,PyQt_SSL) +PYTHON_PYQT5_QTDETAIL_DISABLE_FEATURES += $(if $(BR2_PACKAGE_QT5BASE_OPENGL),,PyQt_OpenGL) + +# PyQt_qreal_double must be disabled on a number of architectures that +# use float for qreal. +ifeq ($(BR2_PACKAGE_PYTHON_PYQT5_ARCH_USES_QREAL_FLOAT),y) +PYTHON_PYQT5_QTDETAIL_DISABLE_FEATURES += PyQt_qreal_double +endif + +define PYTHON_PYQT5_QTDETAIL + echo $(1) >> $(2)/qtdetail.out +endef + +# Since we can't run generate qtdetail.out by running qtdetail on target device +# we must generate the configuration. +define PYTHON_PYQT5_GENERATE_QTDETAIL + $(RM) -f $(1)/qtdetail.out + $(call PYTHON_PYQT5_QTDETAIL,$(PYTHON_PYQT5_QTDETAIL_LICENSE),$(1)) + $(call PYTHON_PYQT5_QTDETAIL,$(PYTHON_PYQT5_QTDETAIL_TYPE),$(1)) + $(foreach f,$(PYTHON_PYQT5_QTDETAIL_DISABLE_FEATURES), + $(call PYTHON_PYQT5_QTDETAIL,$(f),$(1)) \ + ) +endef + +PYTHON_PYQT5_CONF_OPTS = \ + --bindir $(TARGET_DIR)/usr/bin \ + --destdir $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT5_PYTHON_DIR)/site-packages \ + --qmake $(HOST_DIR)/usr/bin/qmake \ + --sysroot $(STAGING_DIR)/usr \ + -w --confirm-license \ + --no-designer-plugin \ + --no-docstrings \ + --no-sip-files + +define PYTHON_PYQT5_CONFIGURE_CMDS + $(call PYTHON_PYQT5_GENERATE_QTDETAIL,$(@D)) + (cd $(@D); \ + $(TARGET_MAKE_ENV) \ + $(TARGET_CONFIGURE_OPTS) \ + $(HOST_DIR)/usr/bin/python configure.py \ + $(PYTHON_PYQT5_CONF_OPTS) \ + ) +endef + +define PYTHON_PYQT5_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) +endef + +# __init__.py is needed to import PyQt5 +# __init__.pyc is needed if BR2_PACKAGE_PYTHON_PYC_ONLY is set +define PYTHON_PYQT5_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install + touch $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT5_PYTHON_DIR)/site-packages/PyQt5/__init__.py + $(RM) -rf $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT5_PYTHON_DIR)/site-packages/PyQt5/uic/$(PYTHON_PYQT5_RM_PORT_BASE) + PYTHONPATH="$(PYTHON_PATH)" \ + $(HOST_DIR)/usr/bin/python -c "import compileall; \ + compileall.compile_dir('$(TARGET_DIR)/usr/lib/$(PYTHON_PYQT5_PYTHON_DIR)/site-packages/PyQt5')" +endef + +$(eval $(generic-package))