diff --git a/games/vbam/README b/games/vbam/README index a300e865d2..940fe37e79 100644 --- a/games/vbam/README +++ b/games/vbam/README @@ -1,19 +1,36 @@ -vbam (cross-platform GameBoy emulator) +vbam (cross-platform gameboy/gbc/gba emulator) -VisualBoyAdvance-M is a Nintendo Game Boy Emulator with high compatibility -with commercial games. It emulates the Nintendo Game Boy Advance hand -held console, in addition to the original Game Boy hand held systems -and its Super and Color variants. VBA-M is a continued development of -the now inactive VisualBoy Advance project, with many improvements from -various developments of VBA. +VisualBoyAdvance-M is a Nintendo Game Boy Advance Emulator with high +compatibility with commercial games. It emulates the Nintendo Game Boy +Advance hand held console, in addition to the original Game Boy hand +held systems and its Super and Color variants. VBA-M is a continued +development of the now inactive VisualBoy Advance project, with many +improvements from various developments of VBA. -This application is the wxGTK GUI version of VisualBoyAdvance-M. The -name of the executable is "visualboyadvance-m". +The main executable is /usr/games/vbam, which is a command-line app +with no GUI controls. -FFMPEG=ON will enable recording and playback. It requires ffmpeg. +Optional dependencies: -There are a couple of alternatives on SBo you might try instead of this -VBAM SlackBuild: vbam-libretro, mgba, and/or libretro-mgba. +wxGTK3 - highly recommended, autodetected (can be disabled via +WX=no). This gives you a /usr/games/visualboyadvance-m executable that +has a modern graphical user interface, plus desktop integration. -Note: when upgrading from 2.0.2 to 2.1.0, you may have to "rm -rf -~/.vbam". Do this if vbam segfaults. +SFML - autodetected (can be disabled via SFML=no). Only required for +emulating the GBA Link cable. + +lirc - autodetected (can be disabled via LIRC=no). Allows using an +IR remote control to control the emulator. Only works with the SDL +user interface (the vbam executable). Untested by the SlackBuild +maintainer, as I don't own any lirc-compatible hardware. + +Notes: + +The config file (vbam.ini) is shared between the visualboyadvance-m +and vbam executables, and lives in ~/.config/visualboyadvance-m/ +(mentioned here because the man pages don't document this). When +upgrading versions, you might have to delete the config file if vbam +and/or visualboyadvance-m crash or act weird. + +There are a couple of alternatives on SBo you might try instead of +this vbam SlackBuild: mgba and/or higan. diff --git a/games/vbam/slack-desc b/games/vbam/slack-desc index 0c135c7c2e..1522178595 100644 --- a/games/vbam/slack-desc +++ b/games/vbam/slack-desc @@ -6,14 +6,14 @@ # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| -vbam: vbam (cross-platform GameBoy emulator) -vbam: -vbam: vbam is a project dedicated to gathering community patches to the -vbam: VisualBoyAdvance GameBoy emulator into one easily accessible project. -vbam: -vbam: Homepage: http://vba-m.com -vbam: -vbam: +vbam: vbam (cross-platform gameboy/gbc/gba emulator) vbam: +vbam: VisualBoyAdvance-M is a Nintendo Game Boy Advance Emulator with high +vbam: compatibility with commercial games. It emulates the Nintendo Game Boy +vbam: Advance hand held console, in addition to the original Game Boy hand +vbam: held systems and its Super and Color variants. VBA-M is a continued +vbam: development of the now inactive VisualBoy Advance project, with many +vbam: improvements from various developments of VBA. vbam: +vbam: Build options: wxGTK3=@WXYN@, lirc=@LIRCYN@, SFML=@SFYN@. vbam: diff --git a/games/vbam/vbam.SlackBuild b/games/vbam/vbam.SlackBuild index ba17cf9af8..205511dbf3 100644 --- a/games/vbam/vbam.SlackBuild +++ b/games/vbam/vbam.SlackBuild @@ -4,23 +4,32 @@ # Currently maintained by B. Watson . # Previously maintained by Dugan Chen . +# Modified by the SlackBuilds.org project. # Written by JK Wood . -# Slackbuild is released under the Dog-on-Fire License: -# If use of this script causes your dog to catch on fire, -# you agree to send me five dollars. Or a picture -# of the dog on fire. -# Otherwise, you're on your own. I've tested the script -# on my own computer, and it hasn't broken anything. -# So if it does it on your computer, that falls in -# the realm of "Not my problem." -# -# Of course, if you'll send a bug report to the above -# email address, I may be able to see what you did -# wrong and prevent it from happening in the future. -# In which case, I may just send YOU five dollars. +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. -# Modified by the SlackBuilds.org project. +# 20211117 bkw: note to self: there's been recent activity in +# upstream's git. If another 6-12 months goes by without a release, +# consider updating this for the latest git. + +# 20211117 bkw: BUILD=2 +# - fix build for -current and recent wxGTK3 update. +# - relicense as WTFPL with permission from JK Wood. +# - old-style icon symlink. +# - call executable with full path in .desktop. +# - add missing changelog/readme/todo to docdir. +# - get rid of FFMPEG option (it's always enabled now). +# - disable checking for updates (there haven't been any in +# 5 years anyway, and this is a bit of a privacy concern for +# some users). +# - make wxGTK3 optional. +# - only include .desktop and doinst in package if wxGTK3 enabled. +# - make SFML optional. it's actually autodetected in v2.1.4, +# so all this means is removing it from REQUIRES and adding +# a note to README. +# - always build the SDL UI executable (/usr/games/vbam). +# - include vbam.ini.sample in docdir. # 20191129 bkw: updated for 2.1.4. # 20180702 bkw: updated for 2.1.0. @@ -47,16 +56,13 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=vbam VERSION=${VERSION:-2.1.4} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} SRCVER="$VERSION" SRCNAM="visualboyadvance-m" -# Set to ON to enable FFMPEG A/V recording. -FFMPEG=${FFMPEG:-OFF} - if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; @@ -65,9 +71,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -110,7 +113,27 @@ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ # if both wx(Python|GTK) 2 and 3 are installed, /usr/bin/wx-config # is a symlink to the config for whichever was installed last. Avoid # confusion, force the correct version. -WXCONF=${WXCONF:-/usr/lib$LIBDIRSUFFIX/wx/config/gtk2-unicode-3.0} +# 20211117 bkw: willysr's wxGTK3 has switched from gtk2 to gtk3, so +# this line had to be adjusted slightly. With gtk2 this was failing +# to build on -current anyway... +WXCONF=${WXCONF:-/usr/lib$LIBDIRSUFFIX/wx/config/gtk3-unicode-3.0} + +# 20211117 bkw: upstream doesn't autodetect wx, we have to explicitly +# set it to ON or OFF. +WXDEF="-DENABLE_WX=OFF" +if [ "${WX:-yes}" = "yes" ]; then + [ -x "$WXCONF" ] && WXDEF="-DENABLE_WX=OFF -DwxWidgets_CONFIG_EXECUTABLE=$WXCONF" +fi + +# 20211117 bkw: lirc doesn't autodetect. +LIRCOPT=OFF +[ "${LIRC:-yes}" = "yes" ] && pkg-config --exists lirc && LIRCOPT=ON + +# 20211117 bkw: no handy -Dwhatever to disable this, surgery required. +# At first glance it looks like -DENABLE_LINK=OFF would work, but it +# doesn't: it disables the GBA Link emulation, but the vbam binaries +# still get linked with the SFML shared libs. Derp. +[ "${SFML:-yes}" = "no" ] && sed -i '/^find_package(SFML/d' CMakeLists.txt # upstream cleverly parses their own ChangeLog to get the version number # that gets compiled into the binary. They un-cleverly failed to follow @@ -118,18 +141,29 @@ WXCONF=${WXCONF:-/usr/lib$LIBDIRSUFFIX/wx/config/gtk2-unicode-3.0} # says 2.0.1 in its window title. So: sed -i '/\[2\.0\.2\]/s,Bug fix release,-,' CHANGELOG.md +# 20211117 bkw: fix the SDL UI build. +sed -i 's,KMOD_META,KMOD_ALT,g' src/sdl/SDL.cpp + +# 20211117 bkw: -fuse-ld=gold works, but doesn't speed things up much. + mkdir -p build cd build cmake \ - -DwxWidgets_CONFIG_EXECUTABLE=$WXCONF \ + -DENABLE_SDL=ON \ + "$WXDEF" \ + -DENABLE_LINK=$LINKOPT \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DENABLE_ASM_CORE=${ASM} \ -DENABLE_ASM_SCALERS=${ASM} \ - -DENABLE_FFMPEG=${FFMPEG} \ + -DENABLE_FFMPEG=ON \ + -DENABLE_ONLINEUPDATES=OFF \ + -DENABLE_LIRC=$LIRCOPT \ + -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=gold" \ + -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=gold" \ -DCMAKE_BUILD_TYPE=Release .. - make + make VERBOSE=1 sed -i \ -e 's,/usr/share/man,/usr/man,g' \ -e 's,/usr/bin,/usr/games,g' \ @@ -137,20 +171,47 @@ cd build make install DESTDIR=$PKG cd .. -strip $PKG/usr/games/$SRCNAM -ln -s $SRCNAM $PKG/usr/games/$PRGNAM - -gzip $PKG/usr/man/man6/$SRCNAM.6 -ln -s $SRCNAM.6.gz $PKG/usr/man/man6/$PRGNAM.6.gz - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -rm -f doc/ReadMe.MFC.txt # this is for Windows only -cp -a doc/* $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +strip $PKG/usr/games/* +gzip $PKG/usr/man/man6/$PRGNAM.6 mkdir -p $PKG/install -cat $CWD/slack-desc > $PKG/install/slack-desc -cat $CWD/doinst.sh > $PKG/install/doinst.sh + +if [ -x $PKG/usr/games/$SRCNAM ]; then + gzip $PKG/usr/man/man6/$SRCNAM.6 + + # in case someone's missing /usr/games from $PATH: + sed -i 's,^Exec=,&/usr/games/,' $PKG/usr/share/applications/*desktop + + # old-style windowmanagers might need this: + mkdir -p $PKG/usr/share/pixmaps + + ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png + + # only need the doinst.sh if the WX GUI was built. + cat $CWD/doinst.sh > $PKG/install/doinst.sh +fi + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +# This config file gets installed, but never actually used by vbam... +mv $PKG/etc/$PRGNAM.cfg $PKGDOC/$PRGNAM.cfg.sample +rmdir $PKG/etc +rm -f doc/ReadMe.MFC.txt # this is for Windows only +cp -a *.md doc/* $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +# 20211117 bkw: actually look at what we just built, to see what's +# enabled (instead of trusting that everything got included correctly). +# It's better to use objdump than ldd here IMO. +SFYN=no; LIRCYN=no; WXYN=no +objdump -p $PKG/usr/games/$PRGNAM | grep -q 'NEEDED *libsfml' && SFYN=yes +strings $PKG/usr/games/$PRGNAM | grep -q lircrc && LIRCYN=yes +[ -x $PKG/usr/games/$SRCNAM ] && WXYN=yes + +sed -e "s,@SFYN@,$SFYN," \ + -e "s,@LIRCYN@,$LIRCYN," \ + -e "s,@WXYN@,$WXYN," \ + $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/games/vbam/vbam.info b/games/vbam/vbam.info index e25af905d6..061e75b22c 100644 --- a/games/vbam/vbam.info +++ b/games/vbam/vbam.info @@ -5,6 +5,6 @@ DOWNLOAD="https://github.com/visualboyadvance-m/visualboyadvance-m/archive/v2.1. MD5SUM="394119c22b531bf0ca79ffc7717057d1" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="SFML wxGTK3" +REQUIRES="" MAINTAINER="B. Watson" EMAIL="yalhcru@gmail.com"