Browse Source

- python-setuptools: move target to package dir

master
vanhofen 3 years ago
parent
commit
d0387b94da
  1. 22
      make/host-tools.mk
  2. 39
      package/python-setuptools/patches/0001-add-executable.patch
  3. 22
      package/python-setuptools/python-setuptools.mk
  4. 25
      package/python3-setuptools/patches/0002-change-shebang-to-python3.patch

22
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

39
package/python3-setuptools/patches/0001-add-executable.patch → 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?= <joerg.krause@embedded.rocks>
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 <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
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

22
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)

25
package/python3-setuptools/patches/0002-change-shebang-to-python3.patch

@ -1,25 +0,0 @@
From c39d0896930e25c224cc897660fc8511ccae30c8 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Thu, 23 Apr 2020 10:01:12 +0000
Subject: [PATCH] change shebang to python3
Upstream-Status: Pending
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
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
Loading…
Cancel
Save