1 |
commit: c040fc6dca43c5203e135412c814af7c26ec0040 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 27 09:00:32 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 27 09:03:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c040fc6d |
7 |
|
8 |
dev-lang/python-exec: Bump to 2.4.6 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/656204 |
11 |
|
12 |
dev-lang/python-exec/Manifest | 1 + |
13 |
dev-lang/python-exec/python-exec-2.4.6.ebuild | 134 ++++++++++++++++++++++++++ |
14 |
2 files changed, 135 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python-exec/Manifest b/dev-lang/python-exec/Manifest |
17 |
index e344e92d484..718cdfe0839 100644 |
18 |
--- a/dev-lang/python-exec/Manifest |
19 |
+++ b/dev-lang/python-exec/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST python-exec-2.4.5.tar.bz2 87137 BLAKE2B 2434bee0bcc64a78a83254d6b6f733ef0748d8209ff70654fc57ac50563d4f32be64705a3c56eefef4e173a238b272d00bef4929982a729a097b82a3a2b0b5b1 SHA512 8c1a520c565afa775cad0e8b88248b688814664e588f683fc2b2c039ee0494b168ebd3cd1042b8b7fe2583f287cf55b22ea0585bfb43efe2f8450d809cde0b21 |
22 |
+DIST python-exec-2.4.6.tar.bz2 87634 BLAKE2B 7b6de8ad0e0603fafd3284e6e3c5247ad83f145ab4db6728914318ae8e6f5aaa3c0247f4e01238fca11519ef72fb1b11436aea7e2b8c988b8717b3f6a2a43c37 SHA512 e05eaf01b83de196a10933636ab6b1a5489a421592df49b8b58eabd0e732de970f902744cd3a06b5ab530a6d69fe6dfa8f270fbb09b9fe3df4ae04d516828050 |
23 |
|
24 |
diff --git a/dev-lang/python-exec/python-exec-2.4.6.ebuild b/dev-lang/python-exec/python-exec-2.4.6.ebuild |
25 |
new file mode 100644 |
26 |
index 00000000000..9ed5ee58b77 |
27 |
--- /dev/null |
28 |
+++ b/dev-lang/python-exec/python-exec-2.4.6.ebuild |
29 |
@@ -0,0 +1,134 @@ |
30 |
+# Copyright 1999-2018 Gentoo Foundation |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=6 |
34 |
+ |
35 |
+# Kids, don't do this at home! |
36 |
+inherit python-utils-r1 |
37 |
+PYTHON_COMPAT=( "${_PYTHON_ALL_IMPLS[@]}" ) |
38 |
+ |
39 |
+# Inherited purely to have PYTHON_TARGET flags which will satisfy USE |
40 |
+# dependencies and trigger necessary rebuilds. |
41 |
+inherit python-r1 |
42 |
+ |
43 |
+DESCRIPTION="Python script wrapper" |
44 |
+HOMEPAGE="https://github.com/mgorny/python-exec/" |
45 |
+SRC_URI="https://github.com/mgorny/python-exec/releases/download/v${PV}/${P}.tar.bz2" |
46 |
+ |
47 |
+LICENSE="BSD-2" |
48 |
+SLOT="2" |
49 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
50 |
+IUSE="" |
51 |
+ |
52 |
+# eselect-python because of /usr/bin/python* collisions and new config |
53 |
+# python versions because of missing $scriptdir/python* symlinks |
54 |
+RDEPEND=" |
55 |
+ !<app-eselect/eselect-python-20160206 |
56 |
+ !<dev-lang/python-2.7.10-r4:2.7 |
57 |
+ !<dev-lang/python-3.3.5-r4:3.3 |
58 |
+ !<dev-lang/python-3.4.3-r4:3.4 |
59 |
+ !<dev-lang/python-3.5.0-r3:3.5" |
60 |
+ |
61 |
+src_configure() { |
62 |
+ local pyimpls=() i EPYTHON |
63 |
+ for i in "${PYTHON_COMPAT[@]}"; do |
64 |
+ python_export "${i}" EPYTHON |
65 |
+ pyimpls+=( "${EPYTHON}" ) |
66 |
+ done |
67 |
+ |
68 |
+ local myconf=( |
69 |
+ --with-fallback-path="${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin" |
70 |
+ --with-python-impls="${pyimpls[*]}" |
71 |
+ ) |
72 |
+ |
73 |
+ econf "${myconf[@]}" |
74 |
+} |
75 |
+ |
76 |
+src_install() { |
77 |
+ default |
78 |
+ |
79 |
+ # Prepare and own the template |
80 |
+ sed -n -e '/^#/p' config/python-exec.conf.example \ |
81 |
+ > "${T}"/python-exec.conf || die |
82 |
+ insinto /etc/python-exec |
83 |
+ doins "${T}"/python-exec.conf |
84 |
+ |
85 |
+ local f |
86 |
+ for f in python{,2,3}; do |
87 |
+ # symlink the C wrapper for python to avoid shebang recursion |
88 |
+ # bug #568974 |
89 |
+ dosym python-exec2c /usr/bin/"${f}" |
90 |
+ done |
91 |
+ for f in python{,2,3}-config 2to3 idle pydoc pyvenv; do |
92 |
+ # those are python scripts (except for new python-configs) |
93 |
+ # so symlink them via the python wrapper |
94 |
+ dosym ../lib/python-exec/python-exec2 /usr/bin/"${f}" |
95 |
+ done |
96 |
+} |
97 |
+ |
98 |
+pkg_preinst() { |
99 |
+ if [[ -e ${EROOT}etc/python-exec/python-exec.conf ]]; then |
100 |
+ # preserve current configuration |
101 |
+ cp "${EROOT}"etc/python-exec/python-exec.conf \ |
102 |
+ "${ED}"etc/python-exec/python-exec.conf || die |
103 |
+ else |
104 |
+ # preserve previous Python version preference |
105 |
+ local py old_pythons=() |
106 |
+ local config_base=${EROOT}etc/env.d/python |
107 |
+ |
108 |
+ # start with the 'global' preference (2 vs 3) |
109 |
+ if [[ -f ${config_base}/config ]]; then |
110 |
+ old_pythons+=( "$(<${config_base}/config)" ) |
111 |
+ fi |
112 |
+ |
113 |
+ # then try specific py3 selection |
114 |
+ for py in 3; do |
115 |
+ local target= |
116 |
+ |
117 |
+ if [[ -f ${config_base}/python${py} ]]; then |
118 |
+ # try the newer config files |
119 |
+ target=$(<${config_base}/python${py}) |
120 |
+ elif [[ -L ${EROOT}/usr/bin/python${py} ]]; then |
121 |
+ # check the older symlink format |
122 |
+ target=$(readlink "${EROOT}/usr/bin/python${py}") |
123 |
+ |
124 |
+ # check if it's actually old eselect symlink |
125 |
+ [[ ${target} == python?.? ]] || target= |
126 |
+ fi |
127 |
+ |
128 |
+ # add the extra target if found and != global |
129 |
+ if [[ ${target} && ${old_pythons[0]} != ${target} ]]; then |
130 |
+ old_pythons+=( "${target}" ) |
131 |
+ fi |
132 |
+ done |
133 |
+ |
134 |
+ if [[ ${old_pythons[@]} ]]; then |
135 |
+ elog "You seem to have just upgraded into the new version of python-exec" |
136 |
+ elog "that uses python-exec.conf for configuration. The ebuild has attempted" |
137 |
+ elog "to convert your previous configuration to the new format, resulting" |
138 |
+ elog "in the following preferences (most preferred version first):" |
139 |
+ elog |
140 |
+ for py in "${old_pythons[@]}"; do |
141 |
+ elog " ${py}" |
142 |
+ done |
143 |
+ elog |
144 |
+ elog "Those interpreters will be preferred when running Python scripts or" |
145 |
+ elog "calling wrapped Python executables (python, python2, pydoc...)." |
146 |
+ elog "If none of the preferred interpreters are supported, python-exec will" |
147 |
+ elog "fall back to the newest supported Python version." |
148 |
+ elog |
149 |
+ elog "Please note that due to the ambiguous character of the old settings," |
150 |
+ elog "you may want to modify the preference list yourself. In order to do so," |
151 |
+ elog "open the following file in your favorite editor:" |
152 |
+ elog |
153 |
+ elog " ${EROOT}etc/python-exec/python-exec.conf" |
154 |
+ elog |
155 |
+ elog "For more information on the new configuration format, please read" |
156 |
+ elog "the comment on top of the installed configuration file." |
157 |
+ |
158 |
+ local IFS=$'\n' |
159 |
+ echo "${old_pythons[*]}" \ |
160 |
+ >> "${ED}"etc/python-exec/python-exec.conf || die |
161 |
+ fi |
162 |
+ fi |
163 |
+} |