From patchwork Sat Oct 19 13:46:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Kostanbaev X-Patchwork-Id: 284873 X-Patchwork-Delegate: patrickdepinguin+buildroot@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id E9EA52C00BD for ; Sun, 20 Oct 2013 00:47:04 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 77CBB32CDD; Sat, 19 Oct 2013 13:47:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4kfWkJydN1yX; Sat, 19 Oct 2013 13:46:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 21CBC32CD3; Sat, 19 Oct 2013 13:46:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 84DC51C26FC for ; Sat, 19 Oct 2013 13:46:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 815CF84246 for ; Sat, 19 Oct 2013 13:46:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZWF3YlzMtGG0 for ; Sat, 19 Oct 2013 13:46:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id 268298B2AF for ; Sat, 19 Oct 2013 13:46:54 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id ev20so1628959lab.8 for ; Sat, 19 Oct 2013 06:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PcdnKfvIx9WnlL8V2wSitUzzCw6snIoB1CfsCbAgJck=; b=Jmh/0r8ngV/7kePMk/g4Hi7bq8Gnj/nOxtd1+KjBSrlm72VcmHzrr1OYS/RK5WqY0w D/3TG1sjaEUrK7O2WbEkXZdmkg8sF4UtgAPJyd0mNN7tzxzgKhs9dDHIUo+p0P8f0ODf JNSKqBo2dj+4o9f5V9u8wXu67NX97/gby75ik3TLPWLDaKi9+YGXBX+USNQLLl/eVtLU F6O/cXjeUfUKd8RMh5NqqYi2U6yq3EpDvbvvvvLgFlArsba9Rgt2oN4el8cBl57rcq08 nCIu828obfbeXTyPmPCSHjU9Lc333CesPF0NtVG/kPeGvEUCRqG+0XqEzhUh/7w8xv8g tghQ== X-Received: by 10.112.159.166 with SMTP id xd6mr6203944lbb.22.1382190413245; Sat, 19 Oct 2013 06:46:53 -0700 (PDT) Received: from serg-HP-Z400-Workstation.office.micex.com ([91.208.232.124]) by mx.google.com with ESMTPSA id ac2sm5381549lbc.10.2013.10.19.06.46.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 19 Oct 2013 06:46:53 -0700 (PDT) From: Sergey Kostanbaev To: buildroot@busybox.net Date: Sat, 19 Oct 2013 17:46:38 +0400 Message-Id: <1382190398-9885-1-git-send-email-sergey.kostanbaev@gmail.com> X-Mailer: git-send-email 1.8.3.2 Subject: [Buildroot] [PATCH] python-sip: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net SIP is needed for both PyQt generation on host and running any PyQt application on target. Signed-off-by: Sergey Kostanbaev --- Config.in | 3 ++ python-sip/Config.in | 8 ++++ python-sip/python-sip-configure.patch | 42 +++++++++++++++++++++++ python-sip/python-sip.mk | 62 ++++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) diff --git a/package/Config.in b/package/Config.in index a94cb62..db82265 100644 --- a/package/Config.in +++ b/package/Config.in @@ -157,6 +157,9 @@ source "package/qextserialport/Config.in" source "package/qjson/Config.in" source "package/qtuio/Config.in" source "package/qwt/Config.in" + +source "package/python-sip/Config.in" + endif source "package/qt5/Config.in" diff --git a/package/python-sip/Config.in b/package/python-sip/Config.in new file mode 100644 index 0000000..d9ee8d7 --- /dev/null +++ b/package/python-sip/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_PYTHON_SIP + bool "python-sip" + depends on BR2_PACKAGE_PYTHON + help + SIP is a tool for C/C++ libraries binding. It was developed + to create PyQt + + http://www.riverbankcomputing.com/software/sip/intro diff --git a/package/python-sip/python-sip-configure.patch b/package/python-sip/python-sip-configure.patch new file mode 100644 index 0000000..f7e5a67 --- /dev/null +++ b/package/python-sip/python-sip-configure.patch @@ -0,0 +1,42 @@ +Add cross compilation options for using satged python +config, libraries and includes + +Signed-off-by Sergey Kostanbaev +--- 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", diff --git a/package/python-sip/python-sip.mk b/package/python-sip/python-sip.mk new file mode 100644 index 0000000..80f7fa0 --- /dev/null +++ b/package/python-sip/python-sip.mk @@ -0,0 +1,62 @@ +################################################################################ +# +# python-sip +# +################################################################################ +PYTHON_SIP_VERSION = 4.15.3 +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_DEPENDENCIES = host-python-sip python +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 + + +ifeq ($(BR2_arm)$(BR2_armeb),y) +PYTHON_SIP_PLATFORM = arm +else +PYTHON_SIP_PLATFORM = +endif + +define PYTHON_SIP_SET + $(SED) '/$(1)[[:space:]]/c\$(1) = $(2)' $(3)/specs/linux-$(PYTHON_SIP_PLATFORM)-g++ +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)) + $(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)) + + ( cd $(@D); \ + cp specs/linux-$(PYTHON_SIP_PLATFORM)-g++ specs; \ + $(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 \ + -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)) +