commit:     c86eccf8feccd6ee30ec4db9ec34fea0e77b288e
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 16 05:05:36 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Wed Apr 16 05:52:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c86eccf8

games-strategy/freeciv: use `meson-format-array`

Also include logic to prevent duplicate `cli` modpack array members
built with `sdl2` and `sdl3` clients.

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 games-strategy/freeciv/freeciv-3.2.0_beta2.ebuild | 11 +++++++----
 games-strategy/freeciv/freeciv-9999.ebuild        | 13 ++++++++-----
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/games-strategy/freeciv/freeciv-3.2.0_beta2.ebuild 
b/games-strategy/freeciv/freeciv-3.2.0_beta2.ebuild
index a62e7ec5bef5..bb9c48299f11 100644
--- a/games-strategy/freeciv/freeciv-3.2.0_beta2.ebuild
+++ b/games-strategy/freeciv/freeciv-3.2.0_beta2.ebuild
@@ -123,7 +123,10 @@ src_configure() {
 
                if use ${flag} ; then
                        myclient+=( ${client_name} )
-                       use modpack && myfcmp+=( ${fcmp_name} )
+                       # Avoid duplicate `cli` entries; meson will complain
+                       if use modpack && [[ ! " ${myfcmp[*]} " =~ " 
${fcmp_name} " ]]; then
+                               myfcmp+=( ${fcmp_name} )
+                       fi
                fi
        }
 
@@ -145,8 +148,8 @@ src_configure() {
 
        # the client and fpmc arrays are now populated (or not for dedicated); 
let's add them to emesonargs
        emesonargs+=(
-               -Dclients=$(IFS=, ; echo "${myclient[*]}")
-               -Dfcmp=$(IFS=, ; echo "${myfcmp[*]}")
+               -Dclients="$(meson-format-array "${myclient[*]}")"
+               -Dfcmp="$(meson-format-array "${myfcmp[*]}")"
        )
 
        if use sound; then
@@ -171,7 +174,7 @@ src_configure() {
        # default-enabled upstream
        use rule-editor && tools+=( ruledit ruleup )
        emesonargs+=(
-               -Dtools=$(IFS=, ; echo ${tools[*]})
+               -Dtools=$(meson-format-array ${tools[*]})
        )
 
        # Anything that can be trivially set by meson_use goes here

diff --git a/games-strategy/freeciv/freeciv-9999.ebuild 
b/games-strategy/freeciv/freeciv-9999.ebuild
index 65c349c37342..0ba23a26c9c9 100644
--- a/games-strategy/freeciv/freeciv-9999.ebuild
+++ b/games-strategy/freeciv/freeciv-9999.ebuild
@@ -131,7 +131,10 @@ src_configure() {
 
                if use ${flag} ; then
                        myclient+=( ${client_name} )
-                       use modpack && myfcmp+=( ${fcmp_name} )
+                       # Avoid duplicate `cli` entries; meson will complain
+                       if use modpack && [[ ! " ${myfcmp[*]} " =~ " 
${fcmp_name} " ]]; then
+                               myfcmp+=( ${fcmp_name} )
+                       fi
                fi
        }
 
@@ -153,8 +156,8 @@ src_configure() {
 
        # the client and fpmc arrays are now populated (or not for dedicated); 
let's add them to emesonargs
        emesonargs+=(
-               -Dclients=$(IFS=, ; echo "${myclient[*]}")
-               -Dfcmp=$(IFS=, ; echo "${myfcmp[*]}")
+               -Dclients="$(meson-format-array "${myclient[*]}")"
+               -Dfcmp="$(meson-format-array "${myfcmp[*]}")"
        )
 
        if use authentication; then
@@ -163,7 +166,7 @@ src_configure() {
                use mariadb && myfcdb+=( mariadb )
                use odbc && myfcdb+=( odbc )
                emesonargs+=(
-                       -Dfcdb=$(IFS=, ; echo "${myfcdb[*]}")
+                       -Dfcdb="$(meson-format-array "${myfcdb[*]}")"
                )
        else
                # If we don't want authentication
@@ -192,7 +195,7 @@ src_configure() {
        # default-enabled upstream
        use rule-editor && tools+=( ruledit ruleup )
        emesonargs+=(
-               -Dtools=$(IFS=, ; echo ${tools[*]})
+               -Dtools=$(meson-format-array ${tools[*]})
        )
 
        # Anything that can be trivially set by meson_use goes here

Reply via email to