Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: "Tiziano Müller" <dev-zero@g.o>
Cc: gentoo-python@l.g.o, python@g.o, cpp@g.o
Subject: Re: [gentoo-python] Re: [PATCH 3/3] Convert to python-r1.
Date: Sat, 15 Dec 2012 12:17:27
Message-Id: 20121215131728.4c9c3a51@pomiocik.lan
In Reply to: [gentoo-python] Re: [PATCH 3/3] Convert to python-r1. by "Tiziano Müller"
1 On Sat, 15 Dec 2012 12:42:02 +0100
2 Tiziano Müller <dev-zero@g.o> wrote:
3
4 > Am Freitag, den 14.12.2012, 23:08 +0100 schrieb Michał Górny:
5 > > ---
6 > > gx86/dev-libs/boost/boost-1.52.0-r5.ebuild | 47 ++++++++++--------------------
7 > > 1 file changed, 15 insertions(+), 32 deletions(-)
8 > >
9 > > diff --git a/gx86/dev-libs/boost/boost-1.52.0-r5.ebuild b/gx86/dev-libs/boost/boost-1.52.0-r5.ebuild
10 > > index 87c7561..10bd293 100644
11 > > --- a/gx86/dev-libs/boost/boost-1.52.0-r5.ebuild
12 > > +++ b/gx86/dev-libs/boost/boost-1.52.0-r5.ebuild
13 > > @@ -3,11 +3,9 @@
14 > > # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.52.0-r4.ebuild,v 1.1 2012/11/22 03:37:58 flameeyes Exp $
15 > >
16 > > EAPI="5"
17 > > -PYTHON_DEPEND="python? *"
18 > > -SUPPORT_PYTHON_ABIS="1"
19 > > -RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
20 > > +PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} )
21 > >
22 > > -inherit flag-o-matic multilib multiprocessing python toolchain-funcs versionator
23 > > +inherit flag-o-matic multilib multiprocessing python-r1 toolchain-funcs versionator
24 > >
25 > > MY_P=${PN}_$(replace_all_version_separators _)
26 > >
27 > > @@ -24,6 +22,7 @@ IUSE="debug doc icu +nls mpi python static-libs +threads tools"
28 > > RDEPEND="icu? ( >=dev-libs/icu-3.6:= )
29 > > !icu? ( virtual/libiconv )
30 > > mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) )
31 > > + python? ( ${PYTHON_DEPS} )
32 > > sys-libs/zlib
33 > > !app-admin/eselect-boost"
34 > > DEPEND="${RDEPEND}
35 > > @@ -50,7 +49,7 @@ create_user-config.jam() {
36 > > fi
37 > >
38 > > if use python; then
39 > > - python_configuration="using python : $(python_get_version) ;"
40 > > + python_configuration="using python : ${EPYTHON#python} ;"
41 >
42 > can you please repeat why there is no EPYTHONV variable?
43
44 There wasn't one, I didn't want to introduce it myself.
45
46 The root of the problem is that there are multiple kinds of 'Python
47 version' and people usually have no idea which one they want. In this
48 particular case, boost wants the suffix of python libraries which is
49 specific to CPython. Scrambling it from EPYTHON is the simplest thing
50 to do here.
51
52 But I'll take a second look at python_configuration because of your
53 earlier comments.
54
55 >
56 > > fi
57 > >
58 > > cat > user-config.jam << __EOF__
59 > > @@ -60,12 +59,6 @@ ${python_configuration}
60 > > __EOF__
61 > > }
62 > >
63 > > -pkg_setup() {
64 > > - if use python; then
65 > > - python_pkg_setup
66 > > - fi
67 > > -}
68 > > -
69 > > src_prepare() {
70 > > epatch \
71 > > "${FILESDIR}/${PN}-1.48.0-mpi_python3.patch" \
72 > > @@ -129,7 +122,7 @@ src_compile() {
73 > > create_user-config.jam
74 > >
75 > > ejam ${OPTIONS} \
76 > > - $(use python && echo --python-buildid=${PYTHON_ABI}) \
77 > > + $(use python && echo --python-buildid=${EPYTHON#python}) \
78 > > || die "Building of Boost libraries failed"
79 > >
80 > > if use python; then
81 > > @@ -143,7 +136,7 @@ src_compile() {
82 > >
83 > > local dir
84 > > for dir in ${PYTHON_DIRS}; do
85 > > - mv ${dir} ${dir}-${PYTHON_ABI} || die "Renaming of '${dir}' to '${dir}-${PYTHON_ABI}' failed"
86 > > + mv ${dir} ${dir}-${EPYTHON} || die
87 >
88 > Do we loose something by having an explicit error message?
89 > Please leave it there (dito for all the other cases)
90
91 Well, we lose readability when ebuild has 120-character long lines.
92
93 >
94 > > done
95 > >
96 > > if use mpi; then
97 > > @@ -158,12 +151,12 @@ src_compile() {
98 > > fi
99 > > fi
100 > >
101 > > - mv stage/lib/mpi.so stage/lib/mpi.so-${PYTHON_ABI} || die "Renaming of 'stage/lib/mpi.so' to 'stage/lib/mpi.so-${PYTHON_ABI}' failed"
102 > > + mv stage/lib/mpi.so stage/lib/mpi.so-${EPYTHON} || die
103 > > fi
104 > > fi
105 > > }
106 > > if use python; then
107 > > - python_execute_function building
108 > > + python_foreach_impl building
109 > > else
110 > > building
111 > > fi
112 > > @@ -184,19 +177,19 @@ src_install () {
113 > > if use python; then
114 > > local dir
115 > > for dir in ${PYTHON_DIRS}; do
116 > > - cp -pr ${dir}-${PYTHON_ABI} ${dir} || die "Copying of '${dir}-${PYTHON_ABI}' to '${dir}' failed"
117 > > + cp -pr ${dir}-${EPYTHON} ${dir} || die
118 > > done
119 > >
120 > > if use mpi; then
121 > > - cp -p stage/lib/mpi.so-${PYTHON_ABI} "${MPI_PYTHON_MODULE}" || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to '${MPI_PYTHON_MODULE}' failed"
122 > > - cp -p stage/lib/mpi.so-${PYTHON_ABI} stage/lib/mpi.so || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to 'stage/lib/mpi.so' failed"
123 > > + cp -p stage/lib/mpi.so-${EPYTHON} "${MPI_PYTHON_MODULE}" || die
124 > > + cp -p stage/lib/mpi.so-${EPYTHON} stage/lib/mpi.so || die
125 > > fi
126 > > fi
127 > >
128 > > ejam ${OPTIONS} \
129 > > --includedir="${D}usr/include" \
130 > > --libdir="${D}usr/$(get_libdir)" \
131 > > - $(use python && echo --python-buildid=${PYTHON_ABI}) \
132 > > + $(use python && echo --python-buildid=${EPYTHON#python}) \
133 > > install || die "Installation of Boost libraries failed"
134 > >
135 > > if use python; then
136 > > @@ -222,10 +215,12 @@ else:
137 > > del sys
138 > > EOF
139 > > fi
140 > > +
141 > > + python_optimize
142 > > fi
143 > > }
144 > > if use python; then
145 > > - python_execute_function installation
146 > > + python_foreach_impl installation
147 > > else
148 > > installation
149 > > fi
150 > > @@ -320,18 +315,6 @@ pkg_preinst() {
151 > > done
152 > > }
153 > >
154 > > -pkg_postinst() {
155 > > - if use mpi && use python; then
156 > > - python_mod_optimize boost
157 > > - fi
158 > > -}
159 > > -
160 > > -pkg_postrm() {
161 > > - if use mpi && use python; then
162 > > - python_mod_cleanup boost
163 > > - fi
164 > > -}
165 > > -
166 > > # the tests will never fail because these are not intended as sanity
167 > > # tests at all. They are more a way for upstream to check their own code
168 > > # on new compilers. Since they would either be completely unreliable
169 >
170 >
171 >
172
173
174
175 --
176 Best regards,
177 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature