From patchwork Thu Oct 3 20:01:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 280407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 78D822C0095 for ; Fri, 4 Oct 2013 06:01:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D7CB2930AB; Thu, 3 Oct 2013 20:01:37 +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 H0sqWxOwIXAa; Thu, 3 Oct 2013 20:01:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 472AC930AF; Thu, 3 Oct 2013 20:01:37 +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 D420B1BFA57 for ; Thu, 3 Oct 2013 20:01:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CEF828D521 for ; Thu, 3 Oct 2013 20:01:35 +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 LqkEGPOUbrgc for ; Thu, 3 Oct 2013 20:01:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs01.rockwellcollins.com (secvs01.rockwellcollins.com [205.175.225.240]) by whitealder.osuosl.org (Postfix) with ESMTPS id EBCFA8D3F4 for ; Thu, 3 Oct 2013 20:01:34 +0000 (UTC) Received: from nosuchhost.198.131.in-addr.arpa (HELO collinscrsmtp01.rockwellcollins.com) ([131.198.63.132]) by mail-virt.rockwellcollins.com with ESMTP; 03 Oct 2013 15:01:19 -0500 Received: from ares ([131.198.63.11]) by collinscrsmtp01.rockwellcollins.com (Lotus Domino Release 8.5.2FP2 HF162) with ESMTP id 2013100315011819-5194890 ; Thu, 3 Oct 2013 15:01:18 -0500 From: Ryan Barnett To: buildroot@busybox.net Date: Thu, 3 Oct 2013 15:01:01 -0500 Message-Id: <1380830465-16083-2-git-send-email-rjbarnet@rockwellcollins.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1380830465-16083-1-git-send-email-rjbarnet@rockwellcollins.com> References: <1380830465-16083-1-git-send-email-rjbarnet@rockwellcollins.com> X-MIMETrack: Itemize by SMTP Server on CollinsCRSMTP01/CedarRapids/Collins/Rockwell(Release 8.5.2FP2 HF162|May 16, 2011) at 10/03/2013 03:01:18 PM, Serialize by Router on CollinsCRSMTP01/CedarRapids/Collins/Rockwell(Release 8.5.2FP2 HF162|May 16, 2011) at 10/03/2013 03:01:19 PM, Serialize complete at 10/03/2013 03:01:19 PM X-TNEFEvaluated: 1 Subject: [Buildroot] [PATCH 1/5] python-pyasn: 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 Signed-off-by: Ryan Barnett --- The definition of CFLAGS/LDFLAGS/LDSHARED is necessary since the compilation of won't work correctly using either TARGET_CONFIGURE_OPTS because it won't link against the correct python library. Also using python-distutilcross doesn't work as the setup.py doesn't understand the -x option. --- package/Config.in | 1 + package/python-pyasn/Config.in | 13 +++++++++++ package/python-pyasn/python-pyasn.mk | 38 ++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 0 deletions(-) create mode 100644 package/python-pyasn/Config.in create mode 100644 package/python-pyasn/python-pyasn.mk diff --git a/package/Config.in b/package/Config.in index b7fdb89..3592cb7 100644 --- a/package/Config.in +++ b/package/Config.in @@ -396,6 +396,7 @@ source "package/python-meld3/Config.in" source "package/python-netifaces/Config.in" source "package/python-nfc/Config.in" source "package/python-protobuf/Config.in" +source "package/python-pyasn/Config.in" source "package/python-pygame/Config.in" source "package/python-pyparsing/Config.in" source "package/python-pyro/Config.in" diff --git a/package/python-pyasn/Config.in b/package/python-pyasn/Config.in new file mode 100644 index 0000000..a352fe4 --- /dev/null +++ b/package/python-pyasn/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_PYTHON_PYASN + bool "python-pyasn" + depends on BR2_PACKAGE_PYTHON + depends on BR2_INSTALL_LIBSTDCPP + help + PyASN is a Python extension module that enables you to + perform very fast IP address to Autonomous System Number + lookups. + + https://code.google.com/p/pyasn/ + +comment "python-pyasn requires C++ support in toolchain" + depends on !BR2_INSTALL_LIBSTDCPP diff --git a/package/python-pyasn/python-pyasn.mk b/package/python-pyasn/python-pyasn.mk new file mode 100644 index 0000000..4579f38 --- /dev/null +++ b/package/python-pyasn/python-pyasn.mk @@ -0,0 +1,38 @@ +################################################################################ +# +# python-pyasn +# +################################################################################ + +PYTHON_PYASN_VERSION = 1.2 +PYTHON_PYASN_SOURCE = PyASN-$(PYTHON_PYASN_VERSION).zip +PYTHON_PYASN_SITE = https://pyasn.googlecode.com/files +PYTHON_PYASN_LICENSE = LGPL + +PYTHON_PYASN_DEPENDENCIES = python + +define PYTHON_PYASN_EXTRACT_CMDS + unzip -d $(@D) $(DL_DIR)/$(PYTHON_PYASN_SOURCE) + mv $(@D)/PyASN-$(PYTHON_PYASN_VERSION)/* $(@D) + $(RM) -r $(@D)/PyASN-$(PYTHON_PYASN_VERSION) +endef + +define PYTHON_PYASN_BUILD_CMDS + (cd $(@D); \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \ + CXX="$(TARGET_CXX)" \ + CXXFLAGS="$(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include" \ + LDSHARED="$(TARGET_CC) -shared" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \ + $(HOST_DIR)/usr/bin/python setup.py build_ext \ + --include-dirs=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \ + ) + (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build) +endef + +define PYTHON_PYASN_INSTALL_TARGET_CMDS + (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr) +endef + +$(eval $(generic-package))