Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Planned changes to waf-utils.eclass
Date: Fri, 26 Dec 2014 10:55:26
Message-Id: 20141226115504.25d016e4@pomiot.lan
1 Hello, developers.
2
3 I would like to do some redesign of waf-utils that aims at improving
4 Python compatibility. In order to prepare for this, I'd like to commit
5 some extra QA warnings. Please review the attached patch.
6
7 The goal is to require using of another (proper) python eclass along
8 with waf-utils. Currently, the code has some implicit Python magic
9 which may work or not work randomly, and some ebuilds are mixing it
10 with Python eclasses to improve things a bit. Sadly, the two things
11 don't integrate as well as they could.
12
13 After the final change, the ebuilds will be obligated to:
14
15 1. set PYTHON_COMPAT to state which implementations their waf scripts
16 (and the package, if relevant) support,
17
18 2. set PYTHON_REQ_USE as appropriate for waf (and the package),
19
20 3. inherit and use proper eclass -- python-any-r1, python-single-r1 or
21 python-r1.
22
23
24 A few examples:
25
26 a. build-time Python dependency only (waf or waf + some other scripts):
27
28 PYTHON_COMPAT=( python2_7 python3_4 )
29 PYTHON_REQ_USE='threads(+)' # required by waf
30
31 inherit python-any-r1
32
33 DEPEND=${PYTHON_DEPS}
34
35 pkg_setup() { python-any-r1_pkg_setup; } # if necessary
36
37 b. simple runtime dep on python (+ build-time due to waf)
38
39 PYTHON_COMPAT=( python2_7 ) # package supports 2.7 only
40 PYTHON_REQ_USE='threads(+),ssl(+)' # threads by waf, ssl by pkg
41
42 inherit python-single-r1
43
44 RDEPEND=${PYTHON_DEPS}
45 DEPEND=${RDEPEND}
46 REQUIRED_USE=${PYTHON_REQUIRED_USE}
47
48 pkg_setup() { python-single-r1_pkg_setup; }
49
50 c. conditional runtime dep + build-time dep due to waf
51
52 PYTHON_COMPAT=( python2_7 )
53 PYTHON_REQ_USE='threads(+),ssl(+)'
54
55 inherit python-single-r1
56
57 RDEPEND="python? ( ${PYTHON_DEPS} )"
58 DEPEND=${PYTHON_DEPS}
59 REQUIRED_USE=${PYTHON_REQUIRED_USE} # note: uncond due to build dep
60
61 pkg_setup() { python-single-r1_pkg_setup; } # has MERGE_TYPE inside
62
63 # but if you needed python during binpkg pre/post*, you'd do:
64 # pkg_setup() {
65 # if [[ ${MERGE_TYPE} != binary ]] || use python; then
66 # python_setup
67 # fi
68 # }
69
70 --
71 Best regards,
72 Michał Górny

Attachments

File name MIME type
waf-utils.eclass.diff text/x-patch

Replies

Subject Author
Re: [gentoo-dev] Planned changes to waf-utils.eclass Pacho Ramos <pacho@g.o>