Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mesa/
Date: Tue, 12 Jun 2018 01:51:11
Message-Id: 1528768184.7457a55b31bce1d433214f23e0150a9a993019bf.mattst88@gentoo
1 commit: 7457a55b31bce1d433214f23e0150a9a993019bf
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Tue Jun 12 01:49:44 2018 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 12 01:49:44 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7457a55b
7
8 media-libs/mesa: Simplify and optimize driver_list()
9
10 Make *_DRIVERS arrays instead of strings.
11
12 media-libs/mesa/mesa-9999.ebuild | 20 ++++++++++----------
13 1 file changed, 10 insertions(+), 10 deletions(-)
14
15 diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
16 index 9df1aa45f58..efc874f4902 100644
17 --- a/media-libs/mesa/mesa-9999.ebuild
18 +++ b/media-libs/mesa/mesa-9999.ebuild
19 @@ -351,16 +351,16 @@ multilib_src_configure() {
20 fi
21
22 if use gallium; then
23 - GALLIUM_DRIVERS+="swrast "
24 + GALLIUM_DRIVERS+=(swrast)
25 emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
26 else
27 - DRI_DRIVERS+="swrast "
28 + DRI_DRIVERS+=(swrast)
29 emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
30 fi
31
32 driver_list() {
33 - arr=($(printf "%s\n" "$@" | sort -u | tr '\n' ','))
34 - echo "${arr: : -1}"
35 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
36 + echo "${drivers//$'\n'/,}"
37 }
38
39 emesonargs+=(
40 @@ -376,9 +376,9 @@ multilib_src_configure() {
41 $(meson_use unwind libunwind)
42 $(meson_use lm_sensors lmsensors)
43 -Dvalgrind=$(usex valgrind auto false)
44 - -Ddri-drivers=$(driver_list ${DRI_DRIVERS})
45 - -Dgallium-drivers=$(driver_list ${GALLIUM_DRIVERS})
46 - -Dvulkan-drivers=$(driver_list ${VULKAN_DRIVERS})
47 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
48 + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
49 + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
50 )
51 meson_src_configure
52 }
53 @@ -462,20 +462,20 @@ pkg_prerm() {
54 dri_driver_enable() {
55 if use $1; then
56 shift
57 - DRI_DRIVERS+="$@ "
58 + DRI_DRIVERS+=("$@")
59 fi
60 }
61
62 gallium_enable() {
63 if use $1; then
64 shift
65 - GALLIUM_DRIVERS+="$@ "
66 + GALLIUM_DRIVERS+=("$@")
67 fi
68 }
69
70 vulkan_enable() {
71 if use $1; then
72 shift
73 - VULKAN_DRIVERS+="$@ "
74 + VULKAN_DRIVERS+=("$@")
75 fi
76 }