diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> | 2018-06-11 18:49:44 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gentoo.org> | 2018-06-11 18:49:44 -0700 |
commit | 7457a55b31bce1d433214f23e0150a9a993019bf (patch) | |
tree | 86773afa5b3c0d77a52c8a96842d9ed41f4597ee | |
parent | sys-kernel/gentoo-sources: Linux patch 4.17.1 (diff) | |
download | gentoo-7457a55b31bce1d433214f23e0150a9a993019bf.tar.gz gentoo-7457a55b31bce1d433214f23e0150a9a993019bf.tar.bz2 gentoo-7457a55b31bce1d433214f23e0150a9a993019bf.zip |
media-libs/mesa: Simplify and optimize driver_list()
Make *_DRIVERS arrays instead of strings.
-rw-r--r-- | media-libs/mesa/mesa-9999.ebuild | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index 9df1aa45f58d..efc874f4902e 100644 --- a/media-libs/mesa/mesa-9999.ebuild +++ b/media-libs/mesa/mesa-9999.ebuild @@ -351,16 +351,16 @@ multilib_src_configure() { fi if use gallium; then - GALLIUM_DRIVERS+="swrast " + GALLIUM_DRIVERS+=(swrast) emesonargs+=( -Dosmesa=$(usex osmesa gallium none) ) else - DRI_DRIVERS+="swrast " + DRI_DRIVERS+=(swrast) emesonargs+=( -Dosmesa=$(usex osmesa classic none) ) fi driver_list() { - arr=($(printf "%s\n" "$@" | sort -u | tr '\n' ',')) - echo "${arr: : -1}" + local drivers="$(sort -u <<< "${1// /$'\n'}")" + echo "${drivers//$'\n'/,}" } emesonargs+=( @@ -376,9 +376,9 @@ multilib_src_configure() { $(meson_use unwind libunwind) $(meson_use lm_sensors lmsensors) -Dvalgrind=$(usex valgrind auto false) - -Ddri-drivers=$(driver_list ${DRI_DRIVERS}) - -Dgallium-drivers=$(driver_list ${GALLIUM_DRIVERS}) - -Dvulkan-drivers=$(driver_list ${VULKAN_DRIVERS}) + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}") + -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}") + -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}") ) meson_src_configure } @@ -462,20 +462,20 @@ pkg_prerm() { dri_driver_enable() { if use $1; then shift - DRI_DRIVERS+="$@ " + DRI_DRIVERS+=("$@") fi } gallium_enable() { if use $1; then shift - GALLIUM_DRIVERS+="$@ " + GALLIUM_DRIVERS+=("$@") fi } vulkan_enable() { if use $1; then shift - VULKAN_DRIVERS+="$@ " + VULKAN_DRIVERS+=("$@") fi } |