commit:     282b13fe22409006bcf635f711e743c3481f71ad
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  9 05:31:17 2026 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Mar  9 05:33:54 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=282b13fe

games-strategy/freeciv: add 3.2.3; sync live

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

 games-strategy/freeciv/Manifest                    |  1 +
 .../files/freeciv-3.2.3-widget_id-truncation.patch | 86 ++++++++++++++++++++++
 .../{freeciv-9999.ebuild => freeciv-3.2.3.ebuild}  | 78 +++++---------------
 games-strategy/freeciv/freeciv-9999.ebuild         | 72 ++++--------------
 games-strategy/freeciv/metadata.xml                |  8 +-
 5 files changed, 120 insertions(+), 125 deletions(-)

diff --git a/games-strategy/freeciv/Manifest b/games-strategy/freeciv/Manifest
index c8d5366e9f50..654040efa000 100644
--- a/games-strategy/freeciv/Manifest
+++ b/games-strategy/freeciv/Manifest
@@ -1,2 +1,3 @@
 DIST freeciv-3.1.4.tar.gz 128914453 BLAKE2B 
60a371692e74434e8f8a0311b3c4732cb4a0199ea426f06eaac87d0f5982239f9bec069441f5897921907edafe6e5ab4492dd525b606eaeb3a4de1976d6c5766
 SHA512 
1a94861e4298e6fa81347a5625ae5d9fea1f2ee0195265a8b53a1c2255d1b02010140d3f48fc3474ae4aa188db16f12b84b7a112d37e2ed7bd474f250a50a97a
 DIST freeciv-3.2.0_beta2.tar.gz 142029035 BLAKE2B 
f1a04574ae9d33a8dd4d642a4e4eb74902986ecb518dd2a15e5ebcccd69c4163fc41f999821cda41e4653a12f2cb805423392318e4a2884c9cf70636a31e25c9
 SHA512 
8261ebdf828c4995706729f7b0469441dce7e234c1db62b3bf3ad106c6327b02b3ac5559082a794fcd444935c86af9934ad6083d07e74c8e66932f3a84876179
+DIST freeciv-3.2.3.tar.gz 142109424 BLAKE2B 
3d5c3c7379c646231da9c6d482fad0ac802d0a04a244e76fe76a855372687e403011f88708f1777c47f68c5e0e61fcf7c81351bd069e9ee29a0d8ac29acc6e8f
 SHA512 
04a468f17ef42a2cacd8eb59153ade17c0445545574be66c08c833b88da057ef9780540657b256a9661f493eec3a4e9731a315f4aab3159593fcc49559f0cd24

diff --git 
a/games-strategy/freeciv/files/freeciv-3.2.3-widget_id-truncation.patch 
b/games-strategy/freeciv/files/freeciv-3.2.3-widget_id-truncation.patch
new file mode 100644
index 000000000000..afb4f9ebaac4
--- /dev/null
+++ b/games-strategy/freeciv/files/freeciv-3.2.3-widget_id-truncation.patch
@@ -0,0 +1,86 @@
+https://redmine.freeciv.org/issues/1961
+From: Matt Jolly <[email protected]>
+Date: Mon, 9 Mar 2026 15:07:52 +1000
+Subject: [PATCH] sdl: Fix widget_id truncation in widget lookup functions
+
+get_widget_pointer_from_id() and get_widget_pointer_from_main_list()
+still used Uint16 id parameters after MAX_ID and widget_id were
+widened to 32 bits in 7a187ce264. This caused silent truncation of
+IDs like (MAX_ID - 1000 - style), making lookups fail and return
+NULL, leading to a segfault in nation_button_callback.
+
+See RM #1961
+
+Signed-off-by: Matt Jolly <[email protected]>
+--- a/client/gui-sdl2/widget.c
++++ b/client/gui-sdl2/widget.c
+@@ -550,7 +550,7 @@ void redraw_widget_info_label(SDL_Rect *rect)
+   Widget.
+ **************************************************************************/
+ struct widget *get_widget_pointer_from_id(const struct widget *gui_list,
+-                                          Uint16 id, enum scan_direction 
direction)
++                                          widget_id id, enum scan_direction 
direction)
+ {
+   if (direction == SCAN_FORWARD) {
+     while (gui_list) {
+@@ -575,7 +575,7 @@ struct widget *get_widget_pointer_from_id(const struct 
widget *gui_list,
+   Find ID in MAIN widgets list ( begin_widget_list ) and return pointer to
+   this Widgets.
+ **************************************************************************/
+-struct widget *get_widget_pointer_from_main_list(Uint16 id)
++struct widget *get_widget_pointer_from_main_list(widget_id id)
+ {
+   return get_widget_pointer_from_id(begin_main_widget_list, id, SCAN_FORWARD);
+ }
+--- a/client/gui-sdl2/widget.h
++++ b/client/gui-sdl2/widget.h
+@@ -206,10 +206,10 @@ struct widget *find_next_widget_at_pos(struct widget 
*start_widget, int x, int y
+ struct widget *find_next_widget_for_key(struct widget *start_widget, 
SDL_Keysym key);
+ 
+ struct widget *get_widget_pointer_from_id(const struct widget *gui_list,
+-                                          Uint16 id,
++                                          widget_id id,
+                                           enum scan_direction direction);
+ 
+-struct widget *get_widget_pointer_from_main_list(Uint16 id);
++struct widget *get_widget_pointer_from_main_list(widget_id id);
+ 
+ #define set_action(id, action_callback)       \
+       get_widget_pointer_from_main_list(id)->action = action_callback
+--- a/client/gui-sdl3/widget.c
++++ b/client/gui-sdl3/widget.c
+@@ -545,7 +545,7 @@ void redraw_widget_info_label(SDL_Rect *rect)
+   Widget.
+ **************************************************************************/
+ struct widget *get_widget_pointer_from_id(const struct widget *gui_list,
+-                                          Uint16 id, enum scan_direction 
direction)
++                                          widget_id id, enum scan_direction 
direction)
+ {
+   if (direction == SCAN_FORWARD) {
+     while (gui_list) {
+@@ -570,7 +570,7 @@ struct widget *get_widget_pointer_from_id(const struct 
widget *gui_list,
+   Find ID in MAIN widgets list ( begin_widget_list ) and return pointer to
+   this Widgets.
+ **************************************************************************/
+-struct widget *get_widget_pointer_from_main_list(Uint16 id)
++struct widget *get_widget_pointer_from_main_list(widget_id id)
+ {
+   return get_widget_pointer_from_id(begin_main_widget_list, id, SCAN_FORWARD);
+ }
+--- a/client/gui-sdl3/widget.h
++++ b/client/gui-sdl3/widget.h
+@@ -206,10 +206,10 @@ struct widget *find_next_widget_at_pos(struct widget 
*start_widget, int x, int y
+ struct widget *find_next_widget_for_key(struct widget *start_widget, 
SDL_KeyboardEvent *key);
+ 
+ struct widget *get_widget_pointer_from_id(const struct widget *gui_list,
+-                                          Uint16 id,
++                                          widget_id id,
+                                           enum scan_direction direction);
+ 
+-struct widget *get_widget_pointer_from_main_list(Uint16 id);
++struct widget *get_widget_pointer_from_main_list(widget_id id);
+ 
+ #define set_action(id, action_callback)       \
+       get_widget_pointer_from_main_list(id)->action = action_callback
+-- 
+2.52.0

diff --git a/games-strategy/freeciv/freeciv-9999.ebuild 
b/games-strategy/freeciv/freeciv-3.2.3.ebuild
similarity index 74%
copy from games-strategy/freeciv/freeciv-9999.ebuild
copy to games-strategy/freeciv/freeciv-3.2.3.ebuild
index f18503f5a70d..d5752321b71f 100644
--- a/games-strategy/freeciv/freeciv-9999.ebuild
+++ b/games-strategy/freeciv/freeciv-3.2.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -17,7 +17,7 @@ else
        MY_PV="R${PV//./_}"
        
SRC_URI="https://github.com/freeciv/freeciv/archive/refs/tags/${MY_PV}.tar.gz 
-> ${P}.tar.gz"
        if [[ ${PV} != *_beta* ]]; then
-               KEYWORDS="~amd64 ~ppc64 ~x86"
+               KEYWORDS="~amd64"
        fi
        MY_P="${PN}-${MY_PV}"
        S="${WORKDIR}/${MY_P}"
@@ -25,15 +25,13 @@ fi
 
 LICENSE="GPL-2+"
 SLOT="0"
-IUSE="authentication dedicated gtk3 gtk4 json mapimg mariadb modpack nls odbc 
qt6"
-IUSE+=" readline rule-editor sdl +sdl3 +server +sound sqlite svg +system-lua 
web-server"
+IUSE="dedicated gtk3 gtk4 json mapimg modpack nls qt6"
+IUSE+=" readline rule-editor +sdl3 +server +sound svg +system-lua web-server"
 
 REQUIRED_USE="
-       authentication? ( || ( mariadb odbc sqlite ) )
-       !dedicated? ( || ( gtk3 gtk4 qt6 sdl sdl3 ) )
-       dedicated? ( !gtk3 !gtk4 !mapimg !nls !qt6 !sdl !sdl3 !sound )
-       modpack? ( sqlite )
-       sound? ( || ( sdl3 sdl ) )
+       !dedicated? ( || ( gtk3 gtk4 qt6 sdl3 ) )
+       dedicated? ( !gtk3 !gtk4 !mapimg !nls !qt6 !sdl3 !sound )
+       sound? ( sdl3 )
        system-lua? ( ${LUA_REQUIRED_USE} )
 "
 
@@ -42,6 +40,7 @@ RDEPEND="
        app-arch/xz-utils
        app-arch/zstd:=
        dev-build/libtool
+       dev-db/sqlite:3
        dev-libs/icu:=
        net-misc/curl
        virtual/zlib:=
@@ -52,37 +51,18 @@ RDEPEND="
                mapimg? ( media-gfx/imagemagick:= )
                nls? ( virtual/libintl )
                qt6? ( dev-qt/qtbase:6[gui,widgets] )
-               sdl? (
-                       media-libs/libsdl2[video]
-                       media-libs/sdl2-gfx
-                       media-libs/sdl2-image[png]
-                       media-libs/sdl2-ttf
-               )
                sdl3? (
                        media-libs/libsdl3
                        media-libs/sdl3-ttf
                        media-libs/sdl3-image[png]
                )
                sound? (
-                       sdl? (
-                               media-libs/libsdl2[sound]
-                               media-libs/sdl2-mixer[vorbis]
-                       )
-                       sdl3? (
-                               media-libs/libsdl3
-                               media-libs/sdl3-mixer[vorbis]
-                       )
+                       media-libs/libsdl3
+                       >=media-libs/sdl3-mixer-3.1.2_rc1[vorbis]
                )
        )
        json? ( dev-libs/jansson:= )
        readline? ( sys-libs/readline:= )
-       mariadb? ( || (
-               dev-db/mariadb:*
-               dev-db/mariadb-connector-c
-               )
-       )
-       odbc? ( dev-db/unixODBC )
-       sqlite? ( dev-db/sqlite:3 )
        system-lua? (
                ${LUA_DEPS}
        )
@@ -102,6 +82,10 @@ pkg_setup() {
        use svg && use !qt6 && einfo "SVG flags only supported in qt6 client, 
ignoring"
 }
 
+PATCHES=(
+       "${FILESDIR}/${P}-widget_id-truncation.patch"
+)
+
 src_prepare() {
        # Upstream's meson.build is not very friendly to our needs
        sed -i -e "s:doc/freeciv:doc/${PF}:" meson.build || die
@@ -141,7 +125,6 @@ src_configure() {
        if ! use dedicated ; then
                # there's no SDL modpack backend; rather than incidentally pull 
in GTK3 (as is default)
                # let's explicitly set the backend to CLI
-               freeciv_enable_ui sdl sdl2 cli
                freeciv_enable_ui sdl3 sdl3 cli
                freeciv_enable_ui gtk3 gtk3.22 gtk3
                freeciv_enable_ui gtk4
@@ -160,26 +143,8 @@ src_configure() {
                -Dfcmp="$(meson-format-array "${myfcmp[*]}")"
        )
 
-       if use authentication; then
-               local myfcdb=()
-               use sqlite && myfcdb+=( sqlite3 )
-               use mariadb && myfcdb+=( mariadb )
-               use odbc && myfcdb+=( odbc )
-               emesonargs+=(
-                       -Dfcdb="$(meson-format-array "${myfcdb[*]}")"
-               )
-       else
-               # If we don't want authentication
-               emesonargs+=( -Dfcdb="" )
-       fi
-
        if use sound; then
-               # We can only select one, prefer the newer SDL3
-               if use sdl3 ; then
-                       emesonargs+=( -Daudio=sdl3 )
-               elif use sdl ; then
-                       emesonargs+=( -Daudio=sdl2 )
-               fi
+               emesonargs+=( -Daudio=sdl3 )
        else
                # We don't want any audio support; probably a dedicated server
                emesonargs+=( -Daudio=none )
@@ -233,11 +198,6 @@ src_install() {
                find "${ED}"/usr/share/man/man6/ \
                        -not \( -name 'freeciv.6' -o -name 'freeciv-ruledit.6' \
                        -o -name 'freeciv-ruleup.6' -o -name 'freeciv-server.6' 
\) -mindepth 1 -delete || die
-       else
-               # sdl client needs some special handling
-               if ! use sdl ; then
-                       rm "${ED}"/usr/share/man/man6/freeciv-sdl2.6 || die
-               fi
        fi
 
 }
@@ -245,13 +205,11 @@ src_install() {
 pkg_postinst() {
        xdg_pkg_postinst
 
-       if [[ -z ${REPLACING_VERSIONS} ]] && use authentication; then
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
                einfo "There are a number of supported authentication backends."
                einfo "sqlite3 is the default, however dedicated servers may 
wish to"
-               einfo "use another supported backend. Additional configuration 
is required,"
-               einfo "to do so, even if the relevant USE was selected at build 
time."
-               einfo "please consult the documentation for instructions on 
configuring"
-               einfo "freeciv for a particular backend:"
+               einfo "use another supported backend; please consult the 
documentation"
+               einfo "to configure freeciv for a particular backend:"
                einfo 
"https://github.com/freeciv/freeciv/blob/main/doc/README.fcdb";
        fi
 }

diff --git a/games-strategy/freeciv/freeciv-9999.ebuild 
b/games-strategy/freeciv/freeciv-9999.ebuild
index f18503f5a70d..71f323705db7 100644
--- a/games-strategy/freeciv/freeciv-9999.ebuild
+++ b/games-strategy/freeciv/freeciv-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -25,15 +25,13 @@ fi
 
 LICENSE="GPL-2+"
 SLOT="0"
-IUSE="authentication dedicated gtk3 gtk4 json mapimg mariadb modpack nls odbc 
qt6"
-IUSE+=" readline rule-editor sdl +sdl3 +server +sound sqlite svg +system-lua 
web-server"
+IUSE="dedicated gtk3 gtk4 json mapimg modpack nls qt6"
+IUSE+=" readline rule-editor +sdl3 +server +sound svg +system-lua web-server"
 
 REQUIRED_USE="
-       authentication? ( || ( mariadb odbc sqlite ) )
-       !dedicated? ( || ( gtk3 gtk4 qt6 sdl sdl3 ) )
-       dedicated? ( !gtk3 !gtk4 !mapimg !nls !qt6 !sdl !sdl3 !sound )
-       modpack? ( sqlite )
-       sound? ( || ( sdl3 sdl ) )
+       !dedicated? ( || ( gtk3 gtk4 qt6 sdl3 ) )
+       dedicated? ( !gtk3 !gtk4 !mapimg !nls !qt6 !sdl3 !sound )
+       sound? ( sdl3 )
        system-lua? ( ${LUA_REQUIRED_USE} )
 "
 
@@ -42,6 +40,7 @@ RDEPEND="
        app-arch/xz-utils
        app-arch/zstd:=
        dev-build/libtool
+       dev-db/sqlite:3
        dev-libs/icu:=
        net-misc/curl
        virtual/zlib:=
@@ -52,37 +51,18 @@ RDEPEND="
                mapimg? ( media-gfx/imagemagick:= )
                nls? ( virtual/libintl )
                qt6? ( dev-qt/qtbase:6[gui,widgets] )
-               sdl? (
-                       media-libs/libsdl2[video]
-                       media-libs/sdl2-gfx
-                       media-libs/sdl2-image[png]
-                       media-libs/sdl2-ttf
-               )
                sdl3? (
                        media-libs/libsdl3
                        media-libs/sdl3-ttf
                        media-libs/sdl3-image[png]
                )
                sound? (
-                       sdl? (
-                               media-libs/libsdl2[sound]
-                               media-libs/sdl2-mixer[vorbis]
-                       )
-                       sdl3? (
-                               media-libs/libsdl3
-                               media-libs/sdl3-mixer[vorbis]
-                       )
+                       media-libs/libsdl3
+                       >=media-libs/sdl3-mixer-3.1.2_rc1[vorbis]
                )
        )
        json? ( dev-libs/jansson:= )
        readline? ( sys-libs/readline:= )
-       mariadb? ( || (
-               dev-db/mariadb:*
-               dev-db/mariadb-connector-c
-               )
-       )
-       odbc? ( dev-db/unixODBC )
-       sqlite? ( dev-db/sqlite:3 )
        system-lua? (
                ${LUA_DEPS}
        )
@@ -141,7 +121,6 @@ src_configure() {
        if ! use dedicated ; then
                # there's no SDL modpack backend; rather than incidentally pull 
in GTK3 (as is default)
                # let's explicitly set the backend to CLI
-               freeciv_enable_ui sdl sdl2 cli
                freeciv_enable_ui sdl3 sdl3 cli
                freeciv_enable_ui gtk3 gtk3.22 gtk3
                freeciv_enable_ui gtk4
@@ -160,26 +139,8 @@ src_configure() {
                -Dfcmp="$(meson-format-array "${myfcmp[*]}")"
        )
 
-       if use authentication; then
-               local myfcdb=()
-               use sqlite && myfcdb+=( sqlite3 )
-               use mariadb && myfcdb+=( mariadb )
-               use odbc && myfcdb+=( odbc )
-               emesonargs+=(
-                       -Dfcdb="$(meson-format-array "${myfcdb[*]}")"
-               )
-       else
-               # If we don't want authentication
-               emesonargs+=( -Dfcdb="" )
-       fi
-
        if use sound; then
-               # We can only select one, prefer the newer SDL3
-               if use sdl3 ; then
-                       emesonargs+=( -Daudio=sdl3 )
-               elif use sdl ; then
-                       emesonargs+=( -Daudio=sdl2 )
-               fi
+               emesonargs+=( -Daudio=sdl3 )
        else
                # We don't want any audio support; probably a dedicated server
                emesonargs+=( -Daudio=none )
@@ -233,11 +194,6 @@ src_install() {
                find "${ED}"/usr/share/man/man6/ \
                        -not \( -name 'freeciv.6' -o -name 'freeciv-ruledit.6' \
                        -o -name 'freeciv-ruleup.6' -o -name 'freeciv-server.6' 
\) -mindepth 1 -delete || die
-       else
-               # sdl client needs some special handling
-               if ! use sdl ; then
-                       rm "${ED}"/usr/share/man/man6/freeciv-sdl2.6 || die
-               fi
        fi
 
 }
@@ -245,13 +201,11 @@ src_install() {
 pkg_postinst() {
        xdg_pkg_postinst
 
-       if [[ -z ${REPLACING_VERSIONS} ]] && use authentication; then
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
                einfo "There are a number of supported authentication backends."
                einfo "sqlite3 is the default, however dedicated servers may 
wish to"
-               einfo "use another supported backend. Additional configuration 
is required,"
-               einfo "to do so, even if the relevant USE was selected at build 
time."
-               einfo "please consult the documentation for instructions on 
configuring"
-               einfo "freeciv for a particular backend:"
+               einfo "use another supported backend; please consult the 
documentation"
+               einfo "to configure freeciv for a particular backend:"
                einfo 
"https://github.com/freeciv/freeciv/blob/main/doc/README.fcdb";
        fi
 }

diff --git a/games-strategy/freeciv/metadata.xml 
b/games-strategy/freeciv/metadata.xml
index 9f211d2d181c..347370222ba1 100644
--- a/games-strategy/freeciv/metadata.xml
+++ b/games-strategy/freeciv/metadata.xml
@@ -10,24 +10,20 @@
                <name>Matt Joly</name>
        </maintainer>
        <use>
-               <flag name="authentication">Enable authentication support, 
useful for dedicated servers</flag>
                <flag name="gtk3">Build the gtk3 client</flag>
                <flag name="gtk4">Build the gtk4 client</flag>
                <flag name="json">Add support for JSON via
                        <pkg>dev-libs/jansson</pkg></flag>
-               <flag name="mariadb">Support <pkg>dev-db/mariadb</pkg> as an 
authentication backend</flag>
                <flag name="mapimg">Additional mag image toolkit
                        via <pkg>media-gfx/imagemagick</pkg></flag>
                <flag name="modpack">Build the freeciv-modpack-program
                        to download/install mods</flag>
-               <flag name="odbc">Support ODBC as an authentication 
backend</flag>
                <flag name="rule-editor">Build ruleset editor</flag>
+               <flag name="sdl3">Build the SDL3 client.</flag>
                <flag name="server">Enable server support. Disabling this
                        will also make it impossible to start local games</flag>
                <flag name="sound">Add support for sound provided by
-                       <pkg>media-libs/sdl2-mixer</pkg> or 
<pkg>media-libs/sdl3-mixer</pkg></flag>
-               <flag name="sdl3">Build the SDL3 client. This will also use 
<pkg>media-libs/sdl3-mixer</pkg>
-                       for audio in the SDL2 client, if enabled</flag>
+                       <pkg>media-libs/sdl3-mixer</pkg></flag>
                <flag name="system-lua">Use <pkg>dev-lang/lua</pkg> instead of
                        the bundled liblua</flag>
                <flag name="web-server">Build the freeciv-web server in place

Reply via email to