xref: /OK3568_Linux_fs/buildroot/package/python-setuptools/0001-add-executable.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 9b3d307f8f6a1af88f3f810f5a6cf0835830e1e8 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
3Date: Mon, 7 Dec 2015 01:14:33 +0100
4Subject: [PATCH] add executable
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Add a new --executable option to distribute so that we can
10force the shebang line in installed python scripts.
11
12[Thomas: refresh for setuptools 5.8.]
13[Jörg: refresh for setuptools 18.7.1]
14
15Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
16Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
18---
19 setuptools/command/install.py         | 2 ++
20 setuptools/command/install_scripts.py | 9 +++++++++
21 2 files changed, 11 insertions(+)
22
23diff --git a/setuptools/command/install.py b/setuptools/command/install.py
24index 72b9a3e..6781d2b 100644
25--- a/setuptools/command/install.py
26+++ b/setuptools/command/install.py
27@@ -16,6 +16,7 @@ class install(orig.install):
28     """Use easy_install to install the package, w/dependencies"""
29
30     user_options = orig.install.user_options + [
31+        ('executable=', 'e', "specify final destination interpreter path"),
32         ('old-and-unmanageable', None, "Try not to use this!"),
33         ('single-version-externally-managed', None,
34          "used by system package builders to create 'flat' eggs"),
35@@ -38,6 +39,7 @@ class install(orig.install):
36         )
37
38         orig.install.initialize_options(self)
39+        self.executable = None
40         self.old_and_unmanageable = None
41         self.single_version_externally_managed = None
42
43diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py
44index 9cd8eb0..7786150 100644
45--- a/setuptools/command/install_scripts.py
46+++ b/setuptools/command/install_scripts.py
47@@ -13,6 +13,13 @@ class install_scripts(orig.install_scripts):
48     def initialize_options(self):
49         orig.install_scripts.initialize_options(self)
50         self.no_ep = False
51+        self.executable = None
52+
53+    def finalize_options(self):
54+        orig.install_scripts.finalize_options(self)
55+        self.set_undefined_options('install',
56+                ('executable','executable')
57+        )
58
59     def run(self):
60         import setuptools.command.easy_install as ei
61@@ -33,6 +40,8 @@ class install_scripts(orig.install_scripts):
62         )
63         bs_cmd = self.get_finalized_command('build_scripts')
64         exec_param = getattr(bs_cmd, 'executable', None)
65+        if self.executable is not None:
66+            exec_param = self.executable
67         try:
68             bw_cmd = self.get_finalized_command("bdist_wininst")
69             is_wininst = getattr(bw_cmd, '_is_running', False)
70--
712.30.2
72
73