summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2019-12-02 18:02:30 +0100
committer Willy Sudiarto Raharjo2019-12-15 11:06:25 +0100
commit215c2437e16488fb61411c13be3b262bd75d9d0a (patch)
tree100c632f9f9719b1ca0b7ea7b8a7687690dbb3f9
parent3fe1fcb4acac74aa552e98e5f8f7089188c15c7a (diff)
downloadslackbuilds-215c2437e16488fb61411c13be3b262bd75d9d0a.tar.gz
games/snes9x: Updated for version 1.60.
Signed-off-by: B. Watson <yalhcru@gmail.com>
-rw-r--r--games/snes9x/README_docs.txt4
-rw-r--r--games/snes9x/fix_config_file_segfaults.diff28
-rw-r--r--games/snes9x/libretro.diff104
-rw-r--r--games/snes9x/libretro_lto_variable.diff112
-rw-r--r--games/snes9x/snes9x.SlackBuild95
-rw-r--r--games/snes9x/snes9x.info8
6 files changed, 32 insertions, 319 deletions
diff --git a/games/snes9x/README_docs.txt b/games/snes9x/README_docs.txt
deleted file mode 100644
index 35702296fd..0000000000
--- a/games/snes9x/README_docs.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains the documentation for the original snes9x (the
-non-GTK+ version). Not all of the information here applies to snes9x_gtk,
-but some of it may still be useful... and the various licenses still
-apply.
diff --git a/games/snes9x/fix_config_file_segfaults.diff b/games/snes9x/fix_config_file_segfaults.diff
deleted file mode 100644
index b67f14befd..0000000000
--- a/games/snes9x/fix_config_file_segfaults.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/gtk/src/gtk_config.cpp b/gtk/src/gtk_config.cpp
-index bf06de7..1ccd4f2 100644
---- a/gtk/src/gtk_config.cpp
-+++ b/gtk/src/gtk_config.cpp
-@@ -463,9 +463,9 @@ int Snes9xConfig::load_config_file ()
- return -1;
-
- std::string none;
--#define inbool(key, var) var = cf.GetBool (key)
--#define inint(key, var) var = cf.GetInt (key)
--#define infloat(key, var) var = atof (cf.GetString (key, none).c_str())
-+#define inbool(key, var) { if (cf.Exists (key)) var = cf.GetBool (key); }
-+#define inint(key, var) { if (cf.Exists(key)) var = cf.GetInt (key); }
-+#define infloat(key, var) { if (cf.Exists(key)) var = atof (cf.GetString (key, none).c_str()); }
- #define instr(key, var) strcpy (var, cf.GetString (key, none).c_str())
-
- #undef z
-@@ -683,8 +683,8 @@ int Snes9xConfig::load_config_file ()
- hires_effect = CLAMP (hires_effect, 0, 2);
- Settings.DynamicRateLimit = CLAMP (Settings.DynamicRateLimit, 1, 1000);
- Settings.SuperFXClockMultiplier = CLAMP (Settings.SuperFXClockMultiplier, 50, 400);
-- ntsc_scanline_intensity = MAX (ntsc_scanline_intensity, 4);
-- scanline_filter_intensity = MAX (scanline_filter_intensity, 3);
-+ ntsc_scanline_intensity = CLAMP (ntsc_scanline_intensity, 0, 4);
-+ scanline_filter_intensity = CLAMP (scanline_filter_intensity, 0, 3);
-
- return 0;
- }
diff --git a/games/snes9x/libretro.diff b/games/snes9x/libretro.diff
deleted file mode 100644
index 8808654ed8..0000000000
--- a/games/snes9x/libretro.diff
+++ /dev/null
@@ -1,104 +0,0 @@
-From abb4b4c39f75716c4e29017005996da9b3ad4d12 Mon Sep 17 00:00:00 2001
-From: Brandon Wright <bearoso@gmail.com>
-Date: Sat, 28 Jul 2018 15:59:15 -0500
-Subject: [PATCH] Use Snes9x aliases instead of stdint types here.
-
----
- apu/apu.cpp | 38 +++++++++++++++++++-------------------
- 1 file changed, 19 insertions(+), 19 deletions(-)
-
-diff --git a/apu/apu.cpp b/apu/apu.cpp
-index 50dec00f..63a35392 100644
---- a/apu/apu.cpp
-+++ b/apu/apu.cpp
-@@ -783,7 +783,7 @@ static void to_var_from_buf (uint8 **buf, void *var, size_t size)
- }
-
- #undef IF_0_THEN_256
--#define IF_0_THEN_256( n ) ((uint8_t) ((n) - 1) + 1)
-+#define IF_0_THEN_256( n ) ((uint8) ((n) - 1) + 1)
- void S9xAPULoadBlarggState(uint8 *oldblock)
- {
- uint8 *ptr = oldblock;
-@@ -792,26 +792,26 @@ void S9xAPULoadBlarggState(uint8 *oldblock)
-
- copier.copy(SNES::smp.apuram,0x10000); // RAM
-
-- uint8_t regs_in [0x10];
-- uint8_t regs [0x10];
-- uint16_t pc, spc_time, dsp_time;
-- uint8_t a,x,y,psw,sp;
-+ uint8 regs_in [0x10];
-+ uint8 regs [0x10];
-+ uint16 pc, spc_time, dsp_time;
-+ uint8 a,x,y,psw,sp;
-
- copier.copy(regs,0x10); // REGS
- copier.copy(regs_in,0x10); // REGS_IN
-
- // CPU Regs
-- pc = copier.copy_int( 0, sizeof(uint16_t) );
-- a = copier.copy_int( 0, sizeof(uint8_t) );
-- x = copier.copy_int( 0, sizeof(uint8_t) );
-- y = copier.copy_int( 0, sizeof(uint8_t) );
-- psw = copier.copy_int( 0, sizeof(uint8_t) );
-- sp = copier.copy_int( 0, sizeof(uint8_t) );
-+ pc = copier.copy_int( 0, sizeof(uint16) );
-+ a = copier.copy_int( 0, sizeof(uint8) );
-+ x = copier.copy_int( 0, sizeof(uint8) );
-+ y = copier.copy_int( 0, sizeof(uint8) );
-+ psw = copier.copy_int( 0, sizeof(uint8) );
-+ sp = copier.copy_int( 0, sizeof(uint8) );
- copier.extra();
-
- // times
-- spc_time = copier.copy_int( 0, sizeof(uint16_t) );
-- dsp_time = copier.copy_int( 0, sizeof(uint16_t) );
-+ spc_time = copier.copy_int( 0, sizeof(uint16) );
-+ dsp_time = copier.copy_int( 0, sizeof(uint16) );
-
- int cur_time = S9xAPUGetClock(CPU.Cycles);
-
-@@ -824,14 +824,14 @@ void S9xAPULoadBlarggState(uint8 *oldblock)
- SNES::dsp.load_state(&ptr);
-
- // Timers
-- uint16_t next_time[3];
-- uint8_t divider[3], counter[3];
-+ uint16 next_time[3];
-+ uint8 divider[3], counter[3];
- for ( int i = 0; i < 3; i++ )
- {
-- next_time[i] = copier.copy_int( 0, sizeof(uint16_t) );
-- divider[i] = copier.copy_int( 0, sizeof(uint8_t) );
-- counter[i] = copier.copy_int( 0, sizeof(uint8_t) );
-- copier.extra();
-+ next_time[i] = copier.copy_int( 0, sizeof(uint16) );
-+ divider[i] = copier.copy_int( 0, sizeof(uint8) );
-+ counter[i] = copier.copy_int( 0, sizeof(uint8) );
-+ copier.extra();
- }
- // construct timers out of available parts from blargg smp
- SNES::smp.timer0.enable = regs[1] >> 0 & 1; // regs[1] = CONTROL
-From a77b3b379b06e5e09723f65b63c9a045c71c3030 Mon Sep 17 00:00:00 2001
-From: orbea <orbea@fredslev.dk>
-Date: Sat, 28 Jul 2018 15:48:08 -0700
-Subject: [PATCH] One moreSnes9x alias instead of stdint type.
-
----
- spc7110dec.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/spc7110dec.cpp b/spc7110dec.cpp
-index 6cc28670..ab7521b3 100644
---- a/spc7110dec.cpp
-+++ b/spc7110dec.cpp
-@@ -498,7 +498,7 @@ void SPC7110Decomp::reset() {
- }
-
- SPC7110Decomp::SPC7110Decomp() {
-- decomp_buffer = new uint8_t[decomp_buffer_size];
-+ decomp_buffer = new uint8[decomp_buffer_size];
- reset();
-
- //initialize reverse morton lookup tables
diff --git a/games/snes9x/libretro_lto_variable.diff b/games/snes9x/libretro_lto_variable.diff
deleted file mode 100644
index d2f0f5a4e8..0000000000
--- a/games/snes9x/libretro_lto_variable.diff
+++ /dev/null
@@ -1,112 +0,0 @@
-diff --git a/libretro/Makefile b/libretro/Makefile
-index c0311b1..dd55ffd 100644
---- a/libretro/Makefile
-+++ b/libretro/Makefile
-@@ -2,6 +2,7 @@ DEBUG = 0
- HAVE_EXCEPTIONS = 0
- HAVE_STRINGS_H = 1
-
-+LTO ?= -flto
- SPACE :=
- SPACE := $(SPACE) $(SPACE)
- BACKSLASH :=
-@@ -45,9 +46,9 @@ endif
-
- # Unix
- ifneq (,$(findstring unix,$(platform)))
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- TARGET := $(TARGET_NAME)_libretro.so
- fpic := -fPIC
- ifneq ($(findstring SunOS,$(shell uname -a)),)
-@@ -70,9 +71,9 @@ ifneq (,$(findstring unix,$(platform)))
-
- # OS X
- else ifeq ($(platform), osx)
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- TARGET := $(TARGET_NAME)_libretro.dylib
- fpic := -fPIC
- SHARED := -dynamiclib
-@@ -102,9 +103,9 @@ else ifeq ($(platform), libnx)
-
- # iOS
- else ifneq (,$(findstring ios,$(platform)))
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- TARGET := $(TARGET_NAME)_libretro_ios.dylib
- fpic := -fPIC
- SHARED := -dynamiclib
-@@ -134,9 +135,9 @@ else ifneq (,$(findstring ios,$(platform)))
-
- # Theos
- else ifeq ($(platform), theos_ios)
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- DEPLOYMENT_IOSVERSION = 5.0
- TARGET = iphone:latest:$(DEPLOYMENT_IOSVERSION)
- ARCHS = armv7 armv7s
-@@ -159,9 +160,9 @@ else ifeq ($(platform), qnx)
-
- # Vita
- else ifeq ($(platform), vita)
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- TARGET := $(TARGET_NAME)_libretro_$(platform).so
- fpic := -fPIC
- CC = arm-vita-eabi-gcc$(EXE_EXT)
-@@ -199,9 +200,9 @@ else ifneq (,$(filter $(platform), ps3 sncps3 psl1ght))
-
- # Xbox 360
- else ifeq ($(platform), xenon)
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- TARGET := $(TARGET_NAME)_libretro_xenon360.a
- CC = xenon-gcc$(EXE_EXT)
- CXX = xenon-g++$(EXE_EXT)
-@@ -465,9 +466,9 @@ CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
- CXXFLAGS += -D_CRT_SECURE_NO_DEPRECATE
- # Windows
- else
-- CFLAGS += -flto
-- CXXFLAGS += -flto
-- LDFLAGS += -flto
-+ CFLAGS += $(LTO)
-+ CXXFLAGS += $(LTO)
-+ LDFLAGS += $(LTO)
- TARGET := $(TARGET_NAME)_libretro.dll
- CC = gcc
- CXX = g++
-@@ -569,7 +570,7 @@ $(TARGET): $(OBJECTS)
- ifeq ($(STATIC_LINKING), 1)
- $(AR) rcs $@ $(OBJECTS)
- else
-- $(LD) $(fpic) $(SHARED) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
-+ +$(LD) $(fpic) $(SHARED) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
- endif
-
- %.o: %.cpp
diff --git a/games/snes9x/snes9x.SlackBuild b/games/snes9x/snes9x.SlackBuild
index c00c1ce2b3..ace53f9636 100644
--- a/games/snes9x/snes9x.SlackBuild
+++ b/games/snes9x/snes9x.SlackBuild
@@ -6,12 +6,16 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20191126 bkw: update for 1.60. Upstream has switched from autotools
+# to meson for the build system, so this script can no longer build
+# old versions.
+
# 20181201 bkw:
# - update for 1.57.
# - disable OSS audio by default, add OSS=yes option.
# - autodetect RetroArch, add RETROARCH=yes|no option.
# - document the above in the README.
-# - document PULSE=no io README.
+# - document PULSE=no in README.
# - stop including snes9x.conf.default in the docdir, since it's
# outdated and will cause snes9x to segfault if you try to use it!
# - since we now have 3 build options, make slack-desc show them.
@@ -53,7 +57,7 @@
# can't build 1.53 any more.
PRGNAM=snes9x
-VERSION=${VERSION:-1.57}
+VERSION=${VERSION:-1.60}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -99,67 +103,38 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-# Various patches, depending on the version we're building. Currently
-# this script should work with 1.56.2 and 1.57. Anything older and you're
-# on your own.
-
-# For 1.56.2, libretro.diff fixes the libretro build, it's upstream's
-# commits abb4b4c39 and a77b3b379b. Already included in 1.57.
-
-# For 1.57 (and 1.56.2 I hope), fix_config_file_segfaults.diff is
-# upstream's commit 5e9f068. libretro_lto_variable is 21d6275 (thanks
-# to orbea for coding this one & sending it upstream, based on my vague
-# idea). Future 1.57.x or 1.58 will include these already.
-
-# At some point, this set of cases will be too complex for me to want to
-# maintain & test it, and it'll go away (this script will only support
-# the latest version, whatever that happens to be).
-
-case "$VERSION" in
- 1.5[0-5]*|1.[0-4]*) ;; # doubt these build anyway
- 1.56.2) PATCHES="libretro" ;;
- 1.57) PATCHES="fix_config_file_segfaults libretro_lto_variable";;
- *) ;;
-esac
-
-[ -n "$PATCHES" ] && for p in $PATCHES; do
- [ -e "$CWD/$p.diff" ] && patch -p1 < "$CWD/$p.diff"
-done
-
cd gtk
-./autogen.sh
WITHPULSE=yes
if [ "$PULSE" = "no" ] || ! pkg-config --exists libpulse; then
- PULSEOPT="--without-pulseaudio"
+ PULSEOPT="-D pulseaudio=false"
WITHPULSE=no
fi
WITHOSS=yes
if [ "${OSS:-no}" = "no" ]; then
- OSSOPT="--without-oss"
+ OSSOPT="-D oss=false"
WITHOSS=no
fi
-CFLAGS="-g $SLKCFLAGS" \
-CXXFLAGS="-g $SLKCFLAGS" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --bindir=/usr/games \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-netplay \
- --without-system-zip \
- --with-gtk2 \
- --without-gtk3 \
- --without-portaudio \
- $PULSEOPT \
- $OSSOPT \
- --build=$ARCH-slackware-linux
-
-make
-make install DESTDIR=$PKG
+mkdir build
+cd build
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ meson .. \
+ $PULSEOPT $OSSOPT \
+ -D gtk3=false -D gtk2=true \
+ --buildtype=release \
+ --infodir=/usr/info \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --prefix=/usr \
+ --sysconfdir=/etc
+ ninja
+ DESTDIR=$PKG ninja install
+ mv $PKG/usr/bin $PKG/usr/games
+cd ..
# RetroArch support, contributed by orbea (Hunter Sezen).
# Note that the source here is self-contained, there's no build-time
@@ -201,24 +176,10 @@ ln -s $PRGNAM-gtk.6.gz $PKG/usr/man/man6/$PRGNAM.6.gz
ln -s $PRGNAM-gtk $PKG/usr/games/$PRGNAM
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
-OLDDOC=$PKGDOC/${PRGNAM}_original_docs
-mkdir -p $OLDDOC
-rm -f ../docs/snes9x.conf.default # outdated, useless
-cp -a doc/* $PKGDOC
-cp -a ../docs/* $OLDDOC
-cat $CWD/README_docs.txt > $PKGDOC/README_docs.txt
+mkdir -p $PKGDOC
+cp -a ../LICENSE ../README* ../docs/* $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
-# We don't need 3 copies of the LGPL v2.1 (we already have the GPL
-# and proprietary snes9x licenses...)
-cd $PKGDOC
- rm -f snes_ntsc_license.txt ${PRGNAM}_original_docs/lgpl-2.1.txt
- ln -s lgpl.txt snes_ntsc_license.txt
- ln -s ../lgpl.txt ${PRGNAM}_original_docs/lgpl-2.1.txt
-cd -
-
-cat data/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
-
mkdir -p $PKG/install
sed -e "s,@WITHPULSE@,$WITHPULSE," \
-e "s,@WITHOSS@,$WITHOSS," \
diff --git a/games/snes9x/snes9x.info b/games/snes9x/snes9x.info
index da8405ae11..efa5c1ac1f 100644
--- a/games/snes9x/snes9x.info
+++ b/games/snes9x/snes9x.info
@@ -1,10 +1,10 @@
PRGNAM="snes9x"
-VERSION="1.57"
+VERSION="1.60"
HOMEPAGE="https://github.com/snes9xgit/snes9x"
-DOWNLOAD="https://github.com/snes9xgit/snes9x/archive/1.57/snes9x-1.57.tar.gz"
-MD5SUM="881b740d08a7d42d4a33dee962dcdbdc"
+DOWNLOAD="https://github.com/snes9xgit/snes9x/archive/1.60/snes9x-1.60.tar.gz"
+MD5SUM="1e0d5d5209b8018080bca0aa5da02dff"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="SDL2"
+REQUIRES="SDL2 meson"
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"