Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Subject: [gentoo-python] distutils-r1 -- support for out-of-source builds?
Date: Sun, 28 Oct 2012 07:56:36
Message-Id: 20121028085705.62e1eed4@pomiocik.lan
1 Hello,
2
3 The original distutils.eclass uses out-of-source builds by default.
4 distutils-r1 (following the scheme of p-d-ng) just copies the sources
5 and does in-source builds unconditionally. I'm wondering about changing
6 that.
7
8 The change would mean that:
9
10 1) out-of-source (build-dir) builds are used by default,
11
12 2) in-source builds (and copying sources) is enabled through setting
13 DISTUTILS_IN_SOURCE_BUILD *or* whenever python_prepare() is declared
14 (since that function supposedly is used to modify sources),
15
16 3) a wrapper function for setup.py is introduced (esetuppy? edistsetup?)
17 which calls setup.py with correct build-dir,
18
19 4) ebuilds defining python_test() (and no python_prepare()) would need
20 to be updated to use the above-mentioned wrapper.
21
22 I'm wondering whether it's a good idea to change that. The main benefit
23 is that:
24
25 a) we avoid unnecessary copy in most cases,
26
27 b) we increase compatibility with distutils.eclass; e.g. the following
28 would start working:
29
30 src_prepare() {
31 distutils-r1_src_prepare
32 sed ...
33 }
34
35 which currently fails silently since sed is performed after copying
36 sources.
37
38 On the other hand, we would introduce a tiny bit of additional code.
39
40 --
41 Best regards,
42 Michał Górny

Attachments

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

Replies

Subject Author
Re: [gentoo-python] distutils-r1 -- support for out-of-source builds? "Michał Górny" <mgorny@g.o>