From patchwork Sat Sep 30 22:16:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841648 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhRW4kFgz1yp7 for ; Sun, 1 Oct 2023 09:17:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6B13B81F5C; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6B13B81F5C X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NiQF-WTQ7WkD; Sat, 30 Sep 2023 22:17:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id A9B9883C6B; Sat, 30 Sep 2023 22:17:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A9B9883C6B X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id BA5F61BF5F5 for ; Sat, 30 Sep 2023 22:17:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9FB2A41B36 for ; Sat, 30 Sep 2023 22:17:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9FB2A41B36 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F7x90BJBo5ZM for ; Sat, 30 Sep 2023 22:17:35 +0000 (UTC) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6105B41B18 for ; Sat, 30 Sep 2023 22:17:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6105B41B18 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3231d6504e1so11272254f8f.2 for ; Sat, 30 Sep 2023 15:17:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112253; x=1696717053; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fYYVx43KH4uumtJ/YNGnY3LIz9V36fzdQjB/a0EMHwo=; b=heERVPeeUXiUP6proXZGbHRifrN/ocWpVSvjiD/PXL+u3HmiBK02ofPnD9UwWHA6in x9mYXTa3tcAAsZnWVC1uABDzhm6DRGy6WvVdMvtmEN8yZCrHkLXikv5tyd+B0HyhRKXC Lggkgz1dwK5BTia0c058hVTBFb19SXR7OQgfAwl8E4gOm+8527DgAeMsoN0EIqzzF7CW 7RNEsU1rzE+FL4t+pzdKvDqLlVPaHyO1n+7haupaawQWaYs4E2cDUkp7eYhB4atbzIJo eOJsLXr7sYZtwyL9nI58nwPl7o6oG+fzIuOhhKBUgTL9tGnbY9CmFU63nZhoGFWMiidt llmQ== X-Gm-Message-State: AOJu0Yz+tB+nbfAAjPZs8bhu8zBaKyDFKNVSWTFGuvZ6bXyE1cjX7Bkl 6XBNB5NZjIZnJzh+dkzL8WQWZFOnnQQ9r6dMNQ+p7Q== X-Google-Smtp-Source: AGHT+IGb2blTc/7dxUuunwYZH2D24r1oieKFHO9QLY7I86BO1xHJPsG3ElFWEz+CpyaZl+poGMNbKw== X-Received: by 2002:a5d:5b17:0:b0:31f:a4fa:130a with SMTP id bx23-20020a5d5b17000000b0031fa4fa130amr7718198wrb.14.1696112253287; Sat, 30 Sep 2023 15:17:33 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:32 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:24 +0200 Message-ID: <20230930221727.1458825-1-arnout@mind.be> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112253; x=1696717053; darn=buildroot.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fYYVx43KH4uumtJ/YNGnY3LIz9V36fzdQjB/a0EMHwo=; b=T/lpZn9GY4GTU7UpprfFc4CfJx122Xm7SokEwq05WoPfaIomjxx9GDTGTbo+G7MHVC 6nh+tYclG/cftqPnqV/T3/5P4R+FQdsSGdnpesMwJ6cGEqLcLbDbstiCYKt9QOPZbHS1 sz6AuI1mb7eQj7yotVhlXSlsp612EOcMjOuOH98i92KwDjjJGdg+lnC8xkLbHv9N7hCu rXyYIUekZVg+Rp9kH1B1b8e/D3XehpkiaU2u+K2tdKMum7EEG+eOHCrnWjBSsb0L+nd3 aFPdPdnvRdkSgEZSJGwl6T1kL/cZQy3Qgv5SjjpAzTzZQCiULa8fCNEvMaVfmebFwGoP /mrw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=T/lpZn9G Subject: [Buildroot] package/pkg-python.mk: refactor setup-type variables X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Most of the python-package infrastructure consists of a big conditional tree that sets various variables based on the package's setup type. Initially, this was quite OK, but since we have 7 different setup types now, some of which share some variables with others, it's becoming quite complicated and hard to read. This patch series refactors it so that the inner-python-package doesn't dispatch the setup type through a conditional tree, but instead does it with variable indirection, i.e. by using variables like $(PKG_PYTHON_$($(PKG)_SETUP_TYPE_UPPER)_ENV) The rist two patches are simple cleanups, removing variables that are not really needed. The third patch is a preparatory one that splits the build commands for target and host builds. This is necessary because we need to use different variables for the two, i.e. HOST_PKG_PYTHON_* for host build. The fourth and fifth patch each replace one variable from the conditional tree with an indirectly addressed one. The following three patches are needed because the ninth patch removes the PKG_PYTHON_*_OPTS variables, which were used in 3 packages. It is in fact not strictly needed to remove those variables, but IMHO they don't add sufficient value to keep them. I think it's better to handle the few special cases explicitly. The ninth patch replaces the remaining variables from the conditional tree with indirectly addressed ones. The conditional tree is now empty, and the error handling that was in there is made more explicit. The tenth patch edits the documentation to remove the references to the PKG_PYTHON_*_OPTS variables that were removed in the previous patch. This series adds lines rather than removing lines. That is because things are made more explicit, introducing per-setup-type variables where previously several setup types were (partially) reusing the pep517 variables. There are also some additional lines because of more line splitting. To test this series, I built all the python packages with one specific toolchain configuration, and I ran all runtime tests for python packages. One package failed to build: host-python-sip. It also fails on master. For the runtime tests, 14 of them failed, all of them also fail on master. The following changes since commit 7906272c39744e26ed73028725787aa3a4441c54: package/python-rtoml: migrate to setuptools-rust infrastructure (2023-09-29 22:02:31 +0200) are available in the Git repository at: git@gitlab.com:arnout/buildroot.git pkg-python-refactor-variables for you to fetch changes up to 89b33e004fc13e22a9c0bdcafcee245a97d2dd51: docs/manual: remove references to PKG_PYTHON_*_OPTS (2023-09-30 15:18:48 +0200) ---------------------------------------------------------------- Arnout Vandecappelle (Essensium/Mind) (10): package/pkg-python.mk: remove $(2)_PYTHON_INTERPRETER variable package/pkg-python.mk: remove _BASE_BUILD_OPTS variable package/pkg-python.mk: split the commands in a target and host section package/pkg-python.mk: replace $(_BASE_ENV) with $($(SETUP_TYPE)_ENV) package/pkg-python.mk: replace $(_BASE_BUILD_CMD) with $($(SETUP_TYPE)_BUILD_CMD) package/python-flit-core: instantiate _INSTALL_CMDS package/jailhouse: expand PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS package/i2c-tools: expand PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS package/pkg-python.mk: replace $(_BASE_INSTALL*_CMD) with $($(SETUP_TYPE)_INSTALL*_CMD) docs/manual: remove references to PKG_PYTHON_*_OPTS docs/manual/adding-packages-python.txt | 14 +------- package/i2c-tools/i2c-tools.mk | 6 ++-- package/jailhouse/jailhouse.mk | 7 +++- package/pkg-python.mk | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- package/python-flit-core/python-flit-core.mk | 9 +++-- 5 files changed, 173 insertions(+), 119 deletions(-) From patchwork Sat Sep 30 22:16:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841653 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhSj4pq7z1yp7 for ; Sun, 1 Oct 2023 09:18:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DE09783C89; Sat, 30 Sep 2023 22:18:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DE09783C89 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pPUKbFKKSRcG; Sat, 30 Sep 2023 22:18:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id E922C83CD5; Sat, 30 Sep 2023 22:18:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E922C83CD5 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BBBB11BF5F5 for ; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9096161096 for ; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9096161096 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JdD41khTWUEx for ; Sat, 30 Sep 2023 22:17:37 +0000 (UTC) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by smtp3.osuosl.org (Postfix) with ESMTPS id 876E861089 for ; Sat, 30 Sep 2023 22:17:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 876E861089 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-325e9cd483eso1545041f8f.2 for ; Sat, 30 Sep 2023 15:17:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112255; x=1696717055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z2LnfGGL1lzst98eVcFRvgbrVptQRqVkzPjS6u/mHa8=; b=ZU6v7GcY7/o90jtIIMZ5e5QLaFRi8yvuRvJor0bNf3oiq8F1ZjAA+c7sVs+8OIl87y zvfBGC98us2GNuULRvrEBAkb3sB43jgQYb5gh5eQqD8pzisntrWA3le4TdxGIVe1nY9A zmslLGuejB87wK6rkGZes8+1l0jKIipjO95t1HHNevdo/CCdQWntUnOCMXB/qcpB9eVd i0o88tJVOKtBzrhlNCF5YzFG6jmVYBrX5wktE47dILQvwM426A3mJX4L+/E/Nljel5q4 hBPlMBm236twoiHoNQkXU+fO8uZayBmMdBIKkrCtPBHhYikfnwj3Ogo50dHFlzPFf4iY BQYg== X-Gm-Message-State: AOJu0YxunewsEzfc5BJb7az8STVxay9QxyrMIjeWf7p+NKjM9S7QLAGG P4YX/JNA+d8QzkQJdGzpvaOk+zFGqBdRBDJG/yU/BQ== X-Google-Smtp-Source: AGHT+IEndOYSUXmDfmBezwdmiJ8w5LLa+94eChW5fui2e5N97i0CiIaJBYLOWZJLiu7tkYSPNMoheA== X-Received: by 2002:a5d:6188:0:b0:321:707a:8ca5 with SMTP id j8-20020a5d6188000000b00321707a8ca5mr6729158wru.38.1696112255168; Sat, 30 Sep 2023 15:17:35 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:34 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:26 +0200 Message-ID: <20230930221727.1458825-3-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112255; x=1696717055; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z2LnfGGL1lzst98eVcFRvgbrVptQRqVkzPjS6u/mHa8=; b=FwilTuwpH3kBnL9Rgy2UuzTH/qgvdXEIb0pt5ceQlqnf3ID/ZznQ61KV1gy0F6zhlG rG8OkCC5Yrh2ClT2hiD3D7zOkCmUiLFOkKt15C0KMN9LcqSKehZEq1FzqM2cA3LtJz3v +vClAMR/2lJ6T47jRFvpC24JzK5uZ4S/Y83JMAiyypFb3yXuyABTrYmse7y+P/+bi9Xy ZCrzu228G2EgP/XpGgpW8LLADZnzX6GXQgEfdj6iORygAPYaCVKj7k1o39GJvMTuEJ7a gTL2LRnNp6/TfmdziODeDtRrWe3kmmwYLxUB2orEmicxmtBDBG+jZQ6w5jVTw0JcoNwJ QqCA== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=FwilTuwp Subject: [Buildroot] [PATCH 02/10] package/pkg-python.mk: remove _BASE_BUILD_OPTS variable X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" This variable can just as well be merged into _BASE_BUILD_CMD. This is how it's done for the install opts. And anyway it's only used by distutils and nowhere else. Signed-off-by: Arnout Vandecappelle --- package/pkg-python.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index 1fc096efb3..eacf75c165 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -198,8 +198,7 @@ endif ifeq ($$($(2)_SETUP_TYPE),distutils) ifeq ($(4),target) $(2)_BASE_ENV = $$(PKG_PYTHON_DISTUTILS_ENV) -$(2)_BASE_BUILD_CMD = setup.py build -$(2)_BASE_BUILD_OPTS = $$(PKG_PYTHON_DISTUTILS_BUILD_OPTS) +$(2)_BASE_BUILD_CMD = setup.py build $$(PKG_PYTHON_DISTUTILS_BUILD_OPTS) $(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS) else @@ -335,7 +334,7 @@ define $(2)_BUILD_CMDS $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ $$($$(PKG)_BASE_BUILD_CMD) \ - $$($$(PKG)_BASE_BUILD_OPTS) $$($$(PKG)_BUILD_OPTS)) + $$($$(PKG)_BUILD_OPTS)) endef endif From patchwork Sat Sep 30 22:16:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841650 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhS01J3qz1yp7 for ; Sun, 1 Oct 2023 09:18:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1D70C83CC2; Sat, 30 Sep 2023 22:18:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1D70C83CC2 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k1xy-WqCYo5y; Sat, 30 Sep 2023 22:18:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 17AB883CBD; Sat, 30 Sep 2023 22:18:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 17AB883CBD X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AB2AB1BF5F5 for ; Sat, 30 Sep 2023 22:17:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 802534168D for ; Sat, 30 Sep 2023 22:17:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 802534168D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AIRiI8dtfIsU for ; Sat, 30 Sep 2023 22:17:38 +0000 (UTC) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3461C4015F for ; Sat, 30 Sep 2023 22:17:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3461C4015F Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31f71b25a99so15179317f8f.2 for ; Sat, 30 Sep 2023 15:17:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112256; x=1696717056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E0sm5javS5N8tXpUiAC+G0weZxljWFkvTSc4tXNjv9c=; b=MqCfkAYhAu3ZH9+DrT9WKXM0OHanaoHyfYr6ARLXfq7y3zv2wyET2ezaSV6PE1ZYMW jho4+84GZ7qKYGztwRdx4MG9VLWer+KEbAha6LXB+vo1f/Eho4ohV2e95nYsTonJNyyO y5orLlYDxVZ+p/qoebCEkpBlLT1p9J/34UILLWNYn9oGIn4QitK78vQleQBkfjM0qoFN JuwB87WstAbMgjWHhoGZ4Yus4C/Iz/ZTNXATTTqkDuQQRuk1NFzzhlDOkU/p0OU9SqWK i1Dk0B7+Nt0/xQlusVc1yYV8nt9KfHXbtI7uzMiro07rtgT4w3WlhGDtYf5yTOAynGUj fFzw== X-Gm-Message-State: AOJu0YzA0RcnBlbdhYYtZ8R/7H/DQpnNI2/1AEV+OdniITPvLu6jGi6t KkFiqUbQr1HCF+rva34e5+ZzyJYmj86kTTFqpQUx3Q== X-Google-Smtp-Source: AGHT+IH3APoPmNXfZbvBi1EJQ38eXZmioTIKj5c3wEt6lnWyzFyrlMhRR7bEKvVWpwb223VEIui65g== X-Received: by 2002:adf:f083:0:b0:31d:3669:1c55 with SMTP id n3-20020adff083000000b0031d36691c55mr6463257wro.65.1696112256203; Sat, 30 Sep 2023 15:17:36 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:35 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:27 +0200 Message-ID: <20230930221727.1458825-4-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112256; x=1696717056; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E0sm5javS5N8tXpUiAC+G0weZxljWFkvTSc4tXNjv9c=; b=eJmBB/s7WrZEe5KTUQJ1hmG5XHtq5qrapsF96ymRhyiP89/Ht1mVMoqITJTaFiEgrk GKip4YJjad1IBPWFBBUPFaL5eBUoaIMnLt9utKTTejJTaBEzoQsQeLMyjWnxlWH75mtV /4T3wlPqZcMmOcUKi8UhYMngEt6ItCo0zJwzEODMJyksNFAgfpgqD8mpLjpDTX1h4B/U vLkRTqDP8dzvWk6rbNXH8WE1fZoXUZKMd/0tbCEXXX7LQayvD8XzFMx6g6TTsQrqkT3x R1Yd1uxUjevzh4IhWZmXbLcHIp6VV9713mCMh59qyqdfDLXIsENu2ZlGy9ldG/D4KDek n8FA== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=eJmBB/s7 Subject: [Buildroot] [PATCH 03/10] package/pkg-python.mk: split the commands in a target and host section X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Only define the _CMDS variables that are relevant for the target resp. host variant. Duplicate the _BUILD_CMDS. This will allow us to differentiate part of the _BUILD_CMDS definition in a follow-up patch. Signed-off-by: Arnout Vandecappelle --- package/pkg-python.mk | 47 ++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index eacf75c165..c1640d71bb 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -324,6 +324,7 @@ $(2)_DOWNLOAD_POST_PROCESS = cargo $(2)_DOWNLOAD_DEPENDENCIES = host-rustc endif # SETUP_TYPE +ifeq ($(4),target) # # Build step. Only define it if not already defined by the package .mk # file. @@ -338,20 +339,6 @@ define $(2)_BUILD_CMDS endef endif -# -# Host installation step. Only define it if not already defined by the -# package .mk file. -# -ifndef $(2)_INSTALL_CMDS -define $(2)_INSTALL_CMDS - (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ - $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_INSTALL_CMD) \ - $$($$(PKG)_INSTALL_OPTS)) -endef -endif - # # Target installation step. Only define it if not already defined by # the package .mk file. @@ -380,6 +367,38 @@ define $(2)_INSTALL_STAGING_CMDS endef endif +else # host + +# +# Host build step. Only define it if not already defined by the package .mk +# file. +# +ifndef $(2)_BUILD_CMDS +define $(2)_BUILD_CMDS + (cd $$($$(PKG)_BUILDDIR)/; \ + $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(HOST_DIR)/bin/python3 \ + $$($$(PKG)_BASE_BUILD_CMD) \ + $$($$(PKG)_BUILD_OPTS)) +endef +endif + +# +# Host installation step. Only define it if not already defined by the +# package .mk file. +# +ifndef $(2)_INSTALL_CMDS +define $(2)_INSTALL_CMDS + (cd $$($$(PKG)_BUILDDIR)/; \ + $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(HOST_DIR)/bin/python3 \ + $$($$(PKG)_BASE_INSTALL_CMD) \ + $$($$(PKG)_INSTALL_OPTS)) +endef +endif + +endif # host / target + # Call the generic package infrastructure to generate the necessary # make targets $(call inner-generic-package,$(1),$(2),$(3),$(4)) From patchwork Sat Sep 30 22:16:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841652 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhSS3rV1z1yp7 for ; Sun, 1 Oct 2023 09:18:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9E8B783CA9; Sat, 30 Sep 2023 22:18:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9E8B783CA9 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dqHly-G1ustb; Sat, 30 Sep 2023 22:18:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 9AC9F83CBA; Sat, 30 Sep 2023 22:18:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9AC9F83CBA X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 067951BF86C for ; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D1BCB4015F for ; Sat, 30 Sep 2023 22:17:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D1BCB4015F X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cA48kx9V6AvX for ; Sat, 30 Sep 2023 22:17:39 +0000 (UTC) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by smtp2.osuosl.org (Postfix) with ESMTPS id D00204168B for ; Sat, 30 Sep 2023 22:17:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D00204168B Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-31fa15f4cc6so14594959f8f.2 for ; Sat, 30 Sep 2023 15:17:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112257; x=1696717057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MY8z4hCI2vGdJpkYi6ghxDNyaDi4gEYy3tIDl4XStp8=; b=TdZm1YOc2K8/CMc/Wmi7cN+De78YgxO8KY0FTIv0yexV1eeLs3KQ9plzT8PPCGAOxP NkuV5nkWxTl0FKT+lF/XJIGG5cNur+emI0rKKAMcAGzmtjG1o6Zc8MAOUXvaJu1stBRi RikG0a7HlNQtfNHyP81oWMx5POSbVUivuzNImtmRpySbVhq5egx6jZdBKtk/FYoFM1Dc sNlNaHSPOqSzpwhQwCFls6g2Vw3+GbKx/BCdHPym0CyZXCkR8gesobYpDPYsbTZNmaol h/CkzwG1JS9bBT5r29Ttye8vwCTV1znS4pAiQ7236pGv5WB5eGT+j71yTyt45BbiE67n Ny3w== X-Gm-Message-State: AOJu0YwToYsScHUqUN2C9y9cGzlKJIW6PfnEr1w+5+CdbWHhYCCe9y/+ FntPzyaeQjD0Dz+uXygds4FXbLwCwZarLNfmHDmiAQ== X-Google-Smtp-Source: AGHT+IG+V9J55N3npGL0FB+Vl0bttufodsQoTFoNo4KNCYkUWXgd9NUyOB7O40qy/RRT02GW6cUsGg== X-Received: by 2002:adf:e892:0:b0:319:731f:748c with SMTP id d18-20020adfe892000000b00319731f748cmr6670164wrm.34.1696112257002; Sat, 30 Sep 2023 15:17:37 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:36 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:28 +0200 Message-ID: <20230930221727.1458825-5-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112257; x=1696717057; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MY8z4hCI2vGdJpkYi6ghxDNyaDi4gEYy3tIDl4XStp8=; b=BssxrnI5THNNl2LYx6NCVVttW5Wl2ZhbXCfjIP4g56Atqp88++Mx8qNwN9uZkLO13E SRNwtZ5n/hja6I70WE+KDIc3yxfNmcwKlz0fW1/4JXIOEC09KRBjhvI9JYp2aaL1g1Vs PL08Orvl2FaWYd7JXluakX6xXat278RPX9BRghuMbEC2P3v9mV44bjniDKeANXZtPE3u SaKMKmjSlT+EE/V/jWkM5emXt3/fxX0wHDtZEaoNBLWHncFcePDMzZmesyUskIuWW2yZ oUbB88emeDf5tEfQh0YmFdUaYhL5BuEkr2459OcmMoGITUTHX6LEuVwaP0rvKmUmUPHD +SCQ== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=BssxrnI5 Subject: [Buildroot] [PATCH 04/10] package/pkg-python.mk: replace $(_BASE_ENV) with $($(SETUP_TYPE)_ENV) X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The _BASE_ENV variable is set based on the setup type, and only based on the setup type. Because of this, we have a large conditional tree in inner-python-package which makes things hard to read. Rather than conditions, it's also possible to use indirect variables. Concretely, we can use $(PKG_PYTHON_$($(PKG)_SETUP_TYPE)_ENV) instead of $($(PKG)_BASE_ENV) to dispatch to the right ENV variable. Once we do the same for all other variables that are set in the condition tree, we'll be able to remove the condition tree entirely. Because $($(PKG)_SETUP_TYPE) is lowercase (e.g. 'setuptools' or 'pep517'), while the existing _ENV variables have uppercase names (e.g. PKG_PYTHON_SETUPTOOLS_ENV), we need to convert the setup type to uppercase. Introduce the variable $(PKG)_SETUP_TYPE_UPPER for this. flit was reusing the _BASE_ENV definition from pep517, and flit-bootstrap also didn't have its own _ENV definition yet, so those have to be added. Signed-off-by: Arnout Vandecappelle --- package/pkg-python.mk | 52 ++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index c1640d71bb..8e8955f3c4 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -158,6 +158,18 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages +# Target flit packages +PKG_PYTHON_FLIT_ENV = \ + $(PKG_PYTHON_PEP517_ENV) + +# Host flit packages +HOST_PKG_PYTHON_FLIT_ENV = \ + $(HOST_PKG_PYTHON_PEP517_ENV) + +# Host flit-bootstrap packages +HOST_PKG_PYTHON_FLIT_BOOTSTRAP_ENV = \ + $(HOST_PKG_PYTHON_PEP517_ENV) + # Target maturin packages PKG_PYTHON_MATURIN_ENV = \ $(PKG_PYTHON_PEP517_ENV) \ @@ -194,54 +206,34 @@ ifndef $(2)_SETUP_TYPE endif endif +$(2)_SETUP_TYPE_UPPER = $$(call UPPERCASE,$$($(2)_SETUP_TYPE)) + # Distutils ifeq ($$($(2)_SETUP_TYPE),distutils) ifeq ($(4),target) -$(2)_BASE_ENV = $$(PKG_PYTHON_DISTUTILS_ENV) $(2)_BASE_BUILD_CMD = setup.py build $$(PKG_PYTHON_DISTUTILS_BUILD_OPTS) $(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS) else -$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_DISTUTILS_ENV) $(2)_BASE_BUILD_CMD = setup.py build $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS) endif # Setuptools else ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) -ifeq ($$($(2)_SETUP_TYPE),setuptools-rust) -$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_ENV) -else -$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV) -endif $(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build $(2)_BASE_INSTALL_TARGET_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS) else -ifeq ($$($(2)_SETUP_TYPE),setuptools-rust) -$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV) -else -$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) -endif $(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build $(2)_BASE_INSTALL_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) endif else ifneq ($$(filter flit maturin pep517,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) -ifeq ($$($(2)_SETUP_TYPE),maturin) -$(2)_BASE_ENV = $$(PKG_PYTHON_MATURIN_ENV) -else -$(2)_BASE_ENV = $$(PKG_PYTHON_PEP517_ENV) -endif $(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS) else -ifeq ($$($(2)_SETUP_TYPE),maturin) -$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_MATURIN_ENV) -else -$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_PEP517_ENV) -endif $(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif @@ -249,7 +241,6 @@ else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) ifeq ($(4),target) $$(error flit-bootstrap setup type only supported for host packages) else -$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_PEP517_ENV) $(2)_BASE_BUILD_CMD = -m flit_core.wheel $(2)_BASE_INSTALL_CMD ?= $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif @@ -332,7 +323,8 @@ ifeq ($(4),target) ifndef $(2)_BUILD_CMDS define $(2)_BUILD_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ + $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ $$($$(PKG)_BASE_BUILD_CMD) \ $$($$(PKG)_BUILD_OPTS)) @@ -346,7 +338,8 @@ endif ifndef $(2)_INSTALL_TARGET_CMDS define $(2)_INSTALL_TARGET_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ + $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ $$($$(PKG)_BASE_INSTALL_TARGET_CMD) \ $$($$(PKG)_INSTALL_TARGET_OPTS)) @@ -360,7 +353,8 @@ endif ifndef $(2)_INSTALL_STAGING_CMDS define $(2)_INSTALL_STAGING_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ + $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ $$($$(PKG)_BASE_INSTALL_STAGING_CMD) \ $$($$(PKG)_INSTALL_STAGING_OPTS)) @@ -376,7 +370,8 @@ else # host ifndef $(2)_BUILD_CMDS define $(2)_BUILD_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(HOST_PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ + $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ $$($$(PKG)_BASE_BUILD_CMD) \ $$($$(PKG)_BUILD_OPTS)) @@ -390,7 +385,8 @@ endif ifndef $(2)_INSTALL_CMDS define $(2)_INSTALL_CMDS (cd $$($$(PKG)_BUILDDIR)/; \ - $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \ + $$(HOST_PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ + $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ $$($$(PKG)_BASE_INSTALL_CMD) \ $$($$(PKG)_INSTALL_OPTS)) From patchwork Sat Sep 30 22:16:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841651 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhSC5MHhz1yp7 for ; Sun, 1 Oct 2023 09:18:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0225482022; Sat, 30 Sep 2023 22:18:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0225482022 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aEVK2sJES3Ii; Sat, 30 Sep 2023 22:18:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 1FC8A83C69; Sat, 30 Sep 2023 22:18:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1FC8A83C69 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D3A831BF5F5 for ; Sat, 30 Sep 2023 22:17:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BAC2B61170 for ; Sat, 30 Sep 2023 22:17:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BAC2B61170 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xPLe_Sm4Tu62 for ; Sat, 30 Sep 2023 22:17:40 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by smtp3.osuosl.org (Postfix) with ESMTPS id B813761096 for ; Sat, 30 Sep 2023 22:17:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B813761096 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32329d935d4so10029640f8f.2 for ; Sat, 30 Sep 2023 15:17:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112258; x=1696717058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rm4HD5LdIu5DNT6U7613RucZ7sVS0SDmGBrAyFuwKNU=; b=Vtn8J8GfWg/wkDbs17Bu4Uq89+Km5+akvDVp/Jj5QkxamqCU3LROin1d19Acj31zjT 1X3Mmc1fQzjP+WLLJppDqGMzk4gB6ft9G5Dcp4n1BT4H9k98r+qlmUBA0GUz2V6gRtJW G2/nWYEWVs/J/KRDgJM2CkJqeTHbSwKkAtHFTSvGsuM370pBBvSAaBH05K26x4S+pmkh F1/bZSuLt2CxWzL1F1Lxg6kwVGh7jQkRONzOwOOeRUCaimIqYN4T5hQhwg00bSmmVnRB ZNSV5h6ajWIdF1yWMuW/C2hdfscyOP7NsZpXpADXFjtrD80K81toxy2lwDW/mkkA/Zds T7gg== X-Gm-Message-State: AOJu0Yz6ZwlqTRPq4jpM5IJzvuyE+rxN8lDvYD3KSa0lkXc1VvobMQE4 u3BWrzUgpGwMrNlSiNYEwLjhMTDVf88Jt8K+LFBE6Q== X-Google-Smtp-Source: AGHT+IGvd6dQ8jzTqas+nXTK7dNpQGevJn0WCCNkpzvUIxD0R6hV05r3NR0QMIPTeTBdPX16GHfbcA== X-Received: by 2002:a5d:4652:0:b0:320:261:b87f with SMTP id j18-20020a5d4652000000b003200261b87fmr6714256wrs.62.1696112257831; Sat, 30 Sep 2023 15:17:37 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:37 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:29 +0200 Message-ID: <20230930221727.1458825-6-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112258; x=1696717058; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rm4HD5LdIu5DNT6U7613RucZ7sVS0SDmGBrAyFuwKNU=; b=BC9IGzF6KmTYvnI7/jkmg+Z677aDtaCyYbonzZnqt2vdH8v8mQMOnl5JORldbIALSJ /ppT7ocoAUKwb1qgZ3XjVtSfepnUO6aWEKpBmv9/vNO0fFSO2c5S4z8RwAlboHy+trYo /eiydXY6FYDjsk2r4CZ7X4qMY3RZHKhDmntHSUnEptNmLGf6As9Tv3UW/jnuiwS2FKDw 4bvFiqrclaXq/wCfD4O91Fmnq6LA8YSEhkiO038Qf66NgaZDnnSXFGWfqMcJ2BjcwUS5 Ab5FmjIYVxOYV7MUe95cBbtWtSKMMxnJbN+MI8LAunENCFkI4j/GXkz/GxMCIeSl4fdL HJ+A== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=BC9IGzF6 Subject: [Buildroot] [PATCH 05/10] package/pkg-python.mk: replace $(_BASE_BUILD_CMD) with $($(SETUP_TYPE)_BUILD_CMD) X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The _BASE_BUILD_CMD variable is set based on the setup type, and only based on the setup type. Because of this, we have a large conditional tree in inner-python-package which makes things hard to read. Rather than conditions, it's also possible to use indirect variables. Concretely, we can define PKG_PYTHON_DISTUTILS_BUILD_CMD etc., and use $(PKG_PYTHON_$($(PKG)_SETUP_TYPE)_BUILD_CMD) instead of $($(PKG)_BASE_BUILD_CMD) to dispatch to the right _BUILD_CMD variable. Once we do the same for all other variables that are set in the condition tree, we'll be able to remove the condition tree entirely. setuptools-rust, flit and maturin didn't have their own definition of _BUILD_CMD but were under the setuptools resp. pep517 condition. For these, we have to define new variables that copy the value from PKG_PYTHON_SETUPTOOLS_BUILD_CMD resp. PKG_PYTHON_PEP517_BUILD_CMD. Signed-off-by: Arnout Vandecappelle --- package/pkg-python.mk | 50 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index 8e8955f3c4..5f8ef14262 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -57,7 +57,8 @@ PKG_PYTHON_DISTUTILS_ENV = \ $(PKG_PYTHON_ENV) \ LDSHARED="$(TARGET_CROSS)gcc -shared" -PKG_PYTHON_DISTUTILS_BUILD_OPTS = \ +PKG_PYTHON_DISTUTILS_BUILD_CMD = \ + setup.py build \ --executable=/usr/bin/python PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \ @@ -76,6 +77,9 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \ HOST_PKG_PYTHON_DISTUTILS_ENV = \ $(HOST_PKG_PYTHON_ENV) +HOST_PKG_PYTHON_DISTUTILS_BUILD_CMD = \ + setup.py build \ + HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \ --prefix=$(HOST_DIR) @@ -86,6 +90,9 @@ PKG_PYTHON_SETUPTOOLS_ENV = \ PKG_PYTHON_SETUPTOOLS_CMD = \ $(if $(wildcard $($(PKG)_BUILDDIR)/setup.py),setup.py,-c 'from setuptools import setup;setup()') +PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_CMD) build + PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ --install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --prefix=/usr \ @@ -104,6 +111,9 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \ HOST_PKG_PYTHON_SETUPTOOLS_ENV = \ $(HOST_PKG_PYTHON_ENV) +HOST_PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_CMD) build + HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ --prefix=$(HOST_DIR) \ --root=/ \ @@ -115,16 +125,25 @@ PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ $(PKG_CARGO_ENV) \ PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)" +PKG_PYTHON_SETUPTOOLS_RUST_BUILD_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_BUILD_CMD) + # Host setuptools-rust-based packages HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \ $(HOST_PKG_CARGO_ENV) \ PYO3_CROSS_LIB_DIR="$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)" +HOST_PKG_PYTHON_SETUPTOOLS_RUST_BUILD_CMD = \ + $(HOST_PKG_PYTHON_SETUPTOOLS_BUILD_CMD) + # Target pep517-based packages PKG_PYTHON_PEP517_ENV = \ $(PKG_PYTHON_ENV) +PKG_PYTHON_PEP517_BUILD_CMD = \ + -m build -n -w + PKG_PYTHON_PEP517_INSTALL_OPTS = \ --interpreter=/usr/bin/python \ --script-kind=posix @@ -147,6 +166,9 @@ PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \ HOST_PKG_PYTHON_PEP517_ENV = \ $(HOST_PKG_PYTHON_ENV) +HOST_PKG_PYTHON_PEP517_BUILD_CMD = \ + -m build -n -w + HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ --interpreter=$(HOST_DIR)/bin/python \ --script-kind=posix \ @@ -162,26 +184,41 @@ HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ PKG_PYTHON_FLIT_ENV = \ $(PKG_PYTHON_PEP517_ENV) +PKG_PYTHON_FLIT_BUILD_CMD = \ + $(PKG_PYTHON_PEP517_BUILD_CMD) + # Host flit packages HOST_PKG_PYTHON_FLIT_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) +HOST_PKG_PYTHON_FLIT_BUILD_CMD = \ + $(HOST_PKG_PYTHON_PEP517_BUILD_CMD) + # Host flit-bootstrap packages HOST_PKG_PYTHON_FLIT_BOOTSTRAP_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) +HOST_PKG_PYTHON_FLIT_BOOTSTRAP_BUILD_CMD = \ + -m flit_core.wheel + # Target maturin packages PKG_PYTHON_MATURIN_ENV = \ $(PKG_PYTHON_PEP517_ENV) \ $(PKG_CARGO_ENV) \ PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)" +PKG_PYTHON_MATURIN_BUILD_CMD = \ + $(PKG_PYTHON_PEP517_BUILD_CMD) + # Host maturin packages HOST_PKG_PYTHON_MATURIN_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) \ $(HOST_PKG_CARGO_ENV) \ PYO3_CROSS_LIB_DIR="$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)" +HOST_PKG_PYTHON_MATURIN_BUILD_CMD = \ + $(HOST_PKG_PYTHON_PEP517_BUILD_CMD) + ################################################################################ # inner-python-package -- defines how the configuration, compilation # and installation of a Python package should be done, implements a @@ -211,37 +248,30 @@ $(2)_SETUP_TYPE_UPPER = $$(call UPPERCASE,$$($(2)_SETUP_TYPE)) # Distutils ifeq ($$($(2)_SETUP_TYPE),distutils) ifeq ($(4),target) -$(2)_BASE_BUILD_CMD = setup.py build $$(PKG_PYTHON_DISTUTILS_BUILD_OPTS) $(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS) else -$(2)_BASE_BUILD_CMD = setup.py build $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS) endif # Setuptools else ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) -$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build $(2)_BASE_INSTALL_TARGET_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS) else -$(2)_BASE_BUILD_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) build $(2)_BASE_INSTALL_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) endif else ifneq ($$(filter flit maturin pep517,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) -$(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS) $(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS) else -$(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) ifeq ($(4),target) $$(error flit-bootstrap setup type only supported for host packages) else -$(2)_BASE_BUILD_CMD = -m flit_core.wheel $(2)_BASE_INSTALL_CMD ?= $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif else @@ -326,7 +356,7 @@ define $(2)_BUILD_CMDS $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_BUILD_CMD) \ + $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_BUILD_CMD) \ $$($$(PKG)_BUILD_OPTS)) endef endif @@ -373,7 +403,7 @@ define $(2)_BUILD_CMDS $$(HOST_PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_BUILD_CMD) \ + $$(HOST_PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_BUILD_CMD) \ $$($$(PKG)_BUILD_OPTS)) endef endif From patchwork Sat Sep 30 22:16:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841655 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhT83mZpz1yp7 for ; Sun, 1 Oct 2023 09:19:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A8E4883CBB; Sat, 30 Sep 2023 22:19:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A8E4883CBB X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6l7-jxzTCEJr; Sat, 30 Sep 2023 22:19:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 053A083CB1; Sat, 30 Sep 2023 22:19:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 053A083CB1 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9D9901BF86C for ; Sat, 30 Sep 2023 22:17:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5481B41B6E for ; Sat, 30 Sep 2023 22:17:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5481B41B6E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8X93lRZlBbKI for ; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by smtp4.osuosl.org (Postfix) with ESMTPS id CEE7C41B3E for ; Sat, 30 Sep 2023 22:17:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CEE7C41B3E Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3248ac76acbso2626351f8f.1 for ; Sat, 30 Sep 2023 15:17:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112259; x=1696717059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RXpyH7fQuOv731/mcAgdDCg8a2WfBqyLO8+J18KwDi0=; b=SzNMC20ntOttc30wiYwpDSqxc11XcW1MXqvFMc7pJhekWrKzV6G2M/n2+++h1hizxF 0z4k4Kon1VOL0jOLKqqWzlEboJIAiLRCrwn8guDvIlL9Q1+ML061RWQMAY57JCpTdQfG y7HuwOP0F3qtH+5JLEqiznuml8AsPR9ALvqnmmIQbqIJOHWrA4gDNsJjXYxWm51srKha dq9t23dgbZzwDImx0AdrOI5jIwLv0TCxvKNlQX2lUcyuPBDddNDIT3XTXB5Ew5+TZUG2 XksYHt3tMgzd1D24osqkzG9T+Bce8VZDp+ShUZXcrdA7WSpwNS/LWqG1p9dAM6Oo8a0c /dkQ== X-Gm-Message-State: AOJu0YyHnSFJLlHAeqk5D6Jc9+dcDEVilRgEd6hZFazvx2MZb3PSOIa6 oe7bGRP6yX1M13Y7Rpp4m6H7K7bZssXphQZvn3D4pg== X-Google-Smtp-Source: AGHT+IHl5iGYr50zQsATP7rny4FcWm1dNtlM44B9YC1Zv4M6FFJbKMeYg/ZCWJ6wHjNNnzdOjoEYRg== X-Received: by 2002:adf:f5d2:0:b0:313:f463:9d40 with SMTP id k18-20020adff5d2000000b00313f4639d40mr6117705wrp.65.1696112258852; Sat, 30 Sep 2023 15:17:38 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:38 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:30 +0200 Message-ID: <20230930221727.1458825-7-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112259; x=1696717059; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RXpyH7fQuOv731/mcAgdDCg8a2WfBqyLO8+J18KwDi0=; b=EHVV26oNKAunzFP8nHlTxYLoCHdC2dfmXzGvWIEkjC1EhpD3/DaInddMFtLGha1N21 5ZJa2u+SimAIM047aWkSlH3Zo4gWRxEyhcL2OLQKi0TBMsbijl8EEPBc3HV0IneXZdOa E976CbBa9BPu36HcSfhIgtlG6171CKtz9TBhvcNpiW9l+MiDxXoQ5gp+kgip1O0/K2t6 0K+1ITZFm282cY20MyQOy3cHM1D0G0XtKuL4vUCV+H4/Iw3xkvDbjxdG+qnc7EoqnjKm oQv9WL84ZeJAd5cqD9pTxrmkL1Wat+wI5tVzJ20cDFjEbesX5ZSVrp68E0MP7mV6oV/G qA4g== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=EHVV26oN Subject: [Buildroot] [PATCH 06/10] package/python-flit-core: instantiate _INSTALL_CMDS X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" host-python-flit-core is the only package that overrides _BASE_INSTALL_CMD. Since we're going to remove that variable in a follow-up patch, we no longer will be able to do that. Since host-python-flit-core is really a special case, it makes sense to define HOST_PYTHON_FLIT_CORE_INSTALL_CMDS in its entirety. While we're at it, also instantiate HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS directly there. This variable is not used anywhere else, and it's a bit confusing to have it in pkg-python.mk - it looks like a mistake. Signed-off-by: Arnout Vandecappelle --- package/pkg-python.mk | 3 --- package/python-flit-core/python-flit-core.mk | 9 +++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index 5f8ef14262..be9756acc4 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -177,9 +177,6 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ --scripts=$(HOST_DIR)/bin \ --data=$(HOST_DIR) -HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ - --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages - # Target flit packages PKG_PYTHON_FLIT_ENV = \ $(PKG_PYTHON_PEP517_ENV) diff --git a/package/python-flit-core/python-flit-core.mk b/package/python-flit-core/python-flit-core.mk index ea887a0258..34e58d03ca 100644 --- a/package/python-flit-core/python-flit-core.mk +++ b/package/python-flit-core/python-flit-core.mk @@ -13,7 +13,12 @@ PYTHON_FLIT_CORE_SETUP_TYPE = flit-bootstrap # Use flit built in bootstrap_install for installing host-python-flit-core. # This is due to host-python-installer depending on host-python-flit-core. -# -HOST_PYTHON_FLIT_CORE_BASE_INSTALL_CMD = -m bootstrap_install dist/* $(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS) +define HOST_PYTHON_FLIT_CORE_INSTALL_CMDS + cd $($(PKG)_BUILDDIR)/; \ + $(HOST_PKG_PYTHON_FLIT_BOOTSTRAP_ENV) \ + $(HOST_DIR)/bin/python3 \ + -m bootstrap_install dist/* \ + --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages +endef $(eval $(host-python-package)) From patchwork Sat Sep 30 22:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841654 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhSw3pZqz1yp7 for ; Sun, 1 Oct 2023 09:18:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BA9D483D07; Sat, 30 Sep 2023 22:18:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org BA9D483D07 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iCt8xvTeMp8m; Sat, 30 Sep 2023 22:18:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 09C4583CBB; Sat, 30 Sep 2023 22:18:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 09C4583CBB X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7082D1BF5F5 for ; Sat, 30 Sep 2023 22:17:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4A8C583C74 for ; Sat, 30 Sep 2023 22:17:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4A8C583C74 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kjasn69HuvVZ for ; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by smtp1.osuosl.org (Postfix) with ESMTPS id 8716783C73 for ; Sat, 30 Sep 2023 22:17:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8716783C73 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-405524e6769so11267625e9.1 for ; Sat, 30 Sep 2023 15:17:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112259; x=1696717059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mg2NNJ0/8WMVIX5V8ANN+LwvGNVcPfXAteJ/ZwljmW8=; b=WvvtZyb+i7P9u9r69eSRJ/nCcCOPfNrW6bXww5A3oME8fDhMdKTaU82pBcNXB9tFUT fR2CILpBkDA8luNNFuTYnQxQSRF1t0TvRg56/Unvsx3Hccp6UKqYE0jP/iMlTBCuMIIb y4bMHGkGicPARTu3H+nBPyeYLU/DygQlU9dLGc8YJdDJJnfCLHa/CsPVPGZ6/BKJpVt6 o2li3juxlv02j1ffLfSblhmAleQWcrU4+vnOtn3qFyEKZjfaWay/v2TQm3Bh2ph1eXz0 hhucGF2Nb85wLSTglIS+4CB4EwthHGNZzQ+uq0Y27fTwVSrCoXSB4Mzd9/X4hYAH95i2 Z06Q== X-Gm-Message-State: AOJu0YwGGZLkTH8+4Kj6RbYsRopnVbV/nhth9GSwyp1+otCBqVtpBtCJ a5r2ubPuaRGII6Sw90FekReG+UGetZsfVmBNhbjxLA== X-Google-Smtp-Source: AGHT+IHzPWOQIwgHQcFOBJ6VRybUhq1oQONsg32s3uOP9JvuMit3cqqbIrxfJs4/LnPuMCYH2UUpDw== X-Received: by 2002:a05:600c:4991:b0:401:b92f:eec5 with SMTP id h17-20020a05600c499100b00401b92feec5mr6663079wmp.9.1696112259688; Sat, 30 Sep 2023 15:17:39 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:39 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:31 +0200 Message-ID: <20230930221727.1458825-8-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112259; x=1696717059; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mg2NNJ0/8WMVIX5V8ANN+LwvGNVcPfXAteJ/ZwljmW8=; b=atwr7JvMBccD6PO2ROvVbAGTIdJdUhQ/WI1jCD4TpVos9AgoTQzw6XxT8ttUF2uDOH H2XVU2nS97eTxAeYuaOTEo7gL25JmK3msHBvGwLu34bUq9xencLfheBYqt2ojSbunmCq PNYdsturn/GQOmNoBc027YZumzDw55SCB9OixbPTvII9Z8mgbD4H1U2JdC6HI07WbFP6 XjWEId5nzNq7oD5nRzgOQgS2WR2vaU1RWPIAc45ELtu18KwhiEO0fdiSq+ibrfUls4BO 7xFokiY5aCYvbrdcnp/QAoIWojZq+m9i+9Q72o21FpYqr+xlOSEutYAh/Piji2Xjoiwq 8KfQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=atwr7JvM Subject: [Buildroot] [PATCH 07/10] package/jailhouse: expand PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" In a follow-up patch, we want to remove this variable. Replace it with its expansion, which is anyway just $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) --root=$(TARGET_DIR) While we're at it, split the very long line. Signed-off-by: Arnout Vandecappelle --- package/jailhouse/jailhouse.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/jailhouse/jailhouse.mk b/package/jailhouse/jailhouse.mk index 6356c5a7aa..095032a1dd 100644 --- a/package/jailhouse/jailhouse.mk +++ b/package/jailhouse/jailhouse.mk @@ -48,7 +48,12 @@ define JAILHOUSE_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/inmates/demos/*/*.bin $(TARGET_DIR)/usr/local/libexec/jailhouse/demos $(if $(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS), \ - cd $(@D) && $(PKG_PYTHON_SETUPTOOLS_ENV) $(HOST_DIR)/bin/python setup.py install --no-compile $(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)) + cd $(@D) && \ + $(PKG_PYTHON_SETUPTOOLS_ENV) \ + $(HOST_DIR)/bin/python setup.py \ + install --no-compile \ + $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ + --root=$(TARGET_DIR)) endef $(eval $(generic-package)) From patchwork Sat Sep 30 22:16:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841656 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhTN4sHfz1yp7 for ; Sun, 1 Oct 2023 09:19:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E004D83D28; Sat, 30 Sep 2023 22:19:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E004D83D28 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JLKDN6ukeFvd; Sat, 30 Sep 2023 22:19:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 2E8E483CB1; Sat, 30 Sep 2023 22:19:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2E8E483CB1 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C58781BF5F5 for ; Sat, 30 Sep 2023 22:17:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9FFC983C78 for ; Sat, 30 Sep 2023 22:17:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9FFC983C78 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pdr2dtpJHTjv for ; Sat, 30 Sep 2023 22:17:43 +0000 (UTC) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by smtp1.osuosl.org (Postfix) with ESMTPS id BDF8183C70 for ; Sat, 30 Sep 2023 22:17:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org BDF8183C70 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-32336a30d18so7156343f8f.2 for ; Sat, 30 Sep 2023 15:17:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112261; x=1696717061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ITDyZUbaue4gr3Jo9xNOaYfWd3QslWPqOylLC8BcOlY=; b=IznozuOt6AIenVkGgIUX1mGmugNd2DS2i5FPdU6tEw/zm9XICNMzWtGngWq4CNIpUX CCkfE+FeGupn1gqKnpmptYrknofSFHV9ir6VmUpSeAg0/VjBDiWValvF2tWCfaJido0m B7ntw5ssIkazZWOhPBkJForRQOpbftM1TTJyPeUPjK1UPCnjz3y5iGVJqIUpPcA8Q2Mj QfEybDaVpQJE/+UAlR0d+8Mw0PzX9luyoFDtN6Le9iM2b8hlCf6cgN/o1rRXUlYBR8GP v0hoqh16hFug8+cPQntuVhnYPVI+U+OJG2vFOYlLZm7+iKmhforgAWwcf6z6u0Fkw8mb 2xBA== X-Gm-Message-State: AOJu0YwYS+KtNAh+CgN5wXYhRxnANbsXS92eArusBoK5RpsPIaywMqCh cWdZQbRec7BgLkcGO28Atrd7kd/aYyKadik7LKsdoQ== X-Google-Smtp-Source: AGHT+IGtSKKCYEUU8xV+RYbPVLN3ICUzGKHm1rrf0Zj3/qZ60kGFgN33/0tPehYTiC21RWlgA6+L5Q== X-Received: by 2002:a5d:410d:0:b0:314:1ce9:3c86 with SMTP id l13-20020a5d410d000000b003141ce93c86mr6444536wrp.0.1696112260886; Sat, 30 Sep 2023 15:17:40 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:40 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:32 +0200 Message-ID: <20230930221727.1458825-9-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112261; x=1696717061; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ITDyZUbaue4gr3Jo9xNOaYfWd3QslWPqOylLC8BcOlY=; b=QGSeFgi1n9TDV8mcCezq/FiRsK9m0y1PiMUS1beltJe2nG6XCQfsKNK8mbOXh141ng O75md6uEbQawm1r+HQD16pAzpskj1lVWTeLI4saZCB/n0jlQS+p6NXF7lccG9wU7FDvP N2seRpZYP3Z4wOXwOdB4GpWKwT2dVqZbLr+s/4n+yvicTeHjHJcnQDxbZM+8ruC4WaA/ 48IKAxenR7rxxDiMdOVdnDEVvPWIDjapBKAlFGXv04ePJ5whF4mNXOvS3q6lxIQ3QG86 CiKJAKoS1FgL+RcNQ4HPnIOecT/LBvXta4sAUbCWkfaxTjKaVZAup3wiKtMzEsSnrqnz beMA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=QGSeFgi1 Subject: [Buildroot] [PATCH 08/10] package/i2c-tools: expand PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" In a follow-up patch, we want to remove this variable. Replace it with its expansion, which is anyway just $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) --root=$(TARGET_DIR) Also remove PKG_PYTHON_SETUPTOOLS_BUILD_OPTS, which is not defined (i.e. empty). Signed-off-by: Arnout Vandecappelle --- package/i2c-tools/i2c-tools.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk index adccd9475d..f8d1bcb4b0 100644 --- a/package/i2c-tools/i2c-tools.mk +++ b/package/i2c-tools/i2c-tools.mk @@ -36,15 +36,15 @@ I2C_TOOLS_PYTHON_BASE_ENV = \ define I2C_TOOLS_BUILD_PYSMBUS (cd $(@D)/py-smbus; \ $(I2C_TOOLS_PYTHON_BASE_ENV) \ - $(HOST_DIR)/bin/python setup.py build \ - $(PKG_PYTHON_SETUPTOOLS_BUILD_OPTS)) + $(HOST_DIR)/bin/python setup.py build) endef define I2C_TOOLS_INSTALL_PYSMBUS (cd $(@D)/py-smbus; \ $(I2C_TOOLS_PYTHON_BASE_ENV) \ $(HOST_DIR)/bin/python setup.py install \ - $(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)) + $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ + --root=$(TARGET_DIR)) endef endif # BR2_PACKAGE_PYTHON3 From patchwork Sat Sep 30 22:16:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841659 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhTt16Wwz26jS for ; Sun, 1 Oct 2023 09:19:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5BBBF83CB1; Sat, 30 Sep 2023 22:19:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5BBBF83CB1 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7YPXTVAZXVpj; Sat, 30 Sep 2023 22:19:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 5735083CBA; Sat, 30 Sep 2023 22:19:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5735083CBA X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 03D471BF5F5 for ; Sat, 30 Sep 2023 22:17:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D27D74168B for ; Sat, 30 Sep 2023 22:17:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D27D74168B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Re3VUbFKHiYZ for ; Sat, 30 Sep 2023 22:17:44 +0000 (UTC) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by smtp2.osuosl.org (Postfix) with ESMTPS id CCB154015F for ; Sat, 30 Sep 2023 22:17:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org CCB154015F Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-406618d0991so14612945e9.2 for ; Sat, 30 Sep 2023 15:17:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112262; x=1696717062; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n8s4Yb0QGkzCe5ZF2qNM+ji0b8egX6h6UCB4rxqqy04=; b=vX12orsIEk+zjTG5CDWnxHvL40SaoWo5dfxMT4pSaBVyq32OLMEnlX0h4bStDqtZbH qTRr6NKjgKV0T7eCxZmdlSzgNwS1opBpvkFigrrY2x9QZmEkaxKBbkTaLrqbVtHnr0mD DD3/lZaH/LKo8xazada5vQsCIZEVXiynGW+rclwlvENqnSZfoyHLREI69+JT4hyekpcB G9n8jfD+/eZLcEe2sEM7ISJNR1cIySvx77+9T6JsPyNi+7Iqi0OG2TwR+Woyw36nlOv2 UX+oAWNMXQAosOvqdeD2f7QBz0viapoJ9aCfwq1T//+gWfusnWxdReP+H/W62Il6wL1G dDDQ== X-Gm-Message-State: AOJu0YxgxwOElaSniz1eSninWgYEpUqxUsUuDIzBkgnOXzaeArWhYO+/ zp8do9aYOrJrg8hlRkHdHjhaRDc0y7/Yqyy83rz/mg== X-Google-Smtp-Source: AGHT+IHtLc1xPA+QW2cJYfMt0mUFLCDxzQdMOX9BM4syvW6QhScIZ3sjDIMyEVOmqfKul2h0GQsnYg== X-Received: by 2002:a1c:f709:0:b0:3fe:1cac:37d5 with SMTP id v9-20020a1cf709000000b003fe1cac37d5mr7012671wmh.4.1696112261963; Sat, 30 Sep 2023 15:17:41 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:41 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:33 +0200 Message-ID: <20230930221727.1458825-10-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112262; x=1696717062; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n8s4Yb0QGkzCe5ZF2qNM+ji0b8egX6h6UCB4rxqqy04=; b=cyv5bGzdeI9t3c/z/B+5fO80CZBC7Zf/fnUPHVElegPF0j/Va9xT5UPM08XKi7yyVi ecJzxBHon/1OCtVLX8/MuDQcKjQ1Lsn2eKME7+Gek2kzmjz57G8UcnteOn6qWjxsfjJG H+8VvB98G2xM2f0B1Henh5RPLI009kMBhK5pfvaI2UWFBahInkNqE95VoFah0UtP3Dja GDKfp5ZCDkhaaZajZNNHaI8lpb/H3+dMMBSPW+VCdx0Z+UQhmWHzfW4SVWAcjDdrakDX kMc5XUe+Gps127XuCnaDiqV7/x5hp2E2ul7IJt4SbnnNfK/S76wxmKIrTferVTBXj+hW 365Q== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=cyv5bGzd Subject: [Buildroot] [PATCH 09/10] package/pkg-python.mk: replace $(_BASE_INSTALL*_CMD) with $($(SETUP_TYPE)_INSTALL*_CMD) X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The _BASE_INSTALL*_CMD variables are set based on the setup type, and only based on the setup type. Because of this, we have a large conditional tree in inner-python-package which makes things hard to read. Rather than conditions, it's also possible to use indirect variables. Concretely, we can define PKG_PYTHON_DISTUTILS_INSTALL_TARGET_CMD etc., and use $(PKG_PYTHON_$($(PKG)_SETUP_TYPE)_INSTALL_TARGET_CMD) instead of $($(PKG)_BASE_INSTALL_TARGET_CMD) to dispatch to the right _INSTALL_TARGET_CMD variable. The same applies to _INSTALL_STAGING_CMD and HOST_..._INSTALL_CMD. Since the _INSTALL*_OPTS variables are not (or no longer) used anywhere else, we can fold them into the _INSTALL*_CMD variables. setuptools-rust, flit and maturin didn't have their own definition of _BUILD_CMD but were under the setuptools resp. pep517 condition. For these, we have to define new variables that copy the value from PKG_PYTHON_SETUPTOOLS_BUILD_CMD resp. PKG_PYTHON_PEP517_BUILD_CMD. The condition tree is now empty, except for the error handling. Rework the conditions for the error handling and remove all other conditions. Signed-off-by: Arnout Vandecappelle --- package/pkg-python.mk | 101 +++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 41 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index be9756acc4..bda79116c8 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -65,11 +65,13 @@ PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \ --install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --prefix=/usr -PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS = \ +PKG_PYTHON_DISTUTILS_INSTALL_TARGET_CMD = \ + setup.py install --no-compile \ $(PKG_PYTHON_DISTUTILS_INSTALL_OPTS) \ --root=$(TARGET_DIR) -PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \ +PKG_PYTHON_DISTUTILS_INSTALL_STAGING_CMD = \ + setup.py install \ $(PKG_PYTHON_DISTUTILS_INSTALL_OPTS) \ --root=$(STAGING_DIR) @@ -80,7 +82,8 @@ HOST_PKG_PYTHON_DISTUTILS_ENV = \ HOST_PKG_PYTHON_DISTUTILS_BUILD_CMD = \ setup.py build \ -HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \ +HOST_PKG_PYTHON_DISTUTILS_INSTALL_CMD = \ + setup.py install \ --prefix=$(HOST_DIR) # Target setuptools-based packages @@ -99,11 +102,15 @@ PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ --executable=/usr/bin/python \ --single-version-externally-managed -PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS = \ +PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_CMD) \ + install --no-compile \ $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ --root=$(TARGET_DIR) -PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \ +PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_CMD) \ + install \ $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ --root=$(STAGING_DIR) @@ -114,7 +121,9 @@ HOST_PKG_PYTHON_SETUPTOOLS_ENV = \ HOST_PKG_PYTHON_SETUPTOOLS_BUILD_CMD = \ $(PKG_PYTHON_SETUPTOOLS_CMD) build -HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \ +HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_CMD) \ + install \ --prefix=$(HOST_DIR) \ --root=/ \ --single-version-externally-managed @@ -128,6 +137,12 @@ PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ PKG_PYTHON_SETUPTOOLS_RUST_BUILD_CMD = \ $(PKG_PYTHON_SETUPTOOLS_BUILD_CMD) +PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_TARGET_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_CMD) + +PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_STAGING_CMD = \ + $(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_CMD) + # Host setuptools-rust-based packages HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \ @@ -137,6 +152,9 @@ HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \ HOST_PKG_PYTHON_SETUPTOOLS_RUST_BUILD_CMD = \ $(HOST_PKG_PYTHON_SETUPTOOLS_BUILD_CMD) +HOST_PKG_PYTHON_SETUPTOOLS_RUST_INSTALL_CMD = \ + $(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_CMD) + # Target pep517-based packages PKG_PYTHON_PEP517_ENV = \ $(PKG_PYTHON_ENV) @@ -148,14 +166,18 @@ PKG_PYTHON_PEP517_INSTALL_OPTS = \ --interpreter=/usr/bin/python \ --script-kind=posix -PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \ +PKG_PYTHON_PEP517_INSTALL_TARGET_CMD = \ + $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/* \ $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ --scripts=$(TARGET_DIR)/usr/bin \ --data=$(TARGET_DIR)/usr -PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \ +PKG_PYTHON_PEP517_INSTALL_STAGING_CMD = \ + $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/* \ $(PKG_PYTHON_PEP517_INSTALL_OPTS) \ --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \ @@ -169,7 +191,9 @@ HOST_PKG_PYTHON_PEP517_ENV = \ HOST_PKG_PYTHON_PEP517_BUILD_CMD = \ -m build -n -w -HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ +HOST_PKG_PYTHON_PEP517_INSTALL_CMD = \ + $(TOPDIR)/support/scripts/pyinstaller.py \ + dist/* \ --interpreter=$(HOST_DIR)/bin/python \ --script-kind=posix \ --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \ @@ -184,6 +208,12 @@ PKG_PYTHON_FLIT_ENV = \ PKG_PYTHON_FLIT_BUILD_CMD = \ $(PKG_PYTHON_PEP517_BUILD_CMD) +PKG_PYTHON_FLIT_INSTALL_TARGET_CMD = \ + $(PKG_PYTHON_PEP517_INSTALL_TARGET_CMD) + +PKG_PYTHON_FLIT_INSTALL_STAGING_CMD = \ + $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) + # Host flit packages HOST_PKG_PYTHON_FLIT_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) @@ -191,6 +221,9 @@ HOST_PKG_PYTHON_FLIT_ENV = \ HOST_PKG_PYTHON_FLIT_BUILD_CMD = \ $(HOST_PKG_PYTHON_PEP517_BUILD_CMD) +HOST_PKG_PYTHON_FLIT_INSTALL_CMD = \ + $(HOST_PKG_PYTHON_PEP517_INSTALL_CMD) + # Host flit-bootstrap packages HOST_PKG_PYTHON_FLIT_BOOTSTRAP_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) @@ -198,6 +231,9 @@ HOST_PKG_PYTHON_FLIT_BOOTSTRAP_ENV = \ HOST_PKG_PYTHON_FLIT_BOOTSTRAP_BUILD_CMD = \ -m flit_core.wheel +HOST_PKG_PYTHON_FLIT_BOOTSTRAP_INSTALL_CMD = \ + $(HOST_PKG_PYTHON_PEP517_INSTALL_CMD) + # Target maturin packages PKG_PYTHON_MATURIN_ENV = \ $(PKG_PYTHON_PEP517_ENV) \ @@ -207,6 +243,12 @@ PKG_PYTHON_MATURIN_ENV = \ PKG_PYTHON_MATURIN_BUILD_CMD = \ $(PKG_PYTHON_PEP517_BUILD_CMD) +PKG_PYTHON_MATURIN_INSTALL_TARGET_CMD = \ + $(PKG_PYTHON_PEP517_INSTALL_TARGET_CMD) + +PKG_PYTHON_MATURIN_INSTALL_STAGING_CMD = \ + $(PKG_PYTHON_PEP517_INSTALL_STAGING_CMD) + # Host maturin packages HOST_PKG_PYTHON_MATURIN_ENV = \ $(HOST_PKG_PYTHON_PEP517_ENV) \ @@ -216,6 +258,9 @@ HOST_PKG_PYTHON_MATURIN_ENV = \ HOST_PKG_PYTHON_MATURIN_BUILD_CMD = \ $(HOST_PKG_PYTHON_PEP517_BUILD_CMD) +PKG_PYTHON_MATURIN_INSTALL_CMD = \ + $(PKG_PYTHON_PEP517_INSTALL_CMD) + ################################################################################ # inner-python-package -- defines how the configuration, compilation # and installation of a Python package should be done, implements a @@ -242,37 +287,11 @@ endif $(2)_SETUP_TYPE_UPPER = $$(call UPPERCASE,$$($(2)_SETUP_TYPE)) -# Distutils -ifeq ($$($(2)_SETUP_TYPE),distutils) -ifeq ($(4),target) -$(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS) -$(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS) -else -$(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS) -endif -# Setuptools -else ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),) -ifeq ($(4),target) -$(2)_BASE_INSTALL_TARGET_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS) -$(2)_BASE_INSTALL_STAGING_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS) -else -$(2)_BASE_INSTALL_CMD = $$(PKG_PYTHON_SETUPTOOLS_CMD) install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) -endif -else ifneq ($$(filter flit maturin pep517,$$($(2)_SETUP_TYPE)),) -ifeq ($(4),target) -$(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS) -$(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS) -else -$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +ifneq ($$(filter-out distutils setuptools setuptools-rust pep517 flit flit-bootstrap maturin,$$($(2)_SETUP_TYPE)),) +$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'maturin', 'setuptools', 'setuptools-rust', 'pep517' or 'flit'.") endif -else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) -ifeq ($(4),target) +ifeq ($(4)-$$($(2)_SETUP_TYPE),target-flit-bootstrap) $$(error flit-bootstrap setup type only supported for host packages) -else -$(2)_BASE_INSTALL_CMD ?= $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) -endif -else -$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'maturin', 'setuptools', 'setuptools-rust', 'pep517' or 'flit'.") endif # We need to vendor the Cargo crates at download time for pyo3 based @@ -368,7 +387,7 @@ define $(2)_INSTALL_TARGET_CMDS $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_INSTALL_TARGET_CMD) \ + $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_INSTALL_TARGET_CMD) \ $$($$(PKG)_INSTALL_TARGET_OPTS)) endef endif @@ -383,7 +402,7 @@ define $(2)_INSTALL_STAGING_CMDS $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_INSTALL_STAGING_CMD) \ + $$(PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_INSTALL_STAGING_CMD) \ $$($$(PKG)_INSTALL_STAGING_OPTS)) endef endif @@ -415,7 +434,7 @@ define $(2)_INSTALL_CMDS $$(HOST_PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_ENV) \ $$($$(PKG)_ENV) \ $$(HOST_DIR)/bin/python3 \ - $$($$(PKG)_BASE_INSTALL_CMD) \ + $$(HOST_PKG_PYTHON_$$($$(PKG)_SETUP_TYPE_UPPER)_INSTALL_CMD) \ $$($$(PKG)_INSTALL_OPTS)) endef endif From patchwork Sat Sep 30 22:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1841657 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RyhTc6yBTz1yp7 for ; Sun, 1 Oct 2023 09:19:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DBA1183D4E; Sat, 30 Sep 2023 22:19:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DBA1183D4E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q34kJEYYzDfd; Sat, 30 Sep 2023 22:19:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 329ED83CE6; Sat, 30 Sep 2023 22:19:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 329ED83CE6 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 916681BF5F5 for ; Sat, 30 Sep 2023 22:17:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 78E554168D for ; Sat, 30 Sep 2023 22:17:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 78E554168D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MjJ3s2rgzrte for ; Sat, 30 Sep 2023 22:17:45 +0000 (UTC) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by smtp2.osuosl.org (Postfix) with ESMTPS id B2E164168B for ; Sat, 30 Sep 2023 22:17:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B2E164168B Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso13952112f8f.0 for ; Sat, 30 Sep 2023 15:17:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696112263; x=1696717063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TW/PasOVD3I7cUPhHGwiBR6C4GhvGUS6n6l+ZRpOg2o=; b=ZpuDp2oGXr6NjfTY99GKZgcY9M36u1FS90beBF4wlaEcYjsnqWSQno3a992VkEeooc MIA/rkyDKDJ+x0c61gPuFeFwrxotPbyAs+EWD1iG5/jV8LmO0o2Kt9QfELtrgdyUWHz/ bLk7efZybecWCJMImiX8aafWjov8nETwZ6D8Kgf/EMPYZzHP77eY/56J3nVzxVUr/ZqM wwJwCNyZ34opHJLpCZ3DjaBzEvkgEI8xjE7L4lC6PLNYMnPeeO3GHkBxSb8w9vW4kara DAVP3zq70NG+qm4vFtde4oNoda4uYX6ZHMrXH8QV403j9m6co1/8dBbDQbKlb1fEO7a0 r0qw== X-Gm-Message-State: AOJu0YxbEkacEUfGyLjrYcrD10Ty6EUq9mW6MmatZjC/8W669Z/AwoKG MnQDzLhjTi+TuO1RbEnQN5zBpU+h9M2Kb51mrCi1VA== X-Google-Smtp-Source: AGHT+IEq19OSQorM3CoK/ltjLPOeSBFDYytjpPYwZRdNkV4/DZ8wgHcxhZb44aVKI5gGcWiE7FsW1A== X-Received: by 2002:adf:f48f:0:b0:31f:ec06:204 with SMTP id l15-20020adff48f000000b0031fec060204mr6499690wro.52.1696112262794; Sat, 30 Sep 2023 15:17:42 -0700 (PDT) Received: from arnoutx1.home (2a01cb0404ad0b005ddb2bcd94e35264.ipv6.abo.wanadoo.fr. [2a01:cb04:4ad:b00:5ddb:2bcd:94e3:5264]) by smtp.gmail.com with ESMTPSA id z15-20020a5d4d0f000000b00324ae863ac1sm5681274wrt.35.2023.09.30.15.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 15:17:42 -0700 (PDT) To: buildroot@buildroot.org Date: Sun, 1 Oct 2023 00:16:34 +0200 Message-ID: <20230930221727.1458825-11-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230930221727.1458825-1-arnout@mind.be> References: <20230930221727.1458825-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696112263; x=1696717063; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TW/PasOVD3I7cUPhHGwiBR6C4GhvGUS6n6l+ZRpOg2o=; b=Xyb/TrL5DuZyPmVgjCIS9s+12J47Wec5dA0M7eG8wOA+ddDNzxtN+bKArN0aLqmYbQ md1iwEv30wQVJcuuJsm3jY/j3sHLmmMy22oCN/cm6Tdz5YXws9FC/bjJogYxdnNlltB/ NjTneMbnbW1Hy5EdiUKaiwUVdHB0J9qG8klDjcOZ49lWBtkcOFzD6/bDQO8HZov7iryl wmozTnPjFpiil3tJK5JD9fCL7sk3GbwJ9ak6uiMFnE5rz/PkEOaPXosP7QmAEeDdtChC r/y1gpV7WYRwB4f/Jesiv5n5CRD1bs/Gm3pbN2J/HcMCsxtSZ52eaJOKfYo+vxOwCnUD zqrw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=Xyb/TrL5 Subject: [Buildroot] [PATCH 10/10] docs/manual: remove references to PKG_PYTHON_*_OPTS X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: James Hilliard , "Signed-off-by : Thomas Petazzoni" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" These variables were removed. In addition, the text describing them wasn't terribly useful. Just remove the sentences describing them. Signed-off-by: Arnout Vandecappelle --- docs/manual/adding-packages-python.adoc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/manual/adding-packages-python.adoc b/docs/manual/adding-packages-python.adoc index 500967f235..33dbfc30a5 100644 --- a/docs/manual/adding-packages-python.adoc +++ b/docs/manual/adding-packages-python.adoc @@ -135,25 +135,13 @@ therefore only use a few of them, or none. makes sense to use for distutils/setuptools based packages as flit/pep517 based packages do not pass these options to a +setup.py+ script but instead pass them to +support/scripts/pyinstaller.py+. - For target distutils packages, the +PKG_PYTHON_DISTUTILS_BUILD_OPTS+ - options are already passed automatically by the infrastructure. * +PYTHON_FOO_INSTALL_TARGET_OPTS+, +PYTHON_FOO_INSTALL_STAGING_OPTS+, +HOST_PYTHON_FOO_INSTALL_OPTS+ to specify additional options to pass to the Python +setup.py+ script (for distutils/setuptools packages) or +support/scripts/pyinstaller.py+ (for flit/pep517 packages) during the target installation step, the staging installation step or the - host installation, respectively. Note that the infrastructure is - automatically passing some options, defined in - +PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS+ or - +PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS+ (for target distutils - packages), +HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS+ (for host - distutils packages), +PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS+ or - +PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS+ (for target setuptools - packages), +HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS+ (for host - setuptools packages) and +PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS+ or - +PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS+ (for target flit/pep517 - packages). + host installation, respectively. With the Python infrastructure, all the steps required to build and install the packages are already defined, and they generally work well