Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59C3FC05027 for ; Sun, 19 Feb 2023 14:54:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D36A8591E; Sun, 19 Feb 2023 15:53:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="U8L05FHV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1387185704; Sun, 19 Feb 2023 15:53:12 +0100 (CET) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E2D8D85843 for ; Sun, 19 Feb 2023 15:52:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id q20so262251ioj.11 for ; Sun, 19 Feb 2023 06:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=ab2+5JZUv6+C/17RoJhU2tqUmRkahvj9tMQZfbVMGpQ=; b=U8L05FHV0DqjpVMzcVrXJLf04gKiavhveFjPJxNP2mrz6T1ia5zl/KZFVyeSA4iNU+ 6MX8yBS7/YBjNUcqjxNGEuCQ7xLSTNRuyGwLGr4/SKNgLE3b3iegiZbdG+3avVRuz+qr JxZiOEoH/wOiGFpug5DC/3EO2UCKw8jHacUtc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ab2+5JZUv6+C/17RoJhU2tqUmRkahvj9tMQZfbVMGpQ=; b=LilrlWD4Xr49SSsoEuZkZy3SSBYY8eqVGwTdwj+T8OWKcp6qitzxfTYvm+ogdDT+Jk cQjTnHOsmRtopdA+Qd+ED3z0cV6MBR3WY6dOkMOWJ5xusYXJidKYD+Fgy4pIkcXvyOyC JnXrYdgf8jUvB8P22Tz314hhwbZxyHoKiorZ9K9bHmZqbQkEcfFLvRxPYF6vzFn7HnsQ VoWey0hnl/cKc7cMUT2NGxfza+a7ylJLRmVdYlrNNmoQq/RuienIehfoxECEXxOoIGUs nV+JlaxN2syERxHXCTM/Du3dXTXcychXWFD0Aop5DUVlof3xyxwsoZEx38WO27O4B+q9 a2lg== X-Gm-Message-State: AO0yUKUoXtvZT1bDGackx6gVD8h2xHFc7evnumFKwDtnRt3aAVL6i66Q Ua98PgjMyYrcRdxgDBvhXEWaUinv7dNIfhpy X-Google-Smtp-Source: AK7set99QoV0TfZGprww+GDW2RrDHQ0IEzKmGdXm5FlLL+zk4nlhQLHUpmNtwbdXIaileaE4NF8/pw== X-Received: by 2002:a5d:9c51:0:b0:734:6b18:3ee3 with SMTP id 17-20020a5d9c51000000b007346b183ee3mr5776653iof.13.1676818315732; Sun, 19 Feb 2023 06:51:55 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id c84-20020a6bb357000000b0071c66d1a2fcsm3444772iof.0.2023.02.19.06.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 06:51:55 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Alper Nebi Yasak , Neha Malcom Francis , Stefan Herbrechtsmeier , Philippe Reynes , Peng Fan , Simon Glass , =?UTF-8?q?Marek=20Beh=C3=BAn?= , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Quentin Schulz Subject: [PATCH 12/15] binman: Add support for building a binmanu PyPi package Date: Sun, 19 Feb 2023 07:51:20 -0700 Message-Id: <20230219145124.1782335-13-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230219145124.1782335-1-sjg@chromium.org> References: <20230219145124.1782335-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Create the necessary files to build this new package. It is not actually clear whether this is useful, since buildman has no purpose outside U-Boot. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass --- Makefile | 1 + tools/binmanu/main.py | 6 +++++- tools/binmanu/pyproject.toml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tools/binmanu/pyproject.toml diff --git a/Makefile b/Makefile index 86c85c70999..593e3629336 100644 --- a/Makefile +++ b/Makefile @@ -2285,6 +2285,7 @@ _pip: scripts/make_pip.sh patmanu ${PIP_ARGS} scripts/make_pip.sh buildman ${PIP_ARGS} scripts/make_pip.sh dtoc ${PIP_ARGS} + scripts/make_pip.sh binmanu ${PIP_ARGS} help: @echo 'Cleaning targets:' diff --git a/tools/binmanu/main.py b/tools/binmanu/main.py index 813343f2fda..9f33e11f4f0 100755 --- a/tools/binmanu/main.py +++ b/tools/binmanu/main.py @@ -141,8 +141,12 @@ def RunBinman(args): return ret_code -if __name__ == "__main__": +def start_binman(): args = cmdline.ParseArgs(sys.argv[1:]) ret_code = RunBinman(args) sys.exit(ret_code) + + +if __name__ == "__main__": + start_binman() diff --git a/tools/binmanu/pyproject.toml b/tools/binmanu/pyproject.toml new file mode 100644 index 00000000000..a32fae7d3cb --- /dev/null +++ b/tools/binmanu/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "binmanu" +version = "0.0.1" +authors = [ + { name="Simon Glass", email="sjg@chromium.org" }, +] +dependencies = ["pylibfdt", "u_boot_pylib", "dtoc"] +description = "Binman firmware-packaging tool" +readme = "README.rst" +requires-python = ">=3.7" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Operating System :: OS Independent", +] + +[project.urls] +"Homepage" = "https://u-boot.readthedocs.io/en/latest/develop/package/index.html" +"Bug Tracker" = "https://source.denx.de/groups/u-boot/-/issues" + +[project.scripts] +binman = "binmanu.main:start_binman" + +#[tool.setuptools] +#packages=['binmanu', 'binmanu.etype', 'binmanu.btool'] +[tool.setuptools.packages.find] +where = ["src"] -- 2.39.2.637.g21b0678d19-goog