From patchwork Wed Feb 26 14:26:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Vanbever X-Patchwork-Id: 1245090 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.133; helo=hemlock.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=Ny4N8qJ0; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48SJ7D2Kk2z9sPK for ; Thu, 27 Feb 2020 01:28:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 782918791E; Wed, 26 Feb 2020 14:28:05 +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 K5qpCRv8IcvK; Wed, 26 Feb 2020 14:28:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7526887874; Wed, 26 Feb 2020 14:28:00 +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 9E9901BF426 for ; Wed, 26 Feb 2020 14:27:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 93FBC2038B for ; Wed, 26 Feb 2020 14:27: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 qL4QkH4P9sEx for ; Wed, 26 Feb 2020 14:27:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by silver.osuosl.org (Postfix) with ESMTPS id 0A60D2010F for ; Wed, 26 Feb 2020 14:27:53 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id l5so3289354wrx.4 for ; Wed, 26 Feb 2020 06:27:52 -0800 (PST) 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=0pzT5Lg9twirSBprkIMmWcY0lN2gXFeCOOY3z3Z8xjY=; b=Ny4N8qJ048zuIPBIh+z1CG2tfbUoq8hqs2GvZlSs4mql+4Qyd4foTpKSubqz7EnXDS 97xJ0M7aFWjJpAm16l+1/tS5G+FszLlw4I9qcK93R/bvb7aAxvZJ1yFKXsPB4EXkyNqe mjiy8QOodLHosrDMR6nQlgZsKZhaT951WaBsTMujkooKVFmx+xb/Ct/P1ar/tydyRabx 0tAjMyglB9FluDFIrUnEx4CMueCCMWAbvdtaFM0zN1JocEU+nNXf4CNMHN2uHqftaE1Q tQvyCqI8NGl0IiMycx1PQleiVvymn2Ur/QagGmb3n+MAvoqmVhO+8/xwirG39Ao4XMaj s4Qw== 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=0pzT5Lg9twirSBprkIMmWcY0lN2gXFeCOOY3z3Z8xjY=; b=Uxz3/eDcovUkykW0qS43N3l2Edu9QFM9Pr/CAO98Pf+A0LQZqFi1f3o8FBizMJOJ1T UUat4s7zkcODIf3S+K1kVNSLmPplusLdGP7oqdxz47INs342rMbVRpH96JmtU6Vr6kKA VcANiQe4URaHoY56Hna83WgHEhybSwc3NiXwagXrWOV01PMJko9f0D+bqZRaGzkQd8xK qzXCjtiXhuZBifpaxAhceM/LYkpO2d/A8OLXS8h/UFitLrnKvD6IotgNYBENiB/JMMLw FEU6xiJSBtZjNGDpvU9mIs/kCG3qspu5h6zzZ6G4i1loyWgBmBrtP/7g8skqPJbwPlvz A0rQ== X-Gm-Message-State: APjAAAUYb/Dv40aGFIYlqnPJOUQktcZYiWLLzYtoyA7jrb0Amn2p4gvJ /AyV0KDVfDzFo+o90LZOgQjUTWaSG5TxQg== X-Google-Smtp-Source: APXvYqx1riBz9VjIc1xTgU7jcX9cJ+4oXJ7aIrMzNKIeHwrUBWwFF9TssZ07o/2IQhHZ57Gtc0W82Q== X-Received: by 2002:a05:6000:188:: with SMTP id p8mr5796458wrx.336.1582727271191; Wed, 26 Feb 2020 06:27:51 -0800 (PST) Received: from wintermute.local.ess-mail.com (ip-188-118-3-185.reverse.destiny.be. [188.118.3.185]) by smtp.gmail.com with ESMTPSA id q12sm3643830wrg.71.2020.02.26.06.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 06:27:50 -0800 (PST) From: Frank Vanbever To: buildroot@buildroot.org Date: Wed, 26 Feb 2020 15:26:17 +0100 Message-Id: <20200226142617.4170-3-frank.vanbever@essensium.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226142617.4170-1-frank.vanbever@essensium.com> References: <20200226142617.4170-1-frank.vanbever@essensium.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] 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 --- 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..086d5b2457 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))