Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/
Date: Sat, 30 May 2020 16:34:59
Message-Id: 1590856491.26765b42c5d082b3a1ee3003b1a2fc5b2904875a.grobian@gentoo
1 commit: 26765b42c5d082b3a1ee3003b1a2fc5b2904875a
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 30 16:34:51 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sat May 30 16:34:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=26765b42
7
8 dev-lang/python: cleanup
9
10 Package-Manager: Portage-2.3.84-prefix, Repoman-2.3.22
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 dev-lang/python/Manifest | 11 -
14 dev-lang/python/python-2.7.14-r2.ebuild | 645 --------------------------------
15 dev-lang/python/python-3.5.5-r1.ebuild | 442 ----------------------
16 dev-lang/python/python-3.5.7.ebuild | 439 ----------------------
17 dev-lang/python/python-3.6.6.ebuild | 444 ----------------------
18 5 files changed, 1981 deletions(-)
19
20 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
21 index 4251b00f58..88335e2d49 100644
22 --- a/dev-lang/python/Manifest
23 +++ b/dev-lang/python/Manifest
24 @@ -1,21 +1,10 @@
25 -DIST Python-2.7.14.tar.xz 12576112 BLAKE2B e03c4134cfdd88678acc26f383130a598ce4de908ab6bb9ee00e9235de3e0fcb9e653fec86f39db64fb895ef797d33736524655c5b94fab2cde2544b966b2cfb SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9
26 DIST Python-2.7.16.tar.xz 12752104 BLAKE2B 7d6b5b853f9974d44e04dd35ecdffaab87511e183b4b01dd4f8f4ee109c4b4ab208f045708f69717be9d3a706aa078b71438ed482c062c0b89c12730eae074ae SHA512 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
27 -DIST Python-3.5.5.tar.xz 15351440 BLAKE2B 217cb7f51e04d57983ce053ff4276d056e17c8223b6f3d87b69f556453fe2ae3d4dc2c1a6b9c2c6aad033cea9b40cd32264d8208cc81a1ec34ff252379bf95b8 SHA512 c9056baee6a2d1fe7f14b1f310db95b78e8972766d086f8ae10954f38f8182956171580bde01ddadebe897f2545a6fbe47669ca3e4887026ac1fae5ee9197f22
28 -DIST Python-3.5.7.tar.xz 15324736 BLAKE2B 0f1dd80584385b7f859652c85dc6b51bf71cd9f1d53fcf1716c54e8ffc3d2a36ef9969956e4429ac1ba878dad1e9acbb5f82ddb6a9923886bf3c84b3327dfecb SHA512 83f57451e1d7082bf19e4e49a0902e9257e381836d9a04154a6b276135fa49e5c96b6869eed9ec4475e06b76556c1ae89f5cca111b762eb8b2dee6f65373e0f4
29 -DIST Python-3.6.6.tar.xz 17156744 BLAKE2B fa4333149f84570cc4a0d1ec76c819610888750a51268b9db7d05df7d9c11e5ed72daff5d81b404015d9c678cb034d8a32034262ce73629ee8f96772853a706c SHA512 c71f87c5906e770322a14cacad228655659f782207db826320449d12bf86091c3662f317e1773158dec52f8b052eaedfb4c03b561cc2a6cfcd381597fd2d2b04
30 DIST Python-3.6.8.tar.xz 17212420 BLAKE2B e104b49a35492b622080ab81a446c0cdd1223e8ddf95c4e1b262762a027664b59f3e4deeda4ba7177115d780e48b6764a053acef640a645327df428d2e4820cd SHA512 b17867e451ebe662f50df83ed112d3656c089e7d750651ea640052b01b713b58e66aac9e082f71fd16f5b5510bc9b797f5ccd30f5399581e9aa406197f02938a
31 DIST Python-3.7.2.tar.xz 17042320 BLAKE2B 79b06b7d38590b7ad00850a4323156bfee07c4cf8531cbc09d262c6eb38721e32b8b0591fc21017e56948dd81763e9061f118f204eda5b9cc0b84e7132b42979 SHA512 6cd2d6d8455558783b99d55985cd7b22d67b98f41a09b4fdd96f680a630a4e035220d2b903f8c59ed513aa5ffe6730fa947ddb55bb72ce36f0e945ef8af5d971
32 -DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 BLAKE2B 0048e48ddaaa4bef08451354fde95a123042880f26dddc9267c7f9a90fd8abb40955e26ee8c9dfc5a1165556bb3e11585b27288e635d42a4000dd3d7654c41ad SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1
33 DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd
34 -DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed10748348484d314183c3de3ec950d5ca5ce7048bb322c470f3f5bff2d63eb7f2ed99c0fe75c621df050273d9d118681b28926061d SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec
35 -DIST python-gentoo-patches-3.6.6.tar.xz 13876 BLAKE2B 4be56b54e70c9b83209734097e03a7dbaa8f46ae13e268fc6a7f465ffd052ce03ca9e1fc45f1d432f2de17d4ce16ca8bc684b24344862cd8f52f9d1a90d90b7a SHA512 534b9eaefcbc45908119852a103bf10e400a8628c66aa599812fbceda36810d626d33e6701d1b7866e4df68397f717df6a217cb414049ca6f378eff9f43a27ab
36 DIST python-gentoo-patches-3.6.8.tar.xz 11224 BLAKE2B 5fe38282bcf28df18e0bd37756c880ae191ea738dc92f1cf83f682cfdc52525b9c44287dc99191a73d75c90672ab501b56adf49515b35ff1fdee88c8dc07b175 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df
37 DIST python-gentoo-patches-3.7.2.tar.xz 9776 BLAKE2B fe451c3fb44a1ace4489d1bc68db9848b4227422fe9135659594248d057a8916e2abfe8e2677ef6efc9c962dbefe3ca7cd05cbd62b325d53eef6b05928f82017 SHA512 55e932624333b78b55e8981aaa7e7bfbddb635a61f594353a77a6bd5c2b57de31a4ee9ae04e072c4e2eb0fddd1c2702b4bd6133cf0a2c94ab35808df86550156
38 -DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 BLAKE2B 75422fc7390f559d9864f6e22a0b85982ccbdb07d5f2507db8e528285e56d1f11d4bc0b21a0b78d5340eafd562220d2f1b9d0a78b1f7c811c5689a426a81f9f3 SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8
39 DIST python-prefix-2.7.16-gentoo-patches-r0.tar.xz 14636 BLAKE2B 54320f5197bb7adeca1e7c97447253e6535a11f380b6d66bc2ce46fa671fe23697aced8fd5619633a00e3ea19ae9dbc3ffe2981173d83dcab6b447d514555c43 SHA512 5380d9b92eb81603ec4d60ff9c940a3a061c06bd6f593d5837e600da5d4417b529d20d98d758aa95cef18fac10bdb5c33f90fa943deb15fdaf048492cf286581
40 -DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 BLAKE2B ab0cbc5430e9588f71cfd7b001a07f9a77097262f17e1f980e3945e39855e1c9437117bf4eb2d424dadf701d37d025e09627d7efdbb9f8867714039f62f261a7 SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5
41 -DIST python-prefix-3.5.7-gentoo-patches-r0.tar.xz 12716 BLAKE2B 162244df0abf05bc7da984cc0078bfd6cd9194e0ccbe81b75e85bbb5a9f8498838d729461ce36e230f05d8a02d5caef954686a52ff7789bae6ddda02f980b7f1 SHA512 361cb2274ca2721d903171d5f8f4ed5d4d9f67a48a738084a53bf607b9393e3b6cbc7e574e15fc423ca2478cf03ffd5b71bb70ffb28f4a2d4de3109e0037c1bb
42 -DIST python-prefix-3.6.5-gentoo-patches-r0.tar.xz 12728 BLAKE2B 8193b5eb59aaa923be299e1a68c62a2341be6d2367eb34a8e03436248a0c180012ba60e738ded7ca7f58849cde070b364761922518a5cdc425602172291aa2b0 SHA512 3bb1a97885112fb853b9ad061f21ba1f661e397d5585d932ddebe3107267be512799f966aef92e599ce2c97a4d51ec48bb214aa999b370b8d5a594e6f92182b6
43 DIST python-prefix-3.6.8-gentoo-patches-r0.tar.xz 12732 BLAKE2B 82c91f451aff1dcda6182dfc05f5566261d5ffa36bbf5527931a442e46563220884ca1fb192a7226411f5e0f7c59f347f6f1ed1ffa34aec0eb5208b22cc3f756 SHA512 e52587d5c9169b75f79e942cf5bbade9e499335f7e242ec262bc678e136f1d857803d4a8cb9630fdb8847ea1ab4c293aebf2d498e630984accea48ee0c3723f5
44 DIST python-prefix-3.7.2-gentoo-patches-r0.tar.xz 12568 BLAKE2B 1894b4a6081c8c6184ed10d405f7d320a25978f5c94be6b43d83a62afb125162fc2b12c4b06552a90bd92866a9a00b259f6c4894b41e1918c5315639b3866771 SHA512 cd2f6cfd65464ebdda7629ce2ff3e204c645bfa05dcecfe9cf02327049733366e069f1cd1291e6733946ad592a7dcd1d4a67877e96a1f41e232a01561b269c95
45 DIST python2-cygwinports-7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd16650cb5fc4a2c54fdac0228326f25cfba4fcd098ac9d689312d3e0dde6fca57f720d5235361d6462461cf018325c23fda9139e0f1683055aff SHA512 cabc21d2d7379daf1f4bafe7ab00b70e5b4f707d3102496b96ff0dfdced26347097ad771c69e0b9488b7c54b1ef36f9bc019bee72f1ffcbb55dcd0e71095edfe
46
47 diff --git a/dev-lang/python/python-2.7.14-r2.ebuild b/dev-lang/python/python-2.7.14-r2.ebuild
48 deleted file mode 100644
49 index 1cf440842d..0000000000
50 --- a/dev-lang/python/python-2.7.14-r2.ebuild
51 +++ /dev/null
52 @@ -1,645 +0,0 @@
53 -# Copyright 1999-2019 Gentoo Authors
54 -# Distributed under the terms of the GNU General Public License v2
55 -
56 -EAPI="5"
57 -WANT_LIBTOOL="none"
58 -
59 -inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
60 -
61 -MY_P="Python-${PV}"
62 -PATCHSET_VERSION="2.7.14-0"
63 -PREFIX_PATCHREV="r0"
64 -CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
65 -
66 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
67 -HOMEPAGE="https://www.python.org/"
68 -SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
69 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
70 - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz"
71 -
72 -[[ -n ${CYGWINPORTS_GITREV} ]] &&
73 -SRC_URI+=" elibc_Cygwin? (
74 - https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip
75 - -> python2-cygwinports-${CYGWINPORTS_GITREV}.zip )"
76 -
77 -LICENSE="PSF-2"
78 -SLOT="2.7"
79 -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
80 -IUSE="aqua -berkdb bluetooth build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
81 -
82 -# Do not add a dependency on dev-lang/python to this ebuild.
83 -# If you need to apply a patch which requires python for bootstrapping, please
84 -# run the bootstrap code on your dev box and include the results in the
85 -# patchset. See bug 447752.
86 -
87 -RDEPEND="app-arch/bzip2:0=
88 - >=sys-libs/zlib-1.1.3:0=
89 - !m68k-mint? ( virtual/libffi )
90 - virtual/libintl
91 - berkdb? ( || (
92 - sys-libs/db:5.3
93 - sys-libs/db:5.2
94 - sys-libs/db:5.1
95 - sys-libs/db:5.0
96 - sys-libs/db:4.8
97 - sys-libs/db:4.7
98 - sys-libs/db:4.6
99 - sys-libs/db:4.5
100 - sys-libs/db:4.4
101 - sys-libs/db:4.3
102 - sys-libs/db:4.2
103 - ) )
104 - gdbm? ( sys-libs/gdbm:0=[berkdb] )
105 - ncurses? ( >=sys-libs/ncurses-5.2:0= )
106 - readline? ( >=sys-libs/readline-4.1:0= )
107 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
108 - ssl? (
109 - !libressl? ( dev-libs/openssl:0= )
110 - libressl? ( dev-libs/libressl:0= )
111 - )
112 - tk? (
113 - >=dev-lang/tcl-8.0:0=
114 - >=dev-lang/tk-8.0:0=[-aqua]
115 - dev-tcltk/blt:0=
116 - dev-tcltk/tix
117 - )
118 - xml? ( >=dev-libs/expat-2.1 )
119 - !!<sys-apps/portage-2.1.9"
120 -# bluetooth requires headers from bluez
121 -DEPEND="${RDEPEND}
122 - bluetooth? ( net-wireless/bluez )
123 - virtual/pkgconfig
124 - >=sys-devel/autoconf-2.65
125 - !sys-devel/gcc[libffi(-)]"
126 -RDEPEND+=" !build? ( app-misc/mime-types )
127 - doc? ( dev-python/python-docs:${SLOT} )"
128 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
129 -
130 -[[ -n ${CYGWINPORTS_GITREV} ]] &&
131 -DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
132 -
133 -S="${WORKDIR}/${MY_P}"
134 -
135 -pkg_setup() {
136 - if use berkdb; then
137 - ewarn "'bsddb' module is out-of-date and no longer maintained inside"
138 - ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
139 - ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
140 - ewarn "is provided by dev-python/bsddb3."
141 - else
142 - if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
143 - ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
144 - ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
145 - ewarn "You might need to migrate your databases."
146 - fi
147 - fi
148 -}
149 -
150 -src_prepare() {
151 - # Ensure that internal copies of expat, libffi and zlib are not used.
152 - rm -r Modules/expat || die
153 - rm -r Modules/_ctypes/libffi* || die
154 - rm -r Modules/zlib || die
155 -
156 - if tc-is-cross-compiler; then
157 - local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
158 - fi
159 -
160 - EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
161 -
162 - # if building a patched source-tar, comment the rm's above, and uncomment
163 - # this line:
164 - #local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch"
165 -
166 - # Prefix' round of patches
167 - # http://prefix.gentooexperimental.org:8000/python-patches-2_7
168 - EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
169 - epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
170 - epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
171 - # Make sure python doesn't use the host libffi.
172 - use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
173 -
174 - if use aqua ; then
175 - # make sure we don't get a framework reference here
176 - sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
177 - -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
178 - Makefile.pre.in || die
179 - # Python upstream refuses to listen to configure arguments
180 - sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \
181 - configure.ac configure || die
182 - # we handle creation of symlinks in src_install
183 - sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die
184 - # build the Python framework without DESTDIR in install_name
185 - sed -i -e '/-install_name/s/$(DESTDIR)//' Makefile.pre.in || die
186 - fi
187 - # don't try to do fancy things on Darwin
188 - sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
189 - # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
190 - sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
191 - # fix header standards conflicts on Solaris
192 - if [[ ${CHOST} == *-solaris* ]] ; then
193 - # GCC5 switched the default from gnu89 to gnu11, a standards
194 - # conflict arises from that, which can be solved by upgrading
195 - # _XOPEN_SOURCE from 500 to 600, but since it is compiler
196 - # version specific, just force the old standard onto the
197 - # compiler. Python 3 properly detects this.
198 - CC="$(tc-getCC) -std=gnu89"
199 - fi
200 -
201 - if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
202 - local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
203 - for p in $(
204 - eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
205 - echo ${PATCH_URI}
206 - ); do
207 - # dropped by 01_all_prefix-no-patch-invention.patch
208 - [[ ${p} == *-tkinter-* ]] && continue
209 - epatch "${d}/${p}"
210 - done
211 - fi
212 -
213 - # Fix for cross-compiling.
214 - epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
215 - epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
216 - epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
217 - epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
218 - epatch "${FILESDIR}/2.7-disable-nis.patch"
219 - epatch "${FILESDIR}/python-2.7-libressl-compatibility.patch"
220 -
221 -
222 - epatch_user
223 -
224 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
225 - Lib/distutils/command/install.py \
226 - Lib/distutils/sysconfig.py \
227 - Lib/site.py \
228 - Lib/sysconfig.py \
229 - Lib/test/test_site.py \
230 - Makefile.pre.in \
231 - Modules/Setup.dist \
232 - Modules/getpath.c \
233 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
234 -
235 - eautoreconf
236 -}
237 -
238 -src_configure() {
239 - # dbm module can be linked against berkdb or gdbm.
240 - # Defaults to gdbm when both are enabled, #204343.
241 - local disable
242 - use berkdb || use gdbm || disable+=" dbm"
243 - use berkdb || disable+=" _bsddb"
244 - # disable automagic bluetooth headers detection
245 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
246 - use gdbm || disable+=" gdbm"
247 - use ncurses || disable+=" _curses _curses_panel"
248 - use readline || disable+=" readline"
249 - use sqlite || disable+=" _sqlite3"
250 - use ssl || export PYTHON_DISABLE_SSL="1"
251 - use tk || disable+=" _tkinter"
252 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
253 - [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
254 - [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs"
255 - export PYTHON_DISABLE_MODULES="${disable}"
256 -
257 - if ! use xml; then
258 - ewarn "You have configured Python without XML support."
259 - ewarn "This is NOT a recommended configuration as you"
260 - ewarn "may face problems parsing any XML documents."
261 - fi
262 -
263 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
264 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
265 - fi
266 -
267 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
268 - append-flags -fwrapv
269 - fi
270 -
271 - filter-flags -malign-double
272 -
273 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
274 - if is-flagq -O3; then
275 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
276 - use hardened && replace-flags -O3 -O2
277 - fi
278 -
279 - if tc-is-cross-compiler; then
280 - # Force some tests that try to poke fs paths.
281 - export ac_cv_file__dev_ptc=no
282 - export ac_cv_file__dev_ptmx=yes
283 - fi
284 -
285 - # http://bugs.gentoo.org/show_bug.cgi?id=302137
286 - if [[ ${CHOST} == powerpc-*-darwin* ]] && \
287 - ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \
288 - [[ ${CHOST} == powerpc64-*-darwin* ]];
289 - then
290 - replace-flags -O2 -O3
291 - replace-flags -Os -O3 # comment #14
292 - fi
293 -
294 - # Export CC so even AIX will use gcc instead of xlc_r.
295 - # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
296 - tc-export CC CXX
297 - # The configure script fails to use pkg-config correctly.
298 - # http://bugs.python.org/issue15506
299 - export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
300 -
301 - # Set LDFLAGS so we link modules with -lpython2.7 correctly.
302 - # Needed on FreeBSD unless Python 2.7 is already installed.
303 - # Please query BSD team before removing this!
304 - # On AIX this is not needed, but would record '.' as runpath.
305 - [[ ${CHOST} == *-aix* ]] ||
306 - append-ldflags "-L."
307 -
308 - if use prefix ; then
309 - # for Python's setup.py not to do false assumptions (only looking in
310 - # host paths) we need to make explicit where Prefix stuff is
311 - append-cppflags -I"${EPREFIX}"/usr/include
312 - append-ldflags -L"${EPREFIX}"/$(get_libdir)
313 - append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
314 - # fix compilation on some Linux hosts, #381163, #473520
315 - if use elibc_glibc ; then
316 - for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
317 - [[ -d ${hostlibdir} ]] || continue
318 - append-ldflags -L${hostlibdir}
319 - done
320 - fi
321 - # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that
322 - # local include paths - set in $(CPPFLAGS) - are searched first.
323 - sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
324 - fi
325 -
326 - local dbmliborder
327 - if use gdbm; then
328 - dbmliborder+="${dbmliborder:+:}gdbm"
329 - fi
330 - if use berkdb; then
331 - dbmliborder+="${dbmliborder:+:}bdb"
332 - fi
333 -
334 - [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
335 -
336 - # we need this to get pythonw, the GUI version of python
337 - # --enable-framework and --enable-shared are mutually exclusive:
338 - # http://bugs.python.org/issue5809
339 - local myshared=
340 - use aqua \
341 - && myshared="--enable-framework=${EPREFIX}/usr/lib" \
342 - || myshared="--enable-shared"
343 -
344 - BUILD_DIR="${WORKDIR}/${CHOST}"
345 - mkdir -p "${BUILD_DIR}" || die
346 - cd "${BUILD_DIR}" || die
347 -
348 - # note: for a framework build we need to use ucs2 because macOS
349 - # uses that internally too:
350 - # http://bugs.python.org/issue763708
351 - # HAS_HG to avoid finding obsolete hg of the host
352 - ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \
353 - econf \
354 - --with-fpectl \
355 - ${myshared} \
356 - $(use_enable ipv6) \
357 - $(use_with threads) \
358 - $( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
359 - --infodir='${prefix}/share/info' \
360 - --mandir='${prefix}/share/man' \
361 - --with-computed-gotos \
362 - --with-dbmliborder="${dbmliborder}" \
363 - --with-libc="" \
364 - --enable-loadable-sqlite-extensions \
365 - --with-system-expat \
366 - --with-system-ffi \
367 - --without-ensurepip
368 -
369 - if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
370 - eerror "configure has detected that the sem_open function is broken."
371 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
372 - die "Broken sem_open function (bug 496328)"
373 - fi
374 -}
375 -
376 -src_compile() {
377 - # Avoid invoking pgen for cross-compiles.
378 - touch Include/graminit.h Python/graminit.c
379 -
380 - cd "${BUILD_DIR}" || die
381 - emake
382 -
383 - # Work around bug 329499. See also bug 413751 and 457194.
384 - if has_version dev-libs/libffi[pax_kernel]; then
385 - pax-mark E python
386 - else
387 - pax-mark m python
388 - fi
389 -}
390 -
391 -src_test() {
392 - # Tests will not work when cross compiling.
393 - if tc-is-cross-compiler; then
394 - elog "Disabling tests due to crosscompiling."
395 - return
396 - fi
397 -
398 - cd "${BUILD_DIR}" || die
399 -
400 - # Skip failing tests.
401 - local skipped_tests="distutils gdb"
402 -
403 - for test in ${skipped_tests}; do
404 - mv "${S}"/Lib/test/test_${test}.py "${T}"
405 - done
406 -
407 - # Daylight saving time problem
408 - # https://bugs.python.org/issue22067
409 - # https://bugs.gentoo.org/610628
410 - local -x TZ=UTC
411 -
412 - # Rerun failed tests in verbose mode (regrtest -w).
413 - emake test EXTRATESTOPTS="-w" < /dev/tty
414 - local result="$?"
415 -
416 - for test in ${skipped_tests}; do
417 - mv "${T}/test_${test}.py" "${S}"/Lib/test
418 - done
419 -
420 - elog "The following tests have been skipped:"
421 - for test in ${skipped_tests}; do
422 - elog "test_${test}.py"
423 - done
424 -
425 - elog "If you would like to run them, you may:"
426 - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
427 - elog "and run the tests separately."
428 -
429 - if [[ "${result}" -ne 0 ]]; then
430 - die "emake test failed"
431 - fi
432 -}
433 -
434 -src_install() {
435 - local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
436 -
437 - cd "${BUILD_DIR}" || die
438 - [[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/
439 - if use aqua ; then
440 - local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework
441 -
442 - # do not make multiple targets in parallel when there are broken
443 - # sharedmods (during bootstrap), would build them twice in parallel.
444 -
445 - # Python_Launcher is kind of a wrapper, and we should fix it for
446 - # Prefix (it uses /usr/bin/pythonw) so useless
447 - # IDLE doesn't run, no idea, but definitely not used
448 - sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
449 - Mac/Makefile || die
450 -
451 - # let the makefiles do their thing
452 - emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
453 - rmdir "${ED}"/Applications/Python* || die
454 - rmdir "${ED}"/Applications || die
455 -
456 - # avoid framework incompatability, degrade to a normal UNIX lib
457 - mkdir -p "${ED}"/usr/$(get_libdir)
458 - cp "${D}${fwdir}"/Versions/${SLOT}/Python \
459 - "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
460 - chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
461 - install_name_tool \
462 - -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
463 - "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
464 - chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
465 - cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
466 -
467 - # rebuild python executable to be the non-pythonw (python wrapper)
468 - # version so we don't get framework crap
469 - rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861
470 - $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
471 - -o "${ED}"/usr/bin/python${SLOT} \
472 - Modules/python.o || die
473 -
474 - # don't install the "Current" symlink, will always conflict
475 - rm "${D}${fwdir}"/Versions/Current || die
476 - # update whatever points to it, eselect-python sets them
477 - rm "${D}${fwdir}"/{Headers,Python,Resources} || die
478 -
479 - # remove unversioned files (that are not made versioned below)
480 - pushd "${ED}"/usr/bin > /dev/null
481 - rm -f python python-config python${SLOT}-config
482 - # python${SLOT} was created above
483 - for f in pythonw smtpd${SLOT}.py pydoc idle ; do
484 - rm -f ${f} ${f}${SLOT}
485 - done
486 - # pythonw needs to remain in the framework (that's the whole
487 - # reason we go through this framework hassle)
488 - ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
489 - # copy the scripts to we can fix their shebangs
490 - for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
491 - # for some reason sometimes they already exist, bug #347321
492 - rm -f ${f}
493 - cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
494 - sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
495 - ${f} || die
496 - done
497 - # "fix" to have below collision fix not to bail
498 - mv pydoc${SLOT} pydoc || die
499 - mv idle${SLOT} idle || die
500 - popd > /dev/null
501 -
502 - # basically we don't like the framework stuff at all, so just move
503 - # stuff around or add some symlinks to make our life easier
504 - mkdir -p "${ED}"/usr
505 - mv "${D}${fwdir}"/Versions/${SLOT}/share \
506 - "${ED}"/usr/ || die "can't move share"
507 - # get includes just UNIX style
508 - mkdir -p "${ED}"/usr/include
509 - mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
510 - "${ED}"/usr/include/ || die "can't move include"
511 - pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
512 - ln -s ../../../../../include/python${SLOT} || die
513 - popd > /dev/null
514 - rm -f "${ED}"/usr/share/man/man1/python{,2}.1
515 -
516 - # same for libs
517 - # NOTE: can't symlink the entire dir, because a real dir already exists
518 - # on upgrade (site-packages), however since we h4x0rzed python to
519 - # actually look into the UNIX-style dir, we just switch them around.
520 - mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
521 - mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
522 - "${ED}"/usr/$(get_libdir)/python${SLOT}/ \
523 - || die "can't move python${SLOT}"
524 - rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
525 - pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
526 - ln -s ../../../../python${SLOT} || die
527 - popd > /dev/null
528 -
529 - # fix up Makefile
530 - sed -i \
531 - -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
532 - -e '/^LDFLAGS=/s/=.*$/=/' \
533 - -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
534 - -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
535 - -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
536 - -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
537 - -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
538 - -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
539 - "${libdir}"/config/Makefile || die
540 - # and sysconfigdata likewise
541 - sed -i \
542 - -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
543 - -e "/'LDFLAGS'/s/:.*$/:'',/" \
544 - -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
545 - -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
546 - -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
547 - -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
548 - -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
549 - -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
550 - "${libdir}"/_sysconfigdata.py || die
551 -
552 - # add missing version.plist file
553 - mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
554 - cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
555 -<?xml version="1.0" encoding="UTF-8"?>
556 -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
557 -"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
558 -<plist version="1.0">
559 -<dict>
560 - <key>BuildVersion</key>
561 - <string>1</string>
562 - <key>CFBundleShortVersionString</key>
563 - <string>${PV}</string>
564 - <key>CFBundleVersion</key>
565 - <string>${PV}</string>
566 - <key>ProjectName</key>
567 - <string>Python</string>
568 - <key>SourceVersion</key>
569 - <string>${PV}</string>
570 -</dict>
571 -</plist>
572 -EOF
573 - else
574 - emake DESTDIR="${D}" altinstall
575 - fi
576 -
577 - sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
578 - if [[ ${CHOST} == *-aix* ]]; then
579 - # fix upstream bugs with quite large proposed diffs still to be sorted out:
580 - # http://bugs.python.org/issue13493
581 - # http://bugs.python.org/issue14150
582 - # http://bugs.python.org/issue15590
583 - # http://bugs.python.org/issue16189
584 - sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \
585 - -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed"
586 - sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \
587 - -e 's| -bI:| -Wl,-bI:|g' \
588 - -e '/LINKFORSHARED/s|-bE:|-bI:|g' \
589 - -e '/LINKFORSHARED/s| -lld||g' \
590 - -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed"
591 - fi
592 -
593 - # Fix collisions between different slots of Python.
594 - mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
595 - mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
596 - mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
597 - rm -f "${ED}usr/bin/smtpd.py"
598 -
599 - # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
600 - # These #defines cause problems when building c99 compliant python modules
601 - # http://bugs.python.org/issue1759169
602 - [[ ${CHOST} == *-solaris* ]] && sed -i -e \
603 - 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
604 - "${ED}"/usr/include/python${SLOT}/pyconfig.h
605 -
606 - use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
607 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
608 - use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
609 - use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
610 -
611 - use threads || rm -r "${libdir}/multiprocessing" || die
612 - use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
613 -
614 - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
615 -
616 - if use examples; then
617 - insinto /usr/share/doc/${PF}/examples
618 - doins -r "${S}"/Tools
619 - fi
620 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
621 - local libname
622 - if use aqua ; then
623 - # we do framework, so the emake trick below returns a pathname
624 - # since that won't work here, use a (cheap) trick instead
625 - libname=libpython${SLOT}
626 - else
627 - libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
628 - emake --no-print-directory -s -f - 2>/dev/null)
629 - fi
630 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
631 -
632 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
633 - newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
634 - sed \
635 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
636 - -e "s:@PYDOC@:pydoc${SLOT}:" \
637 - -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
638 -
639 - # for python-exec
640 - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
641 -
642 - # if not using a cross-compiler, use the fresh binary
643 - if ! tc-is-cross-compiler; then
644 - local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
645 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
646 - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
647 - local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}"
648 - else
649 - vars=( PYTHON "${vars[@]}" )
650 - fi
651 -
652 - python_export "python${SLOT}" "${vars[@]}"
653 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
654 - python_domodule epython.py
655 -
656 - # python-exec wrapping support
657 - local pymajor=${SLOT%.*}
658 - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
659 - # python and pythonX
660 - ln -s "../../../bin/python${SLOT}" \
661 - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
662 - ln -s "python${pymajor}" \
663 - "${D}${PYTHON_SCRIPTDIR}/python" || die
664 - # python-config and pythonX-config
665 - ln -s "../../../bin/python${SLOT}-config" \
666 - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
667 - ln -s "python${pymajor}-config" \
668 - "${D}${PYTHON_SCRIPTDIR}/python-config" || die
669 - # 2to3, pydoc, pyvenv
670 - ln -s "../../../bin/2to3-${SLOT}" \
671 - "${D}${PYTHON_SCRIPTDIR}/2to3" || die
672 - ln -s "../../../bin/pydoc${SLOT}" \
673 - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
674 - # idle
675 - if use tk; then
676 - ln -s "../../../bin/idle${SLOT}" \
677 - "${D}${PYTHON_SCRIPTDIR}/idle" || die
678 - fi
679 -}
680 -
681 -eselect_python_update() {
682 - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
683 - eselect python update
684 - fi
685 -
686 - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
687 - eselect python update --python${PV%%.*}
688 - fi
689 -}
690 -
691 -pkg_postinst() {
692 - eselect_python_update
693 -}
694 -
695 -pkg_postrm() {
696 - eselect_python_update
697 -}
698
699 diff --git a/dev-lang/python/python-3.5.5-r1.ebuild b/dev-lang/python/python-3.5.5-r1.ebuild
700 deleted file mode 100644
701 index c9e5669455..0000000000
702 --- a/dev-lang/python/python-3.5.5-r1.ebuild
703 +++ /dev/null
704 @@ -1,442 +0,0 @@
705 -# Copyright 1999-2018 Gentoo Foundation
706 -# Distributed under the terms of the GNU General Public License v2
707 -
708 -EAPI="5"
709 -WANT_LIBTOOL="none"
710 -
711 -inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
712 -
713 -MY_P="Python-${PV/_/}"
714 -PATCHSET_VERSION="3.5.4-0"
715 -PREFIX_PATCHREV="3.5.4-gentoo-patches-r0"
716 -
717 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
718 -HOMEPAGE="https://www.python.org/"
719 -SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
720 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
721 - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PREFIX_PATCHREV}.tar.xz"
722 -
723 -LICENSE="PSF-2"
724 -SLOT="3.5/3.5m"
725 -KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
726 -IUSE="aqua bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
727 -RESTRICT="!test? ( test )"
728 -
729 -# Do not add a dependency on dev-lang/python to this ebuild.
730 -# If you need to apply a patch which requires python for bootstrapping, please
731 -# run the bootstrap code on your dev box and include the results in the
732 -# patchset. See bug 447752.
733 -
734 -RDEPEND="app-arch/bzip2:0=
735 - app-arch/xz-utils:0=
736 - >=sys-libs/zlib-1.1.3:0=
737 - virtual/libffi
738 - virtual/libintl
739 - gdbm? ( sys-libs/gdbm:0=[berkdb] )
740 - ncurses? ( >=sys-libs/ncurses-5.2:0= )
741 - readline? ( >=sys-libs/readline-4.1:0= )
742 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
743 - ssl? (
744 - !libressl? ( dev-libs/openssl:0= )
745 - libressl? ( dev-libs/libressl:0= )
746 - )
747 - tk? (
748 - >=dev-lang/tcl-8.0:0=
749 - >=dev-lang/tk-8.0:0=[-aqua]
750 - dev-tcltk/blt:0=
751 - dev-tcltk/tix
752 - )
753 - xml? ( >=dev-libs/expat-2.1:0= )
754 - !!<sys-apps/sandbox-2.6-r1"
755 -# bluetooth requires headers from bluez
756 -DEPEND="${RDEPEND}
757 - bluetooth? ( net-wireless/bluez )
758 - virtual/pkgconfig
759 - !sys-devel/gcc[libffi(-)]"
760 -RDEPEND+=" !build? ( app-misc/mime-types )"
761 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
762 -
763 -S="${WORKDIR}/${MY_P}"
764 -
765 -PYVER=${SLOT%/*}
766 -
767 -src_prepare() {
768 - # Ensure that internal copies of expat, libffi and zlib are not used.
769 - rm -fr Modules/expat
770 - rm -fr Modules/_ctypes/libffi*
771 - rm -fr Modules/zlib
772 -
773 - if tc-is-cross-compiler; then
774 - # Invokes BUILDPYTHON, which is built for the host arch
775 - local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
776 - fi
777 -
778 - EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
779 - epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
780 - epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
781 - epatch "${FILESDIR}/3.6-disable-nis.patch"
782 - epatch "${FILESDIR}/python-3.5.5-libressl-compatibility.patch"
783 - epatch "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
784 -
785 - epatch_user
786 -
787 - # Prefix' round of patches
788 - # http://prefix.gentooexperimental.org:8000/python-patches-3_3
789 - EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
790 - epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV}
791 -
792 - # https://forums.developer.apple.com/thread/9233, bug #572726
793 - sed -i -e '/$(RUNSHARED) .\/regen/s/^/export RUNSHARED=$(RUNSHARED); /' \
794 - Makefile.pre.in || die
795 - sed -i -e '/python$EXE/s/^/env ${RUNSHARED} /' \
796 - Lib/plat-darwin/regen || die
797 -
798 - # we provide a fully working readline also on Darwin, so don't force
799 - # usage of less functional libedit
800 - sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
801 -
802 - # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR.
803 - sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
804 -
805 - # Make sure python doesn't use the host libffi.
806 - use prefix && epatch "${FILESDIR}/python-3.5.4-libffi-pkgconfig.patch"
807 -
808 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
809 - configure.ac \
810 - Lib/distutils/command/install.py \
811 - Lib/distutils/sysconfig.py \
812 - Lib/site.py \
813 - Lib/sysconfig.py \
814 - Lib/test/test_site.py \
815 - Makefile.pre.in \
816 - Modules/getpath.c \
817 - Modules/Setup.dist \
818 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
819 -
820 - # workaround a development build env problem and muck around
821 - # framework install to get the best of both worlds (non-standard)
822 - sed -i \
823 - -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
824 - -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
825 - configure.ac configure || die
826 - sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
827 -
828 - # Disable ABI flags.
829 - sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
830 -
831 - eautoreconf
832 -}
833 -
834 -src_configure() {
835 - local disable
836 - # disable automagic bluetooth headers detection
837 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
838 - use gdbm || disable+=" gdbm"
839 - use ncurses || disable+=" _curses _curses_panel"
840 - use readline || disable+=" readline"
841 - use sqlite || disable+=" _sqlite3"
842 - use ssl || export PYTHON_DISABLE_SSL="1"
843 - use tk || disable+=" _tkinter"
844 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
845 - export PYTHON_DISABLE_MODULES="${disable}"
846 -
847 - if ! use xml; then
848 - ewarn "You have configured Python without XML support."
849 - ewarn "This is NOT a recommended configuration as you"
850 - ewarn "may face problems parsing any XML documents."
851 - fi
852 -
853 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
854 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
855 - fi
856 -
857 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
858 - append-flags -fwrapv
859 - fi
860 -
861 - filter-flags -malign-double
862 -
863 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
864 - if is-flagq -O3; then
865 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
866 - use hardened && replace-flags -O3 -O2
867 - fi
868 -
869 - # Export CC so even AIX will use gcc instead of xlc_r.
870 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
871 - tc-export CC CXX
872 -
873 - # The configure script fails to use pkg-config correctly.
874 - # http://bugs.python.org/issue15506
875 - export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
876 -
877 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
878 - # Needed on FreeBSD unless Python 3.2 is already installed.
879 - # Please query BSD team before removing this!
880 - append-ldflags "-L."
881 -
882 - # make sure setup.py considers Prefix' paths before system ones
883 - use prefix && append-cppflags -I"${EPREFIX}"/usr/include
884 - use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
885 -
886 - local dbmliborder
887 - if use gdbm; then
888 - dbmliborder+="${dbmliborder:+:}gdbm"
889 - fi
890 -
891 - BUILD_DIR="${WORKDIR}/${CHOST}"
892 - mkdir -p "${BUILD_DIR}" || die
893 - cd "${BUILD_DIR}" || die
894 -
895 - if use aqua ; then
896 - ECONF_SOURCE="${S}" OPT="" \
897 - econf \
898 - --enable-framework="${EPREFIX}"/usr/lib \
899 - --config-cache
900 - fi
901 -
902 - # pymalloc #452720
903 - local myeconfargs=(
904 - $(use aqua && echo --config-cache) \
905 - --with-fpectl
906 - --enable-shared
907 - $(use_enable ipv6)
908 - $(use_with threads)
909 - --infodir='${prefix}/share/info'
910 - --mandir='${prefix}/share/man'
911 - --with-computed-gotos
912 - --with-dbmliborder="${dbmliborder}"
913 - --with-libc=
914 - --enable-loadable-sqlite-extensions
915 - --without-ensurepip
916 - --with-system-expat
917 - --with-system-ffi
918 - --without-pymalloc
919 - )
920 -
921 - ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
922 -
923 - if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
924 - eerror "configure has detected that the sem_open function is broken."
925 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
926 - die "Broken sem_open function (bug 496328)"
927 - fi
928 -}
929 -
930 -src_compile() {
931 - # Ensure sed works as expected
932 - # https://bugs.gentoo.org/594768
933 - local -x LC_ALL=C
934 -
935 - cd "${BUILD_DIR}" || die
936 -
937 - emake CPPFLAGS= CFLAGS= LDFLAGS=
938 -
939 - # Work around bug 329499. See also bug 413751 and 457194.
940 - if has_version dev-libs/libffi[pax_kernel]; then
941 - pax-mark E python
942 - else
943 - pax-mark m python
944 - fi
945 -}
946 -
947 -src_test() {
948 - # Tests will not work when cross compiling.
949 - if tc-is-cross-compiler; then
950 - elog "Disabling tests due to crosscompiling."
951 - return
952 - fi
953 -
954 - cd "${BUILD_DIR}" || die
955 -
956 - # Skip failing tests.
957 - local skipped_tests="gdb"
958 -
959 - for test in ${skipped_tests}; do
960 - mv "${S}"/Lib/test/test_${test}.py "${T}"
961 - done
962 -
963 - local -x PYTHONDONTWRITEBYTECODE=
964 - emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
965 - local result=$?
966 -
967 - for test in ${skipped_tests}; do
968 - mv "${T}/test_${test}.py" "${S}"/Lib/test
969 - done
970 -
971 - elog "The following tests have been skipped:"
972 - for test in ${skipped_tests}; do
973 - elog "test_${test}.py"
974 - done
975 -
976 - elog "If you would like to run them, you may:"
977 - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
978 - elog "and run the tests separately."
979 -
980 - if [[ ${result} -ne 0 ]]; then
981 - die "emake test failed"
982 - fi
983 -}
984 -
985 -src_install() {
986 - local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
987 -
988 - cd "${BUILD_DIR}" || die
989 -
990 - emake DESTDIR="${D}" altinstall
991 -
992 - if use aqua ; then
993 - # avoid config.status to be triggered
994 - find Mac -name "Makefile" -exec touch \{\} + || die
995 -
996 - # Python_Launcher is kind of a wrapper, and we should fix it for
997 - # Prefix (it uses /usr/bin/pythonw) so useless
998 - # IDLE doesn't run, no idea, but definitely not used
999 - emake DESTDIR="${D}" -C Mac install_Python || die
1000 - rmdir "${ED}"/Applications/Python* || die
1001 - rmdir "${ED}"/Applications || die
1002 -
1003 - local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER}
1004 - ln -s "${EPREFIX}"/usr/include/python${PYVER} \
1005 - "${ED}${fwdir}"/Headers || die
1006 - ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
1007 - "${ED}${fwdir}"/Python || die
1008 - fi
1009 -
1010 - sed \
1011 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
1012 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
1013 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
1014 -
1015 - # Fix collisions between different slots of Python.
1016 - rm -f "${ED}usr/$(get_libdir)/libpython3.so"
1017 -
1018 - # Cheap hack to get version with ABIFLAGS
1019 - local abiver=$(cd "${ED}usr/include"; echo python*)
1020 - if [[ ${abiver} != python${PYVER} ]]; then
1021 - # Replace python3.X with a symlink to python3.Xm
1022 - rm "${ED}usr/bin/python${PYVER}" || die
1023 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1024 - # Create python3.X-config symlink
1025 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1026 - # Create python-3.5m.pc symlink
1027 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1028 - fi
1029 -
1030 - # python seems to get rebuilt in src_install (bug 569908)
1031 - # Work around it for now.
1032 - if has_version dev-libs/libffi[pax_kernel]; then
1033 - pax-mark E "${ED}usr/bin/${abiver}"
1034 - else
1035 - pax-mark m "${ED}usr/bin/${abiver}"
1036 - fi
1037 -
1038 - use elibc_uclibc && rm -fr "${libdir}/test"
1039 - use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
1040 - use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
1041 -
1042 - use threads || rm -fr "${libdir}/multiprocessing"
1043 - use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
1044 -
1045 - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
1046 -
1047 - if use examples; then
1048 - insinto /usr/share/doc/${PF}/examples
1049 - find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
1050 - doins -r "${S}"/Tools
1051 - fi
1052 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1053 - if use aqua ; then
1054 - # we do framework, so the emake trick below returns a pathname
1055 - # since that won't work here, use a (cheap) trick instead
1056 - local libname=libpython${PYVER}
1057 - else
1058 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1059 - emake --no-print-directory -s -f - 2>/dev/null)
1060 - fi
1061 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1062 -
1063 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1064 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1065 - sed \
1066 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1067 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1068 - -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
1069 -
1070 - # for python-exec
1071 - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
1072 -
1073 - # if not using a cross-compiler, use the fresh binary
1074 - if ! tc-is-cross-compiler; then
1075 - local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
1076 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
1077 - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
1078 - else
1079 - vars=( PYTHON "${vars[@]}" )
1080 - fi
1081 -
1082 - python_export "python${PYVER}" "${vars[@]}"
1083 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1084 - python_domodule epython.py
1085 -
1086 - # python-exec wrapping support
1087 - local pymajor=${PYVER%.*}
1088 - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
1089 - # python and pythonX
1090 - ln -s "../../../bin/${abiver}" \
1091 - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
1092 - ln -s "python${pymajor}" \
1093 - "${D}${PYTHON_SCRIPTDIR}/python" || die
1094 - # python-config and pythonX-config
1095 - # note: we need to create a wrapper rather than symlinking it due
1096 - # to some random dirname(argv[0]) magic performed by python-config
1097 - cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
1098 - #!/bin/sh
1099 - exec "${abiver}-config" "\${@}"
1100 - EOF
1101 - chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
1102 - ln -s "python${pymajor}-config" \
1103 - "${D}${PYTHON_SCRIPTDIR}/python-config" || die
1104 - # 2to3, pydoc, pyvenv
1105 - ln -s "../../../bin/2to3-${PYVER}" \
1106 - "${D}${PYTHON_SCRIPTDIR}/2to3" || die
1107 - ln -s "../../../bin/pydoc${PYVER}" \
1108 - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
1109 - ln -s "../../../bin/pyvenv-${PYVER}" \
1110 - "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
1111 - # idle
1112 - if use tk; then
1113 - ln -s "../../../bin/idle${PYVER}" \
1114 - "${D}${PYTHON_SCRIPTDIR}/idle" || die
1115 - fi
1116 -}
1117 -
1118 -pkg_preinst() {
1119 - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
1120 - python_updater_warning="1"
1121 - fi
1122 -}
1123 -
1124 -eselect_python_update() {
1125 - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
1126 - eselect python update
1127 - fi
1128 -
1129 - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
1130 - eselect python update --python${PV%%.*}
1131 - fi
1132 -}
1133 -
1134 -pkg_postinst() {
1135 - eselect_python_update
1136 -
1137 - if [[ "${python_updater_warning}" == "1" ]]; then
1138 - ewarn "You have just upgraded from an older version of Python."
1139 - ewarn
1140 - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
1141 - fi
1142 -}
1143 -
1144 -pkg_postrm() {
1145 - eselect_python_update
1146 -}
1147
1148 diff --git a/dev-lang/python/python-3.5.7.ebuild b/dev-lang/python/python-3.5.7.ebuild
1149 deleted file mode 100644
1150 index 584ebdef79..0000000000
1151 --- a/dev-lang/python/python-3.5.7.ebuild
1152 +++ /dev/null
1153 @@ -1,439 +0,0 @@
1154 -# Copyright 1999-2019 Gentoo Authors
1155 -# Distributed under the terms of the GNU General Public License v2
1156 -
1157 -EAPI="5"
1158 -WANT_LIBTOOL="none"
1159 -
1160 -inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
1161 -
1162 -MY_P="Python-${PV/_/}"
1163 -PATCHSET_VERSION="3.5.4-0"
1164 -PREFIX_PATCHREV="${PV}-gentoo-patches-r0"
1165 -
1166 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
1167 -HOMEPAGE="https://www.python.org/"
1168 -SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
1169 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
1170 - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PREFIX_PATCHREV}.tar.xz"
1171 -
1172 -LICENSE="PSF-2"
1173 -SLOT="3.5/3.5m"
1174 -KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1175 -IUSE="aqua bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
1176 -RESTRICT="!test? ( test )"
1177 -
1178 -# Do not add a dependency on dev-lang/python to this ebuild.
1179 -# If you need to apply a patch which requires python for bootstrapping, please
1180 -# run the bootstrap code on your dev box and include the results in the
1181 -# patchset. See bug 447752.
1182 -
1183 -RDEPEND="app-arch/bzip2:0=
1184 - app-arch/xz-utils:0=
1185 - >=sys-libs/zlib-1.1.3:0=
1186 - virtual/libffi:=
1187 - virtual/libintl
1188 - gdbm? ( sys-libs/gdbm:0=[berkdb] )
1189 - ncurses? ( >=sys-libs/ncurses-5.2:0= )
1190 - readline? ( >=sys-libs/readline-4.1:0= )
1191 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
1192 - ssl? (
1193 - !libressl? ( dev-libs/openssl:0= )
1194 - libressl? ( dev-libs/libressl:0= )
1195 - )
1196 - tk? (
1197 - >=dev-lang/tcl-8.0:0=
1198 - >=dev-lang/tk-8.0:0=[-aqua]
1199 - dev-tcltk/blt:0=
1200 - dev-tcltk/tix
1201 - )
1202 - xml? ( >=dev-libs/expat-2.1:0= )
1203 - !!<sys-apps/sandbox-2.6-r1"
1204 -# bluetooth requires headers from bluez
1205 -DEPEND="${RDEPEND}
1206 - bluetooth? ( net-wireless/bluez )
1207 - virtual/pkgconfig
1208 - !sys-devel/gcc[libffi(-)]"
1209 -RDEPEND+=" !build? ( app-misc/mime-types )"
1210 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
1211 -
1212 -S="${WORKDIR}/${MY_P}"
1213 -
1214 -PYVER=${SLOT%/*}
1215 -
1216 -src_prepare() {
1217 - # Ensure that internal copies of expat, libffi and zlib are not used.
1218 - rm -fr Modules/expat
1219 - rm -fr Modules/_ctypes/libffi*
1220 - rm -fr Modules/zlib
1221 -
1222 - if tc-is-cross-compiler; then
1223 - # Invokes BUILDPYTHON, which is built for the host arch
1224 - local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
1225 - fi
1226 -
1227 - EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
1228 - epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
1229 - epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
1230 - epatch "${FILESDIR}/3.6-disable-nis.patch"
1231 -# epatch "${FILESDIR}/python-3.5.5-libressl-compatibility.patch"
1232 - epatch "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
1233 -
1234 - epatch_user
1235 -
1236 - # Prefix' round of patches
1237 - EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
1238 - epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV}
1239 -
1240 - # https://forums.developer.apple.com/thread/9233, bug #572726
1241 - sed -i -e '/$(RUNSHARED) .\/regen/s/^/export RUNSHARED=$(RUNSHARED); /' \
1242 - Makefile.pre.in || die
1243 - sed -i -e '/python$EXE/s/^/env ${RUNSHARED} /' \
1244 - Lib/plat-darwin/regen || die
1245 -
1246 - # we provide a fully working readline also on Darwin, so don't force
1247 - # usage of less functional libedit
1248 - sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
1249 -
1250 - # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR.
1251 - sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
1252 -
1253 - # Make sure python doesn't use the host libffi.
1254 - use prefix && epatch "${FILESDIR}/python-3.5.4-libffi-pkgconfig.patch"
1255 -
1256 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
1257 - configure.ac \
1258 - Lib/distutils/command/install.py \
1259 - Lib/distutils/sysconfig.py \
1260 - Lib/site.py \
1261 - Lib/sysconfig.py \
1262 - Lib/test/test_site.py \
1263 - Makefile.pre.in \
1264 - Modules/getpath.c \
1265 - Modules/Setup.dist \
1266 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
1267 -
1268 - # workaround a development build env problem and muck around
1269 - # framework install to get the best of both worlds (non-standard)
1270 - sed -i \
1271 - -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
1272 - -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
1273 - configure.ac configure || die
1274 - sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
1275 -
1276 - # Disable ABI flags.
1277 - sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
1278 -
1279 - eautoreconf
1280 -}
1281 -
1282 -src_configure() {
1283 - local disable
1284 - # disable automagic bluetooth headers detection
1285 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
1286 - use gdbm || disable+=" gdbm"
1287 - use ncurses || disable+=" _curses _curses_panel"
1288 - use readline || disable+=" readline"
1289 - use sqlite || disable+=" _sqlite3"
1290 - use ssl || export PYTHON_DISABLE_SSL="1"
1291 - use tk || disable+=" _tkinter"
1292 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
1293 - export PYTHON_DISABLE_MODULES="${disable}"
1294 -
1295 - if ! use xml; then
1296 - ewarn "You have configured Python without XML support."
1297 - ewarn "This is NOT a recommended configuration as you"
1298 - ewarn "may face problems parsing any XML documents."
1299 - fi
1300 -
1301 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
1302 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
1303 - fi
1304 -
1305 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
1306 - append-flags -fwrapv
1307 - fi
1308 -
1309 - filter-flags -malign-double
1310 -
1311 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
1312 - if is-flagq -O3; then
1313 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
1314 - use hardened && replace-flags -O3 -O2
1315 - fi
1316 -
1317 - # Export CC so even AIX will use gcc instead of xlc_r.
1318 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
1319 - tc-export CC CXX
1320 -
1321 - # The configure script fails to use pkg-config correctly.
1322 - # http://bugs.python.org/issue15506
1323 - export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
1324 -
1325 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
1326 - # Needed on FreeBSD unless Python 3.2 is already installed.
1327 - # Please query BSD team before removing this!
1328 - append-ldflags "-L."
1329 -
1330 - # make sure setup.py considers Prefix' paths before system ones
1331 - use prefix && append-cppflags -I"${EPREFIX}"/usr/include
1332 - use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
1333 -
1334 - local dbmliborder
1335 - if use gdbm; then
1336 - dbmliborder+="${dbmliborder:+:}gdbm"
1337 - fi
1338 -
1339 - BUILD_DIR="${WORKDIR}/${CHOST}"
1340 - mkdir -p "${BUILD_DIR}" || die
1341 - cd "${BUILD_DIR}" || die
1342 -
1343 - if use aqua ; then
1344 - ECONF_SOURCE="${S}" OPT="" \
1345 - econf \
1346 - --enable-framework="${EPREFIX}"/usr/lib \
1347 - --config-cache
1348 - fi
1349 -
1350 - local myeconfargs=(
1351 - $(use aqua && echo --config-cache) \
1352 - --with-fpectl
1353 - --enable-shared
1354 - $(use_enable ipv6)
1355 - $(use_with threads)
1356 - --infodir='${prefix}/share/info'
1357 - --mandir='${prefix}/share/man'
1358 - --with-computed-gotos
1359 - --with-dbmliborder="${dbmliborder}"
1360 - --with-libc=
1361 - --enable-loadable-sqlite-extensions
1362 - --without-ensurepip
1363 - --with-system-expat
1364 - --with-system-ffi
1365 - )
1366 -
1367 - ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
1368 -
1369 - if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
1370 - eerror "configure has detected that the sem_open function is broken."
1371 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
1372 - die "Broken sem_open function (bug 496328)"
1373 - fi
1374 -}
1375 -
1376 -src_compile() {
1377 - # Ensure sed works as expected
1378 - # https://bugs.gentoo.org/594768
1379 - local -x LC_ALL=C
1380 -
1381 - cd "${BUILD_DIR}" || die
1382 -
1383 - emake CPPFLAGS= CFLAGS= LDFLAGS=
1384 -
1385 - # Work around bug 329499. See also bug 413751 and 457194.
1386 - if has_version dev-libs/libffi[pax_kernel]; then
1387 - pax-mark E python
1388 - else
1389 - pax-mark m python
1390 - fi
1391 -}
1392 -
1393 -src_test() {
1394 - # Tests will not work when cross compiling.
1395 - if tc-is-cross-compiler; then
1396 - elog "Disabling tests due to crosscompiling."
1397 - return
1398 - fi
1399 -
1400 - cd "${BUILD_DIR}" || die
1401 -
1402 - # Skip failing tests.
1403 - local skipped_tests="gdb"
1404 -
1405 - for test in ${skipped_tests}; do
1406 - mv "${S}"/Lib/test/test_${test}.py "${T}"
1407 - done
1408 -
1409 - local -x PYTHONDONTWRITEBYTECODE=
1410 - emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
1411 - local result=$?
1412 -
1413 - for test in ${skipped_tests}; do
1414 - mv "${T}/test_${test}.py" "${S}"/Lib/test
1415 - done
1416 -
1417 - elog "The following tests have been skipped:"
1418 - for test in ${skipped_tests}; do
1419 - elog "test_${test}.py"
1420 - done
1421 -
1422 - elog "If you would like to run them, you may:"
1423 - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
1424 - elog "and run the tests separately."
1425 -
1426 - if [[ ${result} -ne 0 ]]; then
1427 - die "emake test failed"
1428 - fi
1429 -}
1430 -
1431 -src_install() {
1432 - local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
1433 -
1434 - cd "${BUILD_DIR}" || die
1435 -
1436 - emake DESTDIR="${D}" altinstall
1437 -
1438 - if use aqua ; then
1439 - # avoid config.status to be triggered
1440 - find Mac -name "Makefile" -exec touch \{\} + || die
1441 -
1442 - # Python_Launcher is kind of a wrapper, and we should fix it for
1443 - # Prefix (it uses /usr/bin/pythonw) so useless
1444 - # IDLE doesn't run, no idea, but definitely not used
1445 - emake DESTDIR="${D}" -C Mac install_Python || die
1446 - rmdir "${ED}"/Applications/Python* || die
1447 - rmdir "${ED}"/Applications || die
1448 -
1449 - local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER}
1450 - ln -s "${EPREFIX}"/usr/include/python${PYVER} \
1451 - "${ED}${fwdir}"/Headers || die
1452 - ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
1453 - "${ED}${fwdir}"/Python || die
1454 - fi
1455 -
1456 - sed \
1457 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
1458 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
1459 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
1460 -
1461 - # Fix collisions between different slots of Python.
1462 - rm -f "${ED}usr/$(get_libdir)/libpython3.so"
1463 -
1464 - # Cheap hack to get version with ABIFLAGS
1465 - local abiver=$(cd "${ED}usr/include"; echo python*)
1466 - if [[ ${abiver} != python${PYVER} ]]; then
1467 - # Replace python3.X with a symlink to python3.Xm
1468 - rm "${ED}usr/bin/python${PYVER}" || die
1469 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1470 - # Create python3.X-config symlink
1471 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1472 - # Create python-3.5m.pc symlink
1473 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1474 - fi
1475 -
1476 - # python seems to get rebuilt in src_install (bug 569908)
1477 - # Work around it for now.
1478 - if has_version dev-libs/libffi[pax_kernel]; then
1479 - pax-mark E "${ED}usr/bin/${abiver}"
1480 - else
1481 - pax-mark m "${ED}usr/bin/${abiver}"
1482 - fi
1483 -
1484 - use elibc_uclibc && rm -fr "${libdir}/test"
1485 - use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
1486 - use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
1487 -
1488 - use threads || rm -fr "${libdir}/multiprocessing"
1489 - use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
1490 -
1491 - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
1492 -
1493 - if use examples; then
1494 - insinto /usr/share/doc/${PF}/examples
1495 - find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
1496 - doins -r "${S}"/Tools
1497 - fi
1498 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1499 - if use aqua ; then
1500 - # we do framework, so the emake trick below returns a pathname
1501 - # since that won't work here, use a (cheap) trick instead
1502 - local libname=libpython${PYVER}
1503 - else
1504 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1505 - emake --no-print-directory -s -f - 2>/dev/null)
1506 - fi
1507 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1508 -
1509 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1510 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1511 - sed \
1512 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1513 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1514 - -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
1515 -
1516 - # for python-exec
1517 - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
1518 -
1519 - # if not using a cross-compiler, use the fresh binary
1520 - if ! tc-is-cross-compiler; then
1521 - local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
1522 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
1523 - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
1524 - else
1525 - vars=( PYTHON "${vars[@]}" )
1526 - fi
1527 -
1528 - python_export "python${PYVER}" "${vars[@]}"
1529 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1530 - python_domodule epython.py
1531 -
1532 - # python-exec wrapping support
1533 - local pymajor=${PYVER%.*}
1534 - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
1535 - # python and pythonX
1536 - ln -s "../../../bin/${abiver}" \
1537 - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
1538 - ln -s "python${pymajor}" \
1539 - "${D}${PYTHON_SCRIPTDIR}/python" || die
1540 - # python-config and pythonX-config
1541 - # note: we need to create a wrapper rather than symlinking it due
1542 - # to some random dirname(argv[0]) magic performed by python-config
1543 - cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
1544 - #!/bin/sh
1545 - exec "${abiver}-config" "\${@}"
1546 - EOF
1547 - chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
1548 - ln -s "python${pymajor}-config" \
1549 - "${D}${PYTHON_SCRIPTDIR}/python-config" || die
1550 - # 2to3, pydoc, pyvenv
1551 - ln -s "../../../bin/2to3-${PYVER}" \
1552 - "${D}${PYTHON_SCRIPTDIR}/2to3" || die
1553 - ln -s "../../../bin/pydoc${PYVER}" \
1554 - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
1555 - ln -s "../../../bin/pyvenv-${PYVER}" \
1556 - "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
1557 - # idle
1558 - if use tk; then
1559 - ln -s "../../../bin/idle${PYVER}" \
1560 - "${D}${PYTHON_SCRIPTDIR}/idle" || die
1561 - fi
1562 -}
1563 -
1564 -pkg_preinst() {
1565 - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
1566 - python_updater_warning="1"
1567 - fi
1568 -}
1569 -
1570 -eselect_python_update() {
1571 - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
1572 - eselect python update
1573 - fi
1574 -
1575 - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
1576 - eselect python update --python${PV%%.*}
1577 - fi
1578 -}
1579 -
1580 -pkg_postinst() {
1581 - eselect_python_update
1582 -
1583 - if [[ "${python_updater_warning}" == "1" ]]; then
1584 - ewarn "You have just upgraded from an older version of Python."
1585 - ewarn
1586 - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
1587 - fi
1588 -}
1589 -
1590 -pkg_postrm() {
1591 - eselect_python_update
1592 -}
1593
1594 diff --git a/dev-lang/python/python-3.6.6.ebuild b/dev-lang/python/python-3.6.6.ebuild
1595 deleted file mode 100644
1596 index 78ddb6364b..0000000000
1597 --- a/dev-lang/python/python-3.6.6.ebuild
1598 +++ /dev/null
1599 @@ -1,444 +0,0 @@
1600 -# Copyright 1999-2019 Gentoo Authors
1601 -# Distributed under the terms of the GNU General Public License v2
1602 -
1603 -EAPI="6"
1604 -WANT_LIBTOOL="none"
1605 -
1606 -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs epatch
1607 -
1608 -MY_P="Python-${PV}"
1609 -PATCHSET_VERSION="3.6.6"
1610 -PREFIX_PATCHREV="3.6.5-gentoo-patches-r0"
1611 -CYGWINPORTS_GITREV="f11d606e98b00f5b143cba92bfee8b7f5ba779b0"
1612 -
1613 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
1614 -HOMEPAGE="https://www.python.org/"
1615 -SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
1616 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
1617 - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PREFIX_PATCHREV}.tar.xz"
1618 -
1619 -[[ -n ${CYGWINPORTS_GITREV} ]] &&
1620 -SRC_URI+=" elibc_Cygwin? (
1621 - https://github.com/cygwinports/python36/archive/${CYGWINPORTS_GITREV}.zip
1622 - -> python36-cygwinports-${CYGWINPORTS_GITREV}.zip )"
1623 -
1624 -LICENSE="PSF-2"
1625 -SLOT="3.6/3.6m"
1626 -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1627 -IUSE="aqua bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
1628 -RESTRICT="!test? ( test )"
1629 -
1630 -# Do not add a dependency on dev-lang/python to this ebuild.
1631 -# If you need to apply a patch which requires python for bootstrapping, please
1632 -# run the bootstrap code on your dev box and include the results in the
1633 -# patchset. See bug 447752.
1634 -
1635 -RDEPEND="app-arch/bzip2:0=
1636 - app-arch/xz-utils:0=
1637 - >=sys-libs/zlib-1.1.3:0=
1638 - virtual/libffi:=
1639 - virtual/libintl
1640 - gdbm? ( sys-libs/gdbm:0=[berkdb] )
1641 - ncurses? ( >=sys-libs/ncurses-5.2:0= )
1642 - readline? ( >=sys-libs/readline-4.1:0= )
1643 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
1644 - ssl? (
1645 - !libressl? ( dev-libs/openssl:0= )
1646 - libressl? ( dev-libs/libressl:0= )
1647 - )
1648 - tk? (
1649 - >=dev-lang/tcl-8.0:0=
1650 - >=dev-lang/tk-8.0:0=[-aqua]
1651 - dev-tcltk/blt:0=
1652 - dev-tcltk/tix
1653 - )
1654 - xml? ( >=dev-libs/expat-2.1:0= )
1655 - !!<sys-apps/sandbox-2.6-r1"
1656 -# bluetooth requires headers from bluez
1657 -DEPEND="${RDEPEND}
1658 - bluetooth? ( net-wireless/bluez )
1659 - test? ( app-arch/xz-utils[extra-filters(+)] )
1660 - virtual/pkgconfig
1661 - !sys-devel/gcc[libffi(-)]"
1662 -RDEPEND+=" !build? ( app-misc/mime-types )"
1663 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
1664 -
1665 -[[ -n ${CYGWINPORTS_GITREV} ]] &&
1666 -DEPEND+=" elibc_Cygwin? ( app-arch/unzip )"
1667 -
1668 -S="${WORKDIR}/${MY_P}"
1669 -PYVER=${SLOT%/*}
1670 -
1671 -src_prepare() {
1672 - # Ensure that internal copies of expat, libffi and zlib are not used.
1673 - rm -fr Modules/expat
1674 - rm -fr Modules/_ctypes/libffi*
1675 - rm -fr Modules/zlib
1676 -
1677 - local PATCHES=(
1678 - "${WORKDIR}/patches"
1679 - )
1680 -
1681 - default
1682 -
1683 - # Prefix' round of patches
1684 - EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
1685 - epatch "${WORKDIR}"/python-prefix-${PREFIX_PATCHREV}
1686 -
1687 - if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
1688 - local p d="${WORKDIR}/python36-${CYGWINPORTS_GITREV}"
1689 - for p in $(
1690 - sed -ne '/PATCH_URI="/,/"/{s/.*="//;s/".*$//;p}' \
1691 - < "${d}/python3.cygport"
1692 - ); do
1693 - # dropped by 01_all_prefix-no-patch-invention.patch
1694 - [[ ${p} == *-tkinter-* ]] && continue
1695 - epatch "${d}/${p}"
1696 - done
1697 - fi
1698 -
1699 - # we provide a fully working readline also on Darwin, so don't force
1700 - # usage of less functional libedit
1701 - sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
1702 -
1703 - # We may have wrapped /usr/ccs/bin/nm on AIX for long TMPDIR.
1704 - sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
1705 -
1706 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
1707 - Lib/distutils/command/install.py \
1708 - Lib/distutils/sysconfig.py \
1709 - Lib/site.py \
1710 - Lib/sysconfig.py \
1711 - Lib/test/test_site.py \
1712 - Makefile.pre.in \
1713 - Modules/Setup.dist \
1714 - Modules/getpath.c \
1715 - configure.ac \
1716 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
1717 -
1718 - # workaround a development build env problem and muck around
1719 - # framework install to get the best of both worlds (non-standard)
1720 - sed -i \
1721 - -e "s:FRAMEWORKINSTALLAPPSPREFIX=\":FRAMEWORKINSTALLAPPSPREFIX=\"${EPREFIX}:" \
1722 - -e '/RUNSHARED=DYLD_FRAMEWORK_PATH/s/FRAMEWORK/LIBRARY/g' \
1723 - configure.ac configure || die
1724 - sed -i -e '/find/s/$/ || true/' Mac/PythonLauncher/Makefile.in || die
1725 -
1726 - # workaround a problem on ppc-macos with >=GCC-8 where dtoa gets
1727 - # miscompiled when optimisation is being used
1728 - if [[ ${CHOST} == powerpc*-darwin* ]] && \
1729 - tc-is-gcc && [[ $(gcc-major-version) -ge 8 ]] ;
1730 - then
1731 - sed -i \
1732 - -e '/^CFLAGS_ALIASING=/s/$/ -fno-tree-ter/' Makefile.pre.in || die
1733 - fi
1734 -
1735 - eautoreconf
1736 -}
1737 -
1738 -src_configure() {
1739 - local disable
1740 - # disable automagic bluetooth headers detection
1741 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
1742 - use gdbm || disable+=" gdbm"
1743 - use ncurses || disable+=" _curses _curses_panel"
1744 - use readline || disable+=" readline"
1745 - use sqlite || disable+=" _sqlite3"
1746 - use ssl || export PYTHON_DISABLE_SSL="1"
1747 - use tk || disable+=" _tkinter"
1748 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
1749 - export PYTHON_DISABLE_MODULES="${disable}"
1750 -
1751 - if ! use xml; then
1752 - ewarn "You have configured Python without XML support."
1753 - ewarn "This is NOT a recommended configuration as you"
1754 - ewarn "may face problems parsing any XML documents."
1755 - fi
1756 -
1757 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
1758 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
1759 - fi
1760 -
1761 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
1762 - append-flags -fwrapv
1763 - fi
1764 -
1765 - filter-flags -malign-double
1766 -
1767 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
1768 - if is-flagq -O3; then
1769 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
1770 - use hardened && replace-flags -O3 -O2
1771 - fi
1772 -
1773 - # Export CC so even AIX will use gcc instead of xlc_r.
1774 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
1775 - tc-export CC CXX
1776 -
1777 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
1778 - # Needed on FreeBSD unless Python 3.2 is already installed.
1779 - # Please query BSD team before removing this!
1780 - append-ldflags "-L."
1781 -
1782 - # make sure setup.py considers Prefix' paths before system ones
1783 - use prefix && append-cppflags -I"${EPREFIX}"/usr/include
1784 - use prefix && append-ldflags -L"${EPREFIX}"/lib -L"${EPREFIX}"/usr/lib
1785 -
1786 - local dbmliborder
1787 - if use gdbm; then
1788 - dbmliborder+="${dbmliborder:+:}gdbm"
1789 - fi
1790 -
1791 - if use aqua ; then
1792 - ECONF_SOURCE="${S}" OPT="" \
1793 - econf \
1794 - --enable-framework="${EPREFIX}"/usr/lib \
1795 - --config-cache
1796 - fi
1797 -
1798 - local myeconfargs=(
1799 - $(use aqua && echo --config-cache) \
1800 - $(use_with !elibc_Cygwin fpectl)
1801 - --enable-shared
1802 - $(use_enable ipv6)
1803 - $(use_with threads)
1804 - --infodir='${prefix}/share/info'
1805 - --mandir='${prefix}/share/man'
1806 - --with-computed-gotos
1807 - --with-dbmliborder="${dbmliborder}"
1808 - --with-libc=
1809 - --enable-loadable-sqlite-extensions
1810 - --without-ensurepip
1811 - --with-system-expat
1812 - --with-system-ffi
1813 - )
1814 -
1815 - OPT="" econf "${myeconfargs[@]}"
1816 -
1817 - if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
1818 - eerror "configure has detected that the sem_open function is broken."
1819 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
1820 - die "Broken sem_open function (bug 496328)"
1821 - fi
1822 -}
1823 -
1824 -src_compile() {
1825 - # Ensure sed works as expected
1826 - # https://bugs.gentoo.org/594768
1827 - local -x LC_ALL=C
1828 -
1829 - emake CPPFLAGS= CFLAGS= LDFLAGS=
1830 -
1831 - # Work around bug 329499. See also bug 413751 and 457194.
1832 - if has_version dev-libs/libffi[pax_kernel]; then
1833 - pax-mark E python
1834 - else
1835 - pax-mark m python
1836 - fi
1837 -}
1838 -
1839 -src_test() {
1840 - # Tests will not work when cross compiling.
1841 - if tc-is-cross-compiler; then
1842 - elog "Disabling tests due to crosscompiling."
1843 - return
1844 - fi
1845 -
1846 - # Skip failing tests.
1847 - local skipped_tests="gdb"
1848 -
1849 - for test in ${skipped_tests}; do
1850 - mv "${S}"/Lib/test/test_${test}.py "${T}"
1851 - done
1852 -
1853 - # bug 660358
1854 - local -x COLUMNS=80
1855 -
1856 - local -x PYTHONDONTWRITEBYTECODE=
1857 -
1858 - emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
1859 - local result=$?
1860 -
1861 - for test in ${skipped_tests}; do
1862 - mv "${T}/test_${test}.py" "${S}"/Lib/test
1863 - done
1864 -
1865 - elog "The following tests have been skipped:"
1866 - for test in ${skipped_tests}; do
1867 - elog "test_${test}.py"
1868 - done
1869 -
1870 - elog "If you would like to run them, you may:"
1871 - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
1872 - elog "and run the tests separately."
1873 -
1874 - if [[ ${result} -ne 0 ]]; then
1875 - die "emake test failed"
1876 - fi
1877 -}
1878 -
1879 -src_install() {
1880 - local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
1881 -
1882 - emake DESTDIR="${D}" altinstall
1883 -
1884 - if use aqua ; then
1885 - # avoid config.status to be triggered
1886 - find Mac -name "Makefile" -exec touch \{\} + || die
1887 -
1888 - # Python_Launcher is kind of a wrapper, and we should fix it for
1889 - # Prefix (it uses /usr/bin/pythonw) so useless
1890 - # IDLE doesn't run, no idea, but definitely not used
1891 - emake DESTDIR="${D}" -C Mac install_Python || die
1892 - rmdir "${ED}"/Applications/Python* || die
1893 - rmdir "${ED}"/Applications || die
1894 -
1895 - local fwdir=/usr/$(get_libdir)/Python.framework/Versions/${PYVER}
1896 - ln -s "${EPREFIX}"/usr/include/python${PYVER} \
1897 - "${ED}${fwdir}"/Headers || die
1898 - ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
1899 - "${ED}${fwdir}"/Python || die
1900 - fi
1901 -
1902 - sed \
1903 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
1904 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
1905 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
1906 -
1907 - # Fix collisions between different slots of Python.
1908 - rm -f "${ED}usr/$(get_libdir)/libpython3.so"
1909 -
1910 - if use elibc_Cygwin; then
1911 - # We may recreate symlinks, but without any .exe extension. Cygwin
1912 - # can resolv either without it, so just drop .exe from shebangs:
1913 - sed -i -e '1s/\.exe//' "$ED"/usr/bin/* || die
1914 - fi
1915 -
1916 - # Cheap hack to get version with ABIFLAGS
1917 - local abiver=$(cd "${ED}usr/include"; echo python*)
1918 - if [[ ${abiver} != python${PYVER} ]]; then
1919 - # Replace python3.X with a symlink to python3.Xm
1920 - rm "${ED}usr/bin/python${PYVER}" || die
1921 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1922 - # Create python3.X-config symlink
1923 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1924 - # Create python-3.5m.pc symlink
1925 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1926 - fi
1927 -
1928 - # python seems to get rebuilt in src_install (bug 569908)
1929 - # Work around it for now.
1930 - if has_version dev-libs/libffi[pax_kernel]; then
1931 - pax-mark E "${ED}usr/bin/${abiver}"
1932 - else
1933 - pax-mark m "${ED}usr/bin/${abiver}"
1934 - fi
1935 -
1936 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
1937 - use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
1938 -
1939 - use threads || rm -r "${libdir}/multiprocessing" || die
1940 - use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
1941 -
1942 - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
1943 -
1944 - if use examples; then
1945 - insinto /usr/share/doc/${PF}/examples
1946 - find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
1947 - doins -r "${S}"/Tools
1948 - fi
1949 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1950 - if use aqua ; then
1951 - # we do framework, so the emake trick below returns a pathname
1952 - # since that won't work here, use a (cheap) trick instead
1953 - local libname=libpython${PYVER}
1954 - else
1955 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1956 - emake --no-print-directory -s -f - 2>/dev/null)
1957 - fi
1958 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1959 -
1960 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1961 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1962 - sed \
1963 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1964 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1965 - -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
1966 -
1967 - # for python-exec
1968 - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
1969 -
1970 - # if not using a cross-compiler, use the fresh binary
1971 - if ! tc-is-cross-compiler; then
1972 - local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile)
1973 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
1974 - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD}
1975 - else
1976 - vars=( PYTHON "${vars[@]}" )
1977 - fi
1978 -
1979 - python_export "python${PYVER}" "${vars[@]}"
1980 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1981 - python_domodule epython.py
1982 -
1983 - # python-exec wrapping support
1984 - local pymajor=${PYVER%.*}
1985 - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
1986 - # python and pythonX
1987 - ln -s "../../../bin/${abiver}" \
1988 - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
1989 - ln -s "python${pymajor}" \
1990 - "${D}${PYTHON_SCRIPTDIR}/python" || die
1991 - # python-config and pythonX-config
1992 - # note: we need to create a wrapper rather than symlinking it due
1993 - # to some random dirname(argv[0]) magic performed by python-config
1994 - cat > "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
1995 - #!/bin/sh
1996 - exec "${abiver}-config" "\${@}"
1997 - EOF
1998 - chmod +x "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
1999 - ln -s "python${pymajor}-config" \
2000 - "${D}${PYTHON_SCRIPTDIR}/python-config" || die
2001 - # 2to3, pydoc, pyvenv
2002 - ln -s "../../../bin/2to3-${PYVER}" \
2003 - "${D}${PYTHON_SCRIPTDIR}/2to3" || die
2004 - ln -s "../../../bin/pydoc${PYVER}" \
2005 - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
2006 - ln -s "../../../bin/pyvenv-${PYVER}" \
2007 - "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
2008 - # idle
2009 - if use tk; then
2010 - ln -s "../../../bin/idle${PYVER}" \
2011 - "${D}${PYTHON_SCRIPTDIR}/idle" || die
2012 - fi
2013 -}
2014 -
2015 -pkg_preinst() {
2016 - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
2017 - python_updater_warning="1"
2018 - fi
2019 -}
2020 -
2021 -eselect_python_update() {
2022 - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
2023 - eselect python update
2024 - fi
2025 -
2026 - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
2027 - eselect python update --python${PV%%.*}
2028 - fi
2029 -}
2030 -
2031 -pkg_postinst() {
2032 - eselect_python_update
2033 -
2034 - if [[ "${python_updater_warning}" == "1" ]]; then
2035 - ewarn "You have just upgraded from an older version of Python."
2036 - ewarn
2037 - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
2038 - fi
2039 -}
2040 -
2041 -pkg_postrm() {
2042 - eselect_python_update
2043 -}