Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/features/prefix/standalone/, dev-lang/python/
Date: Thu, 29 Dec 2022 21:31:20
Message-Id: 1672349453.8c8c938e158a9e10f1c5a4280c16e435e354122e.chewi@gentoo
1 commit: 8c8c938e158a9e10f1c5a4280c16e435e354122e
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 26 22:54:40 2022 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 29 21:30:53 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c8c938e
7
8 dev-lang/python: Fix cross-compiling for prefixed systems
9
10 Cross-compiling Python involves doing a native build first. The prefix profile
11 prefixifies setup.py, but this has been done before the native build when it
12 needs to be done after. Handle this in the ebuild with hprefixify instead of
13 with sed in the profile.
14
15 Also drop some other obsolete Python prefix hacks from the profile.
16
17 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
18
19 dev-lang/python/python-3.10.9.ebuild | 3 ++-
20 dev-lang/python/python-3.11.1.ebuild | 3 ++-
21 dev-lang/python/python-3.12.0_alpha3-r1.ebuild | 3 ++-
22 dev-lang/python/python-3.8.16.ebuild | 3 ++-
23 dev-lang/python/python-3.9.16.ebuild | 3 ++-
24 profiles/features/prefix/standalone/profile.bashrc | 11 -----------
25 6 files changed, 10 insertions(+), 16 deletions(-)
26
27 diff --git a/dev-lang/python/python-3.10.9.ebuild b/dev-lang/python/python-3.10.9.ebuild
28 index bb4dfcde3ea3..1b3700f2b2b9 100644
29 --- a/dev-lang/python/python-3.10.9.ebuild
30 +++ b/dev-lang/python/python-3.10.9.ebuild
31 @@ -5,7 +5,7 @@ EAPI="7"
32 WANT_LIBTOOL="none"
33
34 inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
35 -inherit python-utils-r1 toolchain-funcs verify-sig
36 +inherit prefix python-utils-r1 toolchain-funcs verify-sig
37
38 MY_PV=${PV/_rc/rc}
39 MY_P="Python-${MY_PV%_p*}"
40 @@ -299,6 +299,7 @@ src_configure() {
41 append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
42 fi
43
44 + hprefixify setup.py
45 econf "${myeconfargs[@]}"
46
47 if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
48
49 diff --git a/dev-lang/python/python-3.11.1.ebuild b/dev-lang/python/python-3.11.1.ebuild
50 index 57e49df5e368..f0e59a041105 100644
51 --- a/dev-lang/python/python-3.11.1.ebuild
52 +++ b/dev-lang/python/python-3.11.1.ebuild
53 @@ -5,7 +5,7 @@ EAPI="7"
54 WANT_LIBTOOL="none"
55
56 inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
57 -inherit python-utils-r1 toolchain-funcs verify-sig
58 +inherit prefix python-utils-r1 toolchain-funcs verify-sig
59
60 MY_PV=${PV/_rc/rc}
61 MY_P="Python-${MY_PV%_p*}"
62 @@ -291,6 +291,7 @@ src_configure() {
63 append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
64 fi
65
66 + hprefixify setup.py
67 econf "${myeconfargs[@]}"
68
69 if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
70
71 diff --git a/dev-lang/python/python-3.12.0_alpha3-r1.ebuild b/dev-lang/python/python-3.12.0_alpha3-r1.ebuild
72 index 9cdbb7bfcca9..860a12f15586 100644
73 --- a/dev-lang/python/python-3.12.0_alpha3-r1.ebuild
74 +++ b/dev-lang/python/python-3.12.0_alpha3-r1.ebuild
75 @@ -5,7 +5,7 @@ EAPI="7"
76 WANT_LIBTOOL="none"
77
78 inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
79 -inherit python-utils-r1 toolchain-funcs verify-sig
80 +inherit prefix python-utils-r1 toolchain-funcs verify-sig
81
82 MY_PV=${PV/_alpha/a}
83 MY_P="Python-${MY_PV%_p*}"
84 @@ -287,6 +287,7 @@ src_configure() {
85 append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
86 fi
87
88 + hprefixify setup.py
89 econf "${myeconfargs[@]}"
90
91 if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
92
93 diff --git a/dev-lang/python/python-3.8.16.ebuild b/dev-lang/python/python-3.8.16.ebuild
94 index 6469ad3212ff..086407df8721 100644
95 --- a/dev-lang/python/python-3.8.16.ebuild
96 +++ b/dev-lang/python/python-3.8.16.ebuild
97 @@ -5,7 +5,7 @@ EAPI="7"
98 WANT_LIBTOOL="none"
99
100 inherit autotools flag-o-matic multiprocessing pax-utils
101 -inherit python-utils-r1 toolchain-funcs verify-sig
102 +inherit prefix python-utils-r1 toolchain-funcs verify-sig
103
104 MY_PV=${PV/_rc/rc}
105 MY_P="Python-${MY_PV%_p*}"
106 @@ -253,6 +253,7 @@ src_configure() {
107 append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
108 fi
109
110 + hprefixify setup.py
111 econf "${myeconfargs[@]}"
112
113 if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
114
115 diff --git a/dev-lang/python/python-3.9.16.ebuild b/dev-lang/python/python-3.9.16.ebuild
116 index e6b279292564..f6dbbd4312df 100644
117 --- a/dev-lang/python/python-3.9.16.ebuild
118 +++ b/dev-lang/python/python-3.9.16.ebuild
119 @@ -5,7 +5,7 @@ EAPI="7"
120 WANT_LIBTOOL="none"
121
122 inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
123 -inherit python-utils-r1 toolchain-funcs verify-sig
124 +inherit prefix python-utils-r1 toolchain-funcs verify-sig
125
126 MY_PV=${PV/_rc/rc}
127 MY_P="Python-${MY_PV%_p*}"
128 @@ -293,6 +293,7 @@ src_configure() {
129 append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
130 fi
131
132 + hprefixify setup.py
133 econf "${myeconfargs[@]}"
134
135 if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
136
137 diff --git a/profiles/features/prefix/standalone/profile.bashrc b/profiles/features/prefix/standalone/profile.bashrc
138 index d23eeb81797d..fd95e43f7f30 100644
139 --- a/profiles/features/prefix/standalone/profile.bashrc
140 +++ b/profiles/features/prefix/standalone/profile.bashrc
141 @@ -74,17 +74,6 @@ elif [[ ${CATEGORY}/${PN} == sys-libs/glibc && ${EBUILD_PHASE} == configure ]];
142 -e "s,/(etc|var),${EPREFIX}/\1,g" \
143 nss/db-Makefile
144 eend $?
145 -elif [[ ${CATEGORY}/${PN} == dev-lang/python && ${EBUILD_PHASE} == configure ]]; then
146 - # Guide h2py to look into glibc of Prefix
147 - ebegin "Guiding h2py to look into Prefix"
148 - export include="${EPREFIX}"/usr/include
149 - sed -i -r \
150 - -e "s,/usr/include,\"${EPREFIX}\"/usr/include,g" "${S}"/Lib/plat-linux*/regen
151 - eend $?
152 - ebegin "Prefixifying distutils paths"
153 - sed -re "s,([^[:alnum:]])(/usr[/[:alnum:]]*/(lib[[:alnum:]]*|include)|/lib[[:alnum:]]*),\1${EPREFIX}\2,g" \
154 - -i "${S}"/setup.py
155 - eend $?
156 elif [[ ${CATEGORY}/${PN} == dev-lang/perl && ${EBUILD_PHASE} == configure ]]; then
157 ebegin "Prefixifying pwd path"
158 sed -r "s,'((|/usr)/bin/pwd),'${EPREFIX}\1," -i "${S}"/dist/PathTools/Cwd.pm