commit:     22f4f1e745d4f30bef0258882dd081c24e1cec9e
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Mon Feb  9 11:18:18 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 11 03:43:31 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22f4f1e7

games-emulation/lxdream: Fix bad build script, tests, C23

Consists of patch from @tdr and my own fix for linking failure
in tests.
With this, SVN is not called from build script, emulator builds
successfully and test passes.
Do not have anything to verify performance or running of emulator.

Closes: https://bugs.gentoo.org/770484
Closes: https://bugs.gentoo.org/968267
Bug: https://bugs.gentoo.org/831786
Bug: https://bugs.gentoo.org/884823
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Part-of: https://github.com/gentoo/gentoo/pull/45704
Closes: https://github.com/gentoo/gentoo/pull/45704
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../lxdream/files/lxdream-0.9.1-multi-fix.patch    | 132 +++++++++++++++++++++
 .../files/lxdream-0.9.1-remove-test-stub.patch     |  12 ++
 games-emulation/lxdream/lxdream-0.9.1-r5.ebuild    |  69 +++++++++++
 games-emulation/lxdream/metadata.xml               |   3 +
 4 files changed, 216 insertions(+)

diff --git a/games-emulation/lxdream/files/lxdream-0.9.1-multi-fix.patch 
b/games-emulation/lxdream/files/lxdream-0.9.1-multi-fix.patch
new file mode 100644
index 000000000000..201904147670
--- /dev/null
+++ b/games-emulation/lxdream/files/lxdream-0.9.1-multi-fix.patch
@@ -0,0 +1,132 @@
+From 76a2ab26febc38c0e113f374e4f5bed851b8d140 Mon Sep 17 00:00:00 2001
+From: Ted Rodgers <[email protected]>
+Date: Sat, 3 Jan 2026 18:44:27 -0500
+Subject: [PATCH] bug 968267: move to DEFAULT_SOURCE from BSD_SOURCE in
+ rc/Makefile.am + src/Makefile..in; bug 968267 + bug 884823: gdrom/gdrom.c
+ include arpa/inet.h ; bug 740384: remove calls to / use of subversion
+
+---
+ src/Makefile.am      |  5 ++---
+ src/Makefile.in      |  3 +--
+ src/checkver.pl      | 19 ++++---------------
+ src/gdrom/gdrom.c    |  1 +
+ src/gtkui/gtk_ctrl.c |  2 +-
+ 5 files changed, 9 insertions(+), 21 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8691ef1..7f08297 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,5 +1,4 @@
+ ## Process this file with automake to produce Makefile.in
+-SVNVERSION=@SVNVERSION@
+ INCLUDES = \
+       -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+       -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+@@ -17,7 +16,7 @@ check_PROGRAMS = test/testxlt
+ 
+ pkglib_PROGRAMS=
+ EXTRA_DIST=drivers/genkeymap.pl checkver.pl drivers/dummy.c
+-AM_CFLAGS = -D__EXTENSIONS__ -D_BSD_SOURCE -D_GNU_SOURCE
++AM_CFLAGS = -D__EXTENSIONS__ -D_DEFAULT_SOURCE -D_GNU_SOURCE
+ 
+ .PHONY: checkversion
+ checkversion:
+@@ -252,4 +251,4 @@ pvr2/gl_slsrc.c: genglsl pvr2/vertex.glsl 
pvr2/fragment.glsl
+       ./genglsl $(srcdir)/pvr2/vertex.glsl $(srcdir)/pvr2/fragment.glsl $@
+ drivers/mac_keymap.h: drivers/mac_keymap.txt drivers/genkeymap.pl
+       $(srcdir)/drivers/genkeymap.pl mac $(srcdir)/drivers/mac_keymap.txt > $@
+-      
+\ No newline at end of file
++      
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 5c2f049..8dbfa28 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -512,7 +512,6 @@ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+-SVNVERSION = @SVNVERSION@
+ INCLUDES = \
+       -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+       -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+@@ -522,7 +521,7 @@ INCLUDES = \
+       @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @PULSE_CFLAGS@ 
@ESOUND_CFLAGS@ @ALSA_CFLAGS@ @SDL_CFLAGS@
+ 
+ EXTRA_DIST = drivers/genkeymap.pl checkver.pl drivers/dummy.c
+-AM_CFLAGS = -D__EXTENSIONS__ -D_BSD_SOURCE -D_GNU_SOURCE
++AM_CFLAGS = -D__EXTENSIONS__ -D_DEFAULT_SOURCE -D_GNU_SOURCE
+ TESTS = test/testxlt
+ BUILT_SOURCES = sh4/sh4core.c sh4/sh4dasm.c sh4/sh4x86.c sh4/sh4stat.c \
+       pvr2/gl_slsrc.c drivers/mac_keymap.h version.c
+diff --git a/src/checkver.pl b/src/checkver.pl
+index 3fbcced..b12c9af 100755
+--- a/src/checkver.pl
++++ b/src/checkver.pl
+@@ -1,28 +1,17 @@
+ #!/usr/bin/perl
+ # Usage: updatever.pl <basever> <top_srcdir> <version file>
+ 
+-my $svnversion = "svnversion";
+-my $basever = $ARGV[0];
+ my $top_srcdir = $ARGV[1];
+ my $outfile = $ARGV[2];
+ 
+ my $rev = "";
+ my $full_ver = "$basever";
+ 
+-if( $svnversion ) {
+-   $rev = `$svnversion "$top_srcdir"`;
+-   chomp $rev;
+-   if( $rev == "exported" ) {
+-      $rev = "";
+-   } else {
+-      $full_ver = "${basever}.${rev}";
+-   }
+-}
+ my $header = "/* Autogenerated by checkver.pl */";
+ my $output = "${header}\n".
+-             "const char lxdream_package_name[] = \"lxdream $basever\";\n" .
+-             "const char lxdream_short_version[] = \"$basever\";\n" .
+-             "const char lxdream_full_version[] = \"$full_ver\";\n" .
++             "const char lxdream_package_name[] = \"lxdream 0.9.1\";\n" .
++             "const char lxdream_short_version[] = \"0.9.1\";\n" .
++             "const char lxdream_full_version[] = \"0.9.1\";\n" .
+              "const char lxdream_copyright[] = \"Copyright (C) 2005-2008 
Nathan Keynes\";\n";
+ 
+ my $oldfile = "";
+@@ -36,4 +25,4 @@ if( $oldfile ne $output ) {
+     open(VERSIONFILE, ">$outfile") || die "Unable to write to $outfile\n";
+     print VERSIONFILE $output;
+     close(VERSIONFILE);
+-}
+\ No newline at end of file
++}
+diff --git a/src/gdrom/gdrom.c b/src/gdrom/gdrom.c
+index 90756ed..35b6482 100644
+--- a/src/gdrom/gdrom.c
++++ b/src/gdrom/gdrom.c
+@@ -21,6 +21,7 @@
+ #include <errno.h>
+ #include <ctype.h>
+ #include <glib.h>
++#include <arpa/inet.h>
+ #include "gdrom/ide.h"
+ #include "gdrom/gdrom.h"
+ #include "gdrom/gddriver.h"
+diff --git a/src/gtkui/gtk_ctrl.c b/src/gtkui/gtk_ctrl.c
+index 93ea881..6296f49 100644
+--- a/src/gtkui/gtk_ctrl.c
++++ b/src/gtkui/gtk_ctrl.c
+@@ -310,7 +310,7 @@ static gboolean maple_device_changed( GtkComboBox *combo, 
gpointer user_data )
+                         MAPLE_VMU_HAS_NAME(maple_data[i].new_device, 
vmu_filename) ) {
+                     
maple_data[i].new_device->destroy(maple_data[i].new_device);
+                     maple_data[i].new_device = NULL;
+-                    gtk_combo_box_set_active(maple_data[i].combo,0);
++                    
gtk_combo_box_set_active(GTK_COMBO_BOX(maple_data[i].combo),0);
+                 }
+             }
+             MAPLE_SET_VMU_NAME(data->new_device,vmu_filename);
+-- 
+2.52.0
\ No newline at end of file

diff --git a/games-emulation/lxdream/files/lxdream-0.9.1-remove-test-stub.patch 
b/games-emulation/lxdream/files/lxdream-0.9.1-remove-test-stub.patch
new file mode 100644
index 000000000000..6822b35fadb4
--- /dev/null
+++ b/games-emulation/lxdream/files/lxdream-0.9.1-remove-test-stub.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/770484
+This is a stub definition, it broke linking and was unneeded
+--- a/src/test/testsh4x86.c
++++ b/src/test/testsh4x86.c
+@@ -113,7 +113,6 @@
+ gboolean FASTCALL mmu_update_icache( sh4vma_t addr ) { return TRUE; }
+ void MMU_ldtlb() { }
+ struct sh4_icache_struct sh4_icache;
+-struct mem_region_fn mem_region_unmapped;
+ 
+ void usage()
+ {

diff --git a/games-emulation/lxdream/lxdream-0.9.1-r5.ebuild 
b/games-emulation/lxdream/lxdream-0.9.1-r5.ebuild
new file mode 100644
index 000000000000..8400928cdcc7
--- /dev/null
+++ b/games-emulation/lxdream/lxdream-0.9.1-r5.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic xdg
+
+DESCRIPTION="An emulator for the Sega Dreamcast system"
+HOMEPAGE="https://github.com/lxdream/lxdream";
+SRC_URI="http://www.lxdream.org/count.php?file=${P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# lirc configure option is not recogniced
+IUSE="debug profile pulseaudio sdl" #lirc
+
+RDEPEND="
+       app-misc/lirc
+       media-libs/alsa-lib
+       media-libs/libpng:0=
+       virtual/opengl
+       x11-libs/gtk+:2
+       pulseaudio? ( media-libs/libpulse )
+       sdl? ( media-libs/libsdl[sound] )"
+DEPEND="${RDEPEND}
+       !!gnustep-base/gnustep-gui" #377635
+BDEPEND="
+       sys-devel/gettext
+       virtual/os-headers
+       virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-glib-single-include.patch
+       "${FILESDIR}"/${P}-fno-common.patch
+       "${FILESDIR}"/${P}-multi-fix.patch
+       "${FILESDIR}"/${P}-remove-test-stub.patch
+)
+
+src_prepare() {
+       default
+
+       # Make .desktop file pass desktop-file-validate
+       sed -i \
+               -e '/Encoding/d' \
+               -e '/FilePattern/d' \
+               -e '/Categories/s|$|;|' \
+               ${PN}.desktop || die
+       # Do not override user-specified CFLAGS
+       sed -i \
+               -e s/'CFLAGS=\"-g -fexceptions\"'/'CFLAGS=\"${CFLAGS} -g 
-fexceptions\"'/ \
+               -e '/CCOPT/d' \
+               -e '/OBJCOPT/d' \
+               configure || die
+       append-libs -lX11 -lm
+}
+
+src_configure() {
+       # lirc configure option is not recognized
+       # $(use_with lirc) \
+       econf \
+               --datadir="${EPREFIX}/usr/share" \
+               $(use_enable debug trace) \
+               $(use_enable debug watch) \
+               $(use_enable profile profiled) \
+               $(use_with pulseaudio pulse) \
+               $(use_with sdl) \
+               --without-esd
+}

diff --git a/games-emulation/lxdream/metadata.xml 
b/games-emulation/lxdream/metadata.xml
index 7c730d47817a..20ef3279c2b4 100644
--- a/games-emulation/lxdream/metadata.xml
+++ b/games-emulation/lxdream/metadata.xml
@@ -5,4 +5,7 @@
                <email>[email protected]</email>
                <name>Gentoo Games Project</name>
        </maintainer>
+       <upstream>
+               <remote-id type="github">lxdream/lxdream</remote-id>
+       </upstream>
 </pkgmetadata>

Reply via email to