From d0387b94da9ea50bff48116255338d556780e172 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 17 Jun 2022 22:15:07 +0200 Subject: [PATCH] - python-setuptools: move target to package dir --- make/host-tools.mk | 22 ----------- .../patches/0001-add-executable.patch | 39 +++++++++++++++---- .../python-setuptools/python-setuptools.mk | 22 +++++++++++ .../0002-change-shebang-to-python3.patch | 25 ------------ 4 files changed, 54 insertions(+), 54 deletions(-) rename package/{python3-setuptools => python-setuptools}/patches/0001-add-executable.patch (54%) create mode 100644 package/python-setuptools/python-setuptools.mk delete mode 100644 package/python3-setuptools/patches/0002-change-shebang-to-python3.patch diff --git a/make/host-tools.mk b/make/host-tools.mk index 4c4dc930..197b172c 100644 --- a/make/host-tools.mk +++ b/make/host-tools.mk @@ -58,28 +58,6 @@ host-meson: $(HOST_MESON_DEPENDENCIES) $(DL_DIR)/$(HOST_MESON_SOURCE) | $(HOST_D # ----------------------------------------------------------------------------- -HOST_PYTHON3_SETUPTOOLS_VERSION = 44.0.0 -HOST_PYTHON3_SETUPTOOLS_DIR = setuptools-$(HOST_PYTHON3_SETUPTOOLS_VERSION) -HOST_PYTHON3_SETUPTOOLS_SOURCE = setuptools-$(HOST_PYTHON3_SETUPTOOLS_VERSION).zip -HOST_PYTHON3_SETUPTOOLS_SITE = https://files.pythonhosted.org/packages/b0/f3/44da7482ac6da3f36f68e253cb04de37365b3dba9036a3c70773b778b485 - -$(DL_DIR)/$(HOST_PYTHON3_SETUPTOOLS_SOURCE): - $(download) $(HOST_PYTHON3_SETUPTOOLS_SITE)/$(HOST_PYTHON3_SETUPTOOLS_SOURCE) - -HOST_PYTHON3_SETUPTOOLS_DEPENDENCIES = host-python3 - -host-python3-setuptools: $(HOST_PYTHON3_SETUPTOOLS_DEPENDENCIES) $(DL_DIR)/$(HOST_PYTHON3_SETUPTOOLS_SOURCE) | $(HOST_DIR) - $(REMOVE)/$(PKG_DIR) - $(UNZIP)/$(PKG_SOURCE) - $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) - $(CHDIR)/$(PKG_DIR); \ - $(HOST_PYTHON_BUILD); \ - $(HOST_PYTHON_INSTALL) - $(REMOVE)/$(PKG_DIR) - $(TOUCH) - -# ----------------------------------------------------------------------------- - # helper target to create ccache links ifndef CCACHE diff --git a/package/python3-setuptools/patches/0001-add-executable.patch b/package/python-setuptools/patches/0001-add-executable.patch similarity index 54% rename from package/python3-setuptools/patches/0001-add-executable.patch rename to package/python-setuptools/patches/0001-add-executable.patch index 1de66c2c..b688745c 100644 --- a/package/python3-setuptools/patches/0001-add-executable.patch +++ b/package/python-setuptools/patches/0001-add-executable.patch @@ -1,6 +1,27 @@ +From 9b3d307f8f6a1af88f3f810f5a6cf0835830e1e8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Mon, 7 Dec 2015 01:14:33 +0100 +Subject: [PATCH] add executable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + Add a new --executable option to distribute so that we can force the shebang line in installed python scripts. +[Thomas: refresh for setuptools 5.8.] +[Jörg: refresh for setuptools 18.7.1] + +Signed-off-by: Gustavo Zacarias +Signed-off-by: Thomas Petazzoni +Signed-off-by: Jörg Krause +--- + setuptools/command/install.py | 2 ++ + setuptools/command/install_scripts.py | 9 +++++++++ + 2 files changed, 11 insertions(+) + +diff --git a/setuptools/command/install.py b/setuptools/command/install.py +index 72b9a3e..6781d2b 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -16,6 +16,7 @@ class install(orig.install): @@ -11,17 +32,19 @@ force the shebang line in installed python scripts. ('old-and-unmanageable', None, "Try not to use this!"), ('single-version-externally-managed', None, "used by system package builders to create 'flat' eggs"), -@@ -31,6 +32,7 @@ class install(orig.install): +@@ -38,6 +39,7 @@ class install(orig.install): + ) - def initialize_options(self): orig.install.initialize_options(self) + self.executable = None self.old_and_unmanageable = None self.single_version_externally_managed = None +diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py +index 9cd8eb0..7786150 100644 --- a/setuptools/command/install_scripts.py +++ b/setuptools/command/install_scripts.py -@@ -12,6 +12,13 @@ +@@ -13,6 +13,13 @@ class install_scripts(orig.install_scripts): def initialize_options(self): orig.install_scripts.initialize_options(self) self.no_ep = False @@ -35,13 +58,15 @@ force the shebang line in installed python scripts. def run(self): import setuptools.command.easy_install as ei -@@ -32,6 +39,8 @@ +@@ -33,6 +40,8 @@ class install_scripts(orig.install_scripts): ) bs_cmd = self.get_finalized_command('build_scripts') exec_param = getattr(bs_cmd, 'executable', None) + if self.executable is not None: + exec_param = self.executable - bw_cmd = self.get_finalized_command("bdist_wininst") - is_wininst = getattr(bw_cmd, '_is_running', False) - writer = ei.ScriptWriter + try: + bw_cmd = self.get_finalized_command("bdist_wininst") + is_wininst = getattr(bw_cmd, '_is_running', False) +-- +2.30.2 diff --git a/package/python-setuptools/python-setuptools.mk b/package/python-setuptools/python-setuptools.mk new file mode 100644 index 00000000..5fe06f46 --- /dev/null +++ b/package/python-setuptools/python-setuptools.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# python-setuptools +# +################################################################################ + +PYTHON_SETUPTOOLS_VERSION = 62.1.0 +PYTHON_SETUPTOOLS_DIR = setuptools-$(PYTHON_SETUPTOOLS_VERSION) +PYTHON_SETUPTOOLS_SOURCE = setuptools-$(PYTHON_SETUPTOOLS_VERSION).tar.gz +PYTHON_SETUPTOOLS_SITE = https://files.pythonhosted.org/packages/ea/a3/3d3cbbb7150f90c4cf554048e1dceb7c6ab330e4b9138a40e130a4cc79e1 + +# ----------------------------------------------------------------------------- + +HOST_PYTHON_SETUPTOOLS_VERSION = $(PYTHON_SETUPTOOLS_VERSION) +HOST_PYTHON_SETUPTOOLS_DIR = $(PYTHON_SETUPTOOLS_DIR) +HOST_PYTHON_SETUPTOOLS_SOURCE = $(PYTHON_SETUPTOOLS_SOURCE) +HOST_PYTHON_SETUPTOOLS_SITE = $(PYTHON_SETUPTOOLS_SITE) + +HOST_PYTHON_SETUPTOOLS_DEPENDENCIES = host-python3 + +host-python-setuptools: | $(HOST_DIR) + $(call host-python3-package) diff --git a/package/python3-setuptools/patches/0002-change-shebang-to-python3.patch b/package/python3-setuptools/patches/0002-change-shebang-to-python3.patch deleted file mode 100644 index 6dcf5277..00000000 --- a/package/python3-setuptools/patches/0002-change-shebang-to-python3.patch +++ /dev/null @@ -1,25 +0,0 @@ -From c39d0896930e25c224cc897660fc8511ccae30c8 Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Thu, 23 Apr 2020 10:01:12 +0000 -Subject: [PATCH] change shebang to python3 - -Upstream-Status: Pending - -Signed-off-by: Changqing Li ---- - pkg_resources/_vendor/appdirs.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/pkg_resources/_vendor/appdirs.py b/pkg_resources/_vendor/appdirs.py -index ae67001..933e398 100644 ---- a/pkg_resources/_vendor/appdirs.py -+++ b/pkg_resources/_vendor/appdirs.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # -*- coding: utf-8 -*- - # Copyright (c) 2005-2010 ActiveState Software Inc. - # Copyright (c) 2013 Eddy Petrișor --- -2.24.1 -