sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (eb9e3d958a7d54aca18a9c4977339c17df25fa95)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (eb9e3d958a7d54aca18a9c4977339c17df25fa95)
- Date: Sat, 22 Aug 2026 23:54:07 +0000
GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:
emulators/bochs/BUILD
| 5
emulators/bochs/CONFIGURE
| 2
emulators/bochs/DEPENDS
| 12 +-
emulators/bochs/DETAILS
| 4
emulators/bochs/HISTORY
| 8 +
emulators/bochs/PRE_BUILD
| 3
emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
| 43 +++++++
emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
| 57 ++++++++++
8 files changed, 130 insertions(+), 4 deletions(-)
New commits:
commit eb9e3d958a7d54aca18a9c4977339c17df25fa95
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
bochs 3.0
diff --git a/emulators/bochs/BUILD b/emulators/bochs/BUILD
index 235131c..840c90c 100755
--- a/emulators/bochs/BUILD
+++ b/emulators/bochs/BUILD
@@ -18,4 +18,9 @@ OPTS="--with-x11 \
$BOCHS_OPTS \
$OPTS" &&
+case "$HOST" in
+ (*-musl)
+ OPTS+=' lt_cv_deplibs_check_method=pass_all' ;;
+esac &&
+
CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" default_build
diff --git a/emulators/bochs/CONFIGURE b/emulators/bochs/CONFIGURE
index 705749a..09d4a3a 100755
--- a/emulators/bochs/CONFIGURE
+++ b/emulators/bochs/CONFIGURE
@@ -7,7 +7,7 @@ config_query_option TERM "Add TERM (text mode display)
support in bochs?" y \
"--without-term" &&
config_query_option SB16 "Add SB16 support in bochs?" y \
- "--enable-sb16=linux" \
+ "--enable-sb16" \
"--disable-sb16" &&
config_query_option SMP "Compile support for SMP Configurations?" n \
diff --git a/emulators/bochs/DEPENDS b/emulators/bochs/DEPENDS
index 94161c5..ac98264 100755
--- a/emulators/bochs/DEPENDS
+++ b/emulators/bochs/DEPENDS
@@ -16,4 +16,14 @@ optional_depends svgalib
\
optional_depends readline \
"--enable-readline" \
"--disable-readline" \
- "Adds support for the readline library"
+ "Adds support for the readline library" &&
+
+optional_depends alsa-lib \
+ "" \
+ "" \
+ "Adds ALSA sound output support" &&
+
+optional_depends pulseaudio \
+ "" \
+ "" \
+ "Adds PulseAudio sound output support"
diff --git a/emulators/bochs/DETAILS b/emulators/bochs/DETAILS
index 0bc9a98..f72831d 100755
--- a/emulators/bochs/DETAILS
+++ b/emulators/bochs/DETAILS
@@ -1,6 +1,6 @@
SPELL=bochs
- VERSION=2.6.9
-
SOURCE_HASH=sha512:dfecf3a1bad07f06c2f7bb989d146e4a8eaeca493b598d415f5a4aec2a85eb5524ba417422157608c8b0828832611df487c6923c8f4ad98a147ac089fc514c46
+ VERSION=3.0
+
SOURCE_HASH=sha512:d7e67eff6193bdfa7f76821fbc6f69021348894eba230d88e22ee590eb7e2bf594ef6d13c0f343ae07905573205acfef2a0608d5db92ee411e7b9b1f033d6d70
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_URL[0]=http://downloads.sourceforge.net/sourceforge/$SPELL/$SOURCE
diff --git a/emulators/bochs/HISTORY b/emulators/bochs/HISTORY
index 27ea26b..a1f0a66 100644
--- a/emulators/bochs/HISTORY
+++ b/emulators/bochs/HISTORY
@@ -1,3 +1,11 @@
+2026-08-23 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS: updated spell to 3.0
+ *
patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch,
+ patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch,
+ BUILD, PRE_BUILD: fixed build against musl libc
+ * CONFIGURE: --enable-sb16 no longer takes a driver name
+ * DEPENDS: added optional alsa-lib and pulseaudio
+
2017-06-16 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: updated spell to 2.6.9
diff --git a/emulators/bochs/PRE_BUILD b/emulators/bochs/PRE_BUILD
new file mode 100755
index 0000000..c230ad1
--- /dev/null
+++ b/emulators/bochs/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git
a/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
b/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
new file mode 100644
index 0000000..6de61da
--- /dev/null
+++
b/emulators/bochs/patches/0001-Renaming-basename-function-to-bx_basename-should-fix.patch
@@ -0,0 +1,43 @@
+From d0b480f3c537cc23570885bdfdbcfcf819938f10 Mon Sep 17 00:00:00 2001
+From: Volker Ruppert <Volker.Ruppert AT t-online.de>
+Date: Thu, 17 Jul 2025 14:02:00 +0200
+Subject: [PATCH] Renaming basename function to bx_basename should fix
+ compilation issues.
+
+Upstream-Status: Backport [commit 2c4053709bbf]
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ bochs/gui/keymap.cc | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/gui/keymap.cc b/gui/keymap.cc
+index 3426b6b5694e..630f79d6820b 100644
+--- a/gui/keymap.cc
++++ b/gui/keymap.cc
+@@ -96,8 +96,7 @@ bx_keymap_c::~bx_keymap_c(void)
+ keymapCount = 0;
+ }
+
+-#if defined(WIN32) || defined(__ANDROID__)
+-char* basename(char *path)
++static char* bx_basename(char *path)
+ {
+ char *ptr;
+
+@@ -114,7 +113,6 @@ char* basename(char *path)
+ }
+ return ptr;
+ }
+-#endif
+
+ void bx_keymap_c::loadKeymap(const char *prefix, Bit32u
stringToSymbol(const char*))
+ {
+@@ -130,7 +128,7 @@ void bx_keymap_c::loadKeymap(const char *prefix, Bit32u
stringToSymbol(const cha
+ } else {
+ char *prefix2 = new char[strlen(prefix + 2)];
+ sprintf(prefix2, "%s-", prefix);
+- if (strncmp(prefix2, basename(keymap_file), strlen(prefix2))) {
++ if (strncmp(prefix2, bx_basename(keymap_file), strlen(prefix2))) {
+ BX_PANIC(("Keymap file not designed for this display library"));
+ }
+ delete [] prefix2;
diff --git
a/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
b/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
new file mode 100644
index 0000000..d1ba926
--- /dev/null
+++
b/emulators/bochs/patches/0002-Use-newterm-instead-of-reassigning-stdin-stdout.patch
@@ -0,0 +1,57 @@
+From 38e26b4e88724d431e7ab4aa3997e563d5a7a0cb Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <iluceno AT suse.de>
+Date: Sat, 22 Aug 2026 10:56:13 +0200
+Subject: [PATCH 2/2] Use newterm instead of reassigning stdin/stdout
+
+The BX_DEBUGGER_TERM path pointed curses at a freshly opened pty by
+assigning to stdin/stdout. glibc happens to declare those as plain
+'extern FILE *', but musl declares them 'FILE *const', so the build
+fails.
+
+C does not require the three standard streams to be modifiable lvalues
+at all.
+
+ncurses' newterm exists for exactly this: it takes the input and output
+FILE * explicitly. Using it removes the need to swap and restore the
+standard streams.
+
+The fdopen mode also had to change from "wr" to "w+": "wr" is not a
+valid mode string.
+
+Upstream-Status: Pending
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ bochs/gui/term.cc | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/gui/term.cc b/gui/term.cc
+index cf9f4cce0cac..4c94eb0f3322 100644
+--- a/gui/term.cc
++++ b/gui/term.cc
+@@ -186,21 +186,18 @@ void bx_term_gui_c::specific_init(int argc, char
**argv, unsigned headerbar_y)
+ // really ends up having fun
+ if (!strcmp(SIM->get_param_string(BXPN_LOG_FILENAME)->getptr(), "-"))
+ BX_PANIC(("cannot log to stderr in term mode"));
++ initscr();
+ #else
+- FILE *old_stdin = stdin;
+- FILE *old_stdout = stdout;
++ FILE *scr_fp = NULL;
+ scr_fd = open("/dev/ptmx",O_RDWR);
+ if(scr_fd > 0){
+- stdin = stdout = fdopen(scr_fd,"wr");
++ scr_fp = fdopen(scr_fd,"w+");
+ grantpt(scr_fd);
+ unlockpt(scr_fd);
+ fprintf(stderr, "\nBochs connected to screen \"%s\"\n",ptsname(scr_fd));
+ }
+-#endif
+- initscr();
+-#if BX_DEBUGGER_TERM
+- stdin = old_stdin;
+- stdout = old_stdout;
++ if (scr_fp == NULL || newterm(NULL, scr_fp, scr_fp) == NULL)
++ initscr();
+ #endif
+ start_color();
+ cbreak();
- [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (eb9e3d958a7d54aca18a9c4977339c17df25fa95), Ismael Luceno, 08/22/2026
Archive powered by MHonArc 2.6.24.