aboutsummaryrefslogtreecommitdiff
path: root/system/86box/86box.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/86box/86box.SlackBuild')
-rw-r--r--system/86box/86box.SlackBuild50
1 files changed, 34 insertions, 16 deletions
diff --git a/system/86box/86box.SlackBuild b/system/86box/86box.SlackBuild
index c859af6ace..d93cd66fd7 100644
--- a/system/86box/86box.SlackBuild
+++ b/system/86box/86box.SlackBuild
@@ -8,10 +8,8 @@
# Notes:
-# This thing uses the current directory for its config file. I thought
-# about patching it to use ~/.86box.cfg or ~/.config/86Box/86box.cfg,
-# but it might be considered a feature (create each VM in it own
-# directory, with its own 86box.cfg).
+# Version 4.x used to write the config file to the current directory.
+# Starting with 5.0, it stores configs in ~/.config/86box.
# We now have rtmidi in the repo. The build doesn't autodetect it and
# disable it if it's missing, we have to help it out with -DRTMIDI=OFF
@@ -23,9 +21,9 @@
# The other frontends are mac/windows only.
# Anyway, it has a nice Qt GUI, I don't see why it needs a frontend.
+# 20250829 bkw: update for v5.0.
# 20240925 bkw: update for v4.2.1.
# 20240812 bkw: update for v4.2.
-
# 20240311 bkw: update for v4.1.
# - submitted a build for rtmidi, so it's now supported here as an
# optional dep.
@@ -34,7 +32,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=86box
SRCNAM=86Box
-VERSION=${VERSION:-4.2.1}
+VERSION=${VERSION:-5.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -52,22 +50,43 @@ if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
exit 0
fi
+# 20250829 bkw: Starting with version 5.0, SSE2 is required at
+# runtime, for x86 and x86_64. If we're somehow building on an ancient
+# CPU that lacks SSE2, warn the user, but don't stop the build.
+# There is probably a way to patch it to build without SSE2 on x86,
+# but I'm not spending a lot of time to figure it out because I doubt
+# anyone really needs it.
+check_sse2() {
+ grep -q '\<sse2\>' /proc/cpuinfo && return
+ cat <<EOF
+
+********************************************************************
+* WARNING: 86box requires SSE2 extensions, but you are building on a
+* system without SSE2. If you install the resulting package on this
+* system, it will fail with "Illegal Instruction" errors.
+*
+* Press ^C within 5 seconds to abort the build, or wait 5 seconds to
+* continue.
+********************************************************************
+
+EOF
+ sleep 5
+}
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686 -msse2"
+ check_sse2
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686 -msse2"
+ check_sse2
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
fi
set -e
@@ -84,6 +103,7 @@ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
# 20240311 bkw: rtmidi still not autodetected in 4.1.
+# 20250829 bkw: or 5.0 either.
if [ "${RTMIDI:-yes}" != "yes" ] || ! pkg-config --exists rtmidi; then
RTMIDI="-DRTMIDI=OFF"
fi
@@ -92,11 +112,9 @@ mkdir -p build
cd build
cmake \
$RTMIDI \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_C_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DMAN_INSTALL_DIR=/usr/man \
-DCMAKE_BUILD_TYPE=Release ..
make
make install/strip DESTDIR=$PKG