From patchwork Wed Mar 11 10:54:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Vanbever X-Patchwork-Id: 1252783 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=essensium.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=essensium.com header.i=@essensium.com header.a=rsa-sha256 header.s=google header.b=Yw5tVShA; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48cpm14qR8z9sPF for ; Wed, 11 Mar 2020 21:56:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 83B4721FFB; Wed, 11 Mar 2020 10:55:58 +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 RzIFktyi81Rb; Wed, 11 Mar 2020 10:55:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id EE2012210F; Wed, 11 Mar 2020 10:55:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 411FF1BF313 for ; Wed, 11 Mar 2020 10:55:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3A2A62210F for ; Wed, 11 Mar 2020 10:55:55 +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 i+KlX7VkT-aM for ; Wed, 11 Mar 2020 10:55:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by silver.osuosl.org (Postfix) with ESMTPS id 9A9A021FFB for ; Wed, 11 Mar 2020 10:55:53 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id p2so1977947wrw.7 for ; Wed, 11 Mar 2020 03:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essensium.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mKDAlM3PDJsDcUbnWcMM95eQsR7MD+dW+JYGkZYKod4=; b=Yw5tVShAfwzust7V9Nk9tYa+7KNzC6tQ8RKG8l2r28s1dXAcvyYQPW7bNHgil3dfIi fkVMnu8XEzAVwqV3rjg/dJznEftQaIh8zkJZSTbhy0pcLIqD/7ZTBFkTeL8LL5td5FYz g0JaEYyIGT/+Q20k0CCZXHkqSGcATykRqqaiiZAs7DSbg8Yaz5FCWV/WBAIf6IdPvKhM 2EuSfDHIV895Akn0ZG1l3+mjGr0NcojuwT2FbnoEXQEQ5aRTiGSstHOliqhslDSYfCpD fhljOkItDzgXrWKp9yEEDr5tM7H2nwPim8/o9i83w0GYm5uAI7eTZ4XKGXZPJM1/fIHo cg/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mKDAlM3PDJsDcUbnWcMM95eQsR7MD+dW+JYGkZYKod4=; b=hioNaDbdNZZ9nu7j/QxWfG6FsSU8pe4KG8JuF/pkafHrMLFsCjgR+dN90XwV9Y1Y8B Y7G28h6Yuk8KR8PTg9WDbaJ7rJhqan9UD0yqUcNnpppGWapvJkVdJBi6qTh6Q0I4CYZT R/vnaZR4EivEvEdlavLDT01XAqIigbhc06U0sHKO3xFqdo5HcQcwu6D6DUrK0ZOyctkY n90KMTEZyf/11VJEjh3kHIhRua0y+g59Jd/ANZlbvsEr/LnQ8H70OR3xzkELewVWelZW lViX4J0OTD+FpcA+W1KBacYV9FmsVVRGp/qEZLVn535lDqO6A027SGEtEONRMdgbMH7J cGFw== X-Gm-Message-State: ANhLgQ0Px4ws4c+Imqz/y3gA18059irWR72RDsXDA8CP7nQuu+Y2kkBs tvt7lOLPW5+jlUz/2NsOPRYJpRww3MI= X-Google-Smtp-Source: ADFU+vuALmYPvnde928Y+F6DuUugTrOS/eSaHvt7aMdQDch7NqBn0vrvDXWEyidCUkcSoHne2n22ow== X-Received: by 2002:adf:eece:: with SMTP id a14mr3987630wrp.334.1583924151389; Wed, 11 Mar 2020 03:55:51 -0700 (PDT) Received: from localhost.localdomain (ip-188-118-3-185.reverse.destiny.be. [188.118.3.185]) by smtp.gmail.com with ESMTPSA id i9sm8072485wmd.37.2020.03.11.03.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 03:55:50 -0700 (PDT) From: Frank Vanbever To: buildroot@buildroot.org Date: Wed, 11 Mar 2020 11:54:46 +0100 Message-Id: <20200311105447.23808-3-frank.vanbever@essensium.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200311105447.23808-1-frank.vanbever@essensium.com> References: <20200228163917.10596-1-frank.vanbever@essensium.com> <20200311105447.23808-1-frank.vanbever@essensium.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 3/4] package/python-iptables: use installed iptables by default X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Weber , Frank Vanbever , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" python-iptables depends on ctypes.util.find_library() which does not work due to the absence of gcc and friends on target. The location of the xtables library and the iptables modules can be configured through environment variables. Within the scope of buildroot we can determine what these should be at build time and replace the calls to os.getenv() with the correct value. Fixes: https://bugs.busybox.net/show_bug.cgi?id=12271 Signed-off-by: Frank Vanbever --- v2 -> v3: - None v1 -> v2: - Remove unnecessary continuation in pre-build hook - Change sed separator to % Signed-off-by: Frank Vanbever --- package/python-iptables/Config.in | 2 +- package/python-iptables/python-iptables.mk | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package/python-iptables/Config.in b/package/python-iptables/Config.in index a35577bad3..0e24283d06 100644 --- a/package/python-iptables/Config.in +++ b/package/python-iptables/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_PYTHON_IPTABLES bool "python-iptables" depends on !BR2_STATIC_LIBS - select BR2_PACKAGE_IPTABLES # runtime dependency + select BR2_PACKAGE_IPTABLES help Python bindings for iptables. diff --git a/package/python-iptables/python-iptables.mk b/package/python-iptables/python-iptables.mk index 66e478a89a..38c6ee3950 100644 --- a/package/python-iptables/python-iptables.mk +++ b/package/python-iptables/python-iptables.mk @@ -9,5 +9,14 @@ PYTHON_IPTABLES_SITE = https://files.pythonhosted.org/packages/08/5e/16a5ca35c42 PYTHON_IPTABLES_SETUP_TYPE = setuptools PYTHON_IPTABLES_LICENSE = Apache-2.0 PYTHON_IPTABLES_LICENSE_FILES = NOTICE +PYTHON_IPTABLES_DEPENDENCIES = iptables + +define PYTHON_IPTABLES_SET_XTABLES_ENV_VARS + XTABLES_VERSION=`awk '/XTABLES_VERSION_CODE/ {print $$NF}' $(STAGING_DIR)/usr/include/xtables-version.h`; \ + sed -i "s%os.getenv(\"PYTHON_IPTABLES_XTABLES_VERSION\")%$$XTABLES_VERSION%" $(@D)/iptc/xtables.py + sed -i "s%os.getenv(\"XTABLES_LIBDIR\")%\"/usr/lib/xtables\"%" $(@D)/iptc/xtables.py +endef + +PYTHON_IPTABLES_PRE_BUILD_HOOKS += PYTHON_IPTABLES_SET_XTABLES_ENV_VARS $(eval $(python-package))