From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Bastian Krause Date: Tue, 22 Sep 2020 16:14:19 +0200 Message-Id: <20200922141434.8544-4-bst@pengutronix.de> In-Reply-To: <20200922141434.8544-1-bst@pengutronix.de> References: <20200922141434.8544-1-bst@pengutronix.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH v3 04/19] package templates: add python3 template List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Bastian Krause Signed-off-by: Bastian Krause --- Changes since v2: - turned into generic python3 template - add pypi mirror URL/suffix as defaults --- rules/templates/template-python3-in | 8 +++++ rules/templates/template-python3-make | 52 +++++++++++++++++++++++++++ scripts/lib/ptxd_lib_template.sh | 16 +++++++++ 3 files changed, 76 insertions(+) create mode 100644 rules/templates/template-python3-in create mode 100644 rules/templates/template-python3-make diff --git a/rules/templates/template-python3-in b/rules/templates/template-python3-in new file mode 100644 index 000000000..5f758f5bd --- /dev/null +++ b/rules/templates/template-python3-in @@ -0,0 +1,8 @@ +## SECTION=python3 + +config PYTHON3_@PACKAGE@ + tristate + select PYTHON3 + prompt "@package@" + help + FIXME diff --git a/rules/templates/template-python3-make b/rules/templates/template-python3-make new file mode 100644 index 000000000..bed25ea2e --- /dev/null +++ b/rules/templates/template-python3-make @@ -0,0 +1,52 @@ +# -*-makefile-*- +# +# Copyright (C) @YEAR@ by @AUTHOR@ +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_PYTHON3_@PACKAGE@) += python3-@package@ + +# +# Paths and names +# +PYTHON3_@PACKAGE@_VERSION := @VERSION@ +PYTHON3_@PACKAGE@_MD5 := +PYTHON3_@PACKAGE@ := @package@-$(PYTHON3_@PACKAGE@_VERSION) +PYTHON3_@PACKAGE@_SUFFIX := @SUFFIX@ +PYTHON3_@PACKAGE@_URL := @URL@ +PYTHON3_@PACKAGE@_SOURCE := $(SRCDIR)/$(PYTHON3_@PACKAGE@).$(PYTHON3_@PACKAGE@_SUFFIX) +PYTHON3_@PACKAGE@_DIR := $(BUILDDIR)/$(PYTHON3_@PACKAGE@) +PYTHON3_@PACKAGE@_LICENSE := unknown + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +PYTHON3_@PACKAGE@_CONF_TOOL := python3 + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/python3-@package@.targetinstall: + @$(call targetinfo) + + @$(call install_init, python3-@package@) + @$(call install_fixup, python3-@package@,PRIORITY,optional) + @$(call install_fixup, python3-@package@,SECTION,base) + @$(call install_fixup, python3-@package@,AUTHOR,"@AUTHOR@") + @$(call install_fixup, python3-@package@,DESCRIPTION,missing) + + @$(call install_glob, python3-@package@, 0, 0, -, \ + $(PYTHON3_SITEPACKAGES),, *.py) + + @$(call install_finish, python3-@package@) + + @$(call touch) + +# vim: syntax=make diff --git a/scripts/lib/ptxd_lib_template.sh b/scripts/lib/ptxd_lib_template.sh index 59c2a073e..a75c775a5 100644 --- a/scripts/lib/ptxd_lib_template.sh +++ b/scripts/lib/ptxd_lib_template.sh @@ -412,6 +412,22 @@ export -f ptxd_template_new_cross ptxd_template_help_list[${#ptxd_template_help_list[@]}]="cross" ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create cross development package" +ptxd_template_new_python3() { + ptxd_template_read_basic && + ptxd_template_read_author && + ptxd_template_read_url \ + "\$(call ptx/mirror-pypi, ${package}, \$(PYTHON3_${PACKAGE}).\$(PYTHON3_${PACKAGE}_SUFFIX))" \ + "tar.gz" + # turn URL of basedir into complete URL + [[ "$URL" != "\$(call ptx/mirror"* ]] \ + && URL="$URL/\$(${PACKAGE}).\$(${PACKAGE}_SUFFIX)" + package_filename="python3-${package_filename}" + ptxd_template_write_rules +} +export -f ptxd_template_new_python3 +ptxd_template_help_list[${#ptxd_template_help_list[@]}]="python3" +ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create python3 package for embedded target" + ptxd_template_new_src_autoconf_lib() { ptxd_template_autoconf_base } -- 2.28.0 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de