summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
author Dugan Chen <thedoogster [at] gmail [dot] com>2015-07-22 14:43:59 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2015-07-22 14:43:59 +0700
commit2bb19437d643249a51cf3971945c29db0bb53442 (patch)
treeb50ff7db3e4e8232c8668e8eec0e7c30ab395583 /games
parent369b96c1da3137d2ae200fbc65310877aed011b1 (diff)
downloadslackbuilds-2bb19437d643249a51cf3971945c29db0bb53442.tar.gz
slackbuilds-2bb19437d643249a51cf3971945c29db0bb53442.tar.xz
games/mgba: Added (Game Boy Advance emulator).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r--games/mgba/README10
-rw-r--r--games/mgba/correct_libdir.patch33
-rw-r--r--games/mgba/mgba.SlackBuild100
-rw-r--r--games/mgba/mgba.info10
-rw-r--r--games/mgba/slack-desc19
5 files changed, 172 insertions, 0 deletions
diff --git a/games/mgba/README b/games/mgba/README
new file mode 100644
index 0000000000..71b0ed148c
--- /dev/null
+++ b/games/mgba/README
@@ -0,0 +1,10 @@
+mGBA is an emulator for running Game Boy Advance games. It aims to be
+faster and more accurate than many existing Game Boy Advance
+emulators, as well as adding features that other emulators lack.
+
+Optional dependencies are:
+
+* qt5 (for the GUI)
+* SDL2
+* libedit (for the command-line debugger)
+* ffmpeg
diff --git a/games/mgba/correct_libdir.patch b/games/mgba/correct_libdir.patch
new file mode 100644
index 0000000000..582d94f38e
--- /dev/null
+++ b/games/mgba/correct_libdir.patch
@@ -0,0 +1,33 @@
+diff -rupN mgba-0.2.1.orig/CMakeLists.txt mgba-0.2.1/CMakeLists.txt
+--- mgba-0.2.1.orig/CMakeLists.txt 2015-05-13 22:07:20.000000000 -0700
++++ mgba-0.2.1/CMakeLists.txt 2015-07-19 16:17:46.572058303 -0700
+@@ -37,7 +37,11 @@ if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (e.g. Release or Debug)" FORCE)
+ endif()
+
+-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
++if (NOT DEFINED LIBDIR)
++ set(LIBDIR "lib")
++endif()
++
++set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR}")
+
+ include(GNUInstallDirs)
+
+@@ -322,14 +326,14 @@ if(BUILD_SHARED)
+ if(BUILD_STATIC)
+ add_library(${BINARY_NAME}-static STATIC ${SRC})
+ set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${FEATURE_DEFINES}")
+- install(TARGETS ${BINARY_NAME}-static DESTINATION lib COMPONENT lib${BINARY_NAME})
++ install(TARGETS ${BINARY_NAME}-static DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
+ endif()
+ else()
+ add_library(${BINARY_NAME} STATIC ${SRC})
+ endif()
+
+ target_link_libraries(${BINARY_NAME} m ${DEBUGGER_LIB} ${OS_LIB} ${DEPENDENCY_LIB})
+-install(TARGETS ${BINARY_NAME} DESTINATION lib COMPONENT lib${BINARY_NAME})
++install(TARGETS ${BINARY_NAME} DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME})
+ set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${FEATURE_DEFINES}")
+
+ if(BUILD_LIBRETRO)
diff --git a/games/mgba/mgba.SlackBuild b/games/mgba/mgba.SlackBuild
new file mode 100644
index 0000000000..51eee66448
--- /dev/null
+++ b/games/mgba/mgba.SlackBuild
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+# Slackware build script for mgba
+
+# Copyright 2015 Dugan Chen Canada
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=mgba
+VERSION=${VERSION:-0.2.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+
+# Install libraries into the correct directories.
+patch -p1 --verbose < $CWD/correct_libdir.patch
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIBDIR=lib$LIBDIRSUFFIX \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make
+ make install DESTDIR=$PKG
+cd ..
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CHANGES LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+rm -rf $PKG/usr/share
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/games/mgba/mgba.info b/games/mgba/mgba.info
new file mode 100644
index 0000000000..bd0e373af7
--- /dev/null
+++ b/games/mgba/mgba.info
@@ -0,0 +1,10 @@
+PRGNAM="mgba"
+VERSION="0.2.1"
+HOMEPAGE="https://endrift.com/mgba/"
+DOWNLOAD="https://github.com/mgba-emu/mgba/archive/0.2.1.tar.gz"
+MD5SUM="7138c88638baeabe20aa05805b862698"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="%README%"
+MAINTAINER="Dugan Chen"
+EMAIL="thedoogster [at] gmail [dot] com"
diff --git a/games/mgba/slack-desc b/games/mgba/slack-desc
new file mode 100644
index 0000000000..a81e26b2eb
--- /dev/null
+++ b/games/mgba/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+mgba: mgba (Game Boy Advance emulator)
+mgba:
+mgba: mGBA is an emulator for running Game Boy Advance games. It aims to be
+mgba: faster and more accurate than many existing Game Boy Advance
+mgba: emulators, as well as adding features that other emulators lack.
+mgba:
+mgba:
+mgba:
+mgba:
+mgba:
+mgba: