Gentoo Archives: gentoo-desktop

From: "Michał Górny" <mgorny@g.o>
To: gentoo-desktop@l.g.o
Cc: x11@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-desktop] [PATCH 1/3] Support XORG_MULTILIB to enable multilib support.
Date: Sun, 20 Jan 2013 19:07:42
Message-Id: 1358708908-20141-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-desktop] First steps into X11 global multilib by "Michał Górny"
1 ---
2 eclass/xorg-2.eclass | 37 ++++++++++++++++++++++++++++++-------
3 1 file changed, 30 insertions(+), 7 deletions(-)
4
5 diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
6 index 87d31f6..f63b882 100644
7 --- a/eclass/xorg-2.eclass
8 +++ b/eclass/xorg-2.eclass
9 @@ -37,10 +37,20 @@ if [[ ${PN} == font* \
10 FONT_ECLASS="font"
11 fi
12
13 +# @ECLASS-VARIABLE: XORG_MULTILIB
14 +# @DESCRIPTION:
15 +# If set to 'yes', the multilib support for package will be enabled. Set
16 +# before inheriting this eclass.
17 +: ${XORG_MULTILIB:="no"}
18 +
19 # we need to inherit autotools first to get the deps
20 inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \
21 flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS}
22
23 +if [[ ${XORG_MULTILIB} == yes ]]; then
24 + inherit autotools-multilib
25 +fi
26 +
27 EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
28 case "${EAPI:-0}" in
29 3|4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
30 @@ -438,7 +448,11 @@ xorg-2_src_configure() {
31 "${xorgconfadd[@]}"
32 )
33
34 - autotools-utils_src_configure "$@"
35 + if [[ ${XORG_MULTILIB} == yes ]]; then
36 + autotools-multilib_src_configure "$@"
37 + else
38 + autotools-utils_src_configure "$@"
39 + fi
40 }
41
42 # @FUNCTION: xorg-2_src_compile
43 @@ -447,7 +461,11 @@ xorg-2_src_configure() {
44 xorg-2_src_compile() {
45 debug-print-function ${FUNCNAME} "$@"
46
47 - autotools-utils_src_compile "$@"
48 + if [[ ${XORG_MULTILIB} == yes ]]; then
49 + autotools-multilib_src_compile "$@"
50 + else
51 + autotools-utils_src_compile "$@"
52 + fi
53 }
54
55 # @FUNCTION: xorg-2_src_install
56 @@ -457,13 +475,18 @@ xorg-2_src_compile() {
57 xorg-2_src_install() {
58 debug-print-function ${FUNCNAME} "$@"
59
60 + local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" )
61 +
62 if [[ ${CATEGORY} == x11-proto ]]; then
63 - autotools-utils_src_install \
64 - ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}" \
65 - docdir="${EPREFIX}/usr/share/doc/${PF}"
66 + install_args+=(
67 + ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}"
68 + )
69 + fi
70 +
71 + if [[ ${XORG_MULTILIB} == yes ]]; then
72 + autotools-multilib_src_install "${install_args[@]}"
73 else
74 - autotools-utils_src_install \
75 - docdir="${EPREFIX}/usr/share/doc/${PF}"
76 + autotools-utils_src_install "${install_args[@]}"
77 fi
78
79 if [[ -n ${GIT_ECLASS} ]]; then
80 --
81 1.8.1.1