summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2019-06-08 22:46:03 +0000
committernia <nia@pkgsrc.org>2019-06-08 22:46:03 +0000
commitbd353538c205d571d8f63ea5e1d0746b34c470a2 (patch)
treebe10d6f7f23fdd6bf1ab0c1869fe3f87b99fdfae /emulators
parentbd8b8e5cf196675d8c36916a99ed6103a1ad8f9f (diff)
downloadpkgsrc-bd353538c205d571d8f63ea5e1d0746b34c470a2.tar.gz
Add emulators/mgba version 0.7.2.
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. It also supports Game Boy and Game Boy Color games.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/Makefile3
-rw-r--r--emulators/mgba/DESCR5
-rw-r--r--emulators/mgba/MESSAGE.NetBSD7
-rw-r--r--emulators/mgba/Makefile29
-rw-r--r--emulators/mgba/PLIST55
-rw-r--r--emulators/mgba/distinfo10
-rw-r--r--emulators/mgba/options.mk48
-rw-r--r--emulators/mgba/patches/patch-CMakeLists.txt17
-rw-r--r--emulators/mgba/patches/patch-include_mgba-util_math.h22
-rw-r--r--emulators/mgba/patches/patch-include_mgba-util_platform_posix_threading.h15
-rw-r--r--emulators/mgba/patches/patch-version.cmake22
11 files changed, 232 insertions, 1 deletions
diff --git a/emulators/Makefile b/emulators/Makefile
index a3e965e3206..ecd68922566 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.295 2019/03/21 13:58:55 wiz Exp $
+# $NetBSD: Makefile,v 1.296 2019/06/08 22:46:03 nia Exp $
#
COMMENT= Emulators for other operating systems
@@ -138,6 +138,7 @@ SUBDIR+= m1
SUBDIR+= makeppf
SUBDIR+= mame
SUBDIR+= mednafen
+SUBDIR+= mgba
SUBDIR+= minivmac
SUBDIR+= mmix
SUBDIR+= nestopia
diff --git a/emulators/mgba/DESCR b/emulators/mgba/DESCR
new file mode 100644
index 00000000000..3208573c427
--- /dev/null
+++ b/emulators/mgba/DESCR
@@ -0,0 +1,5 @@
+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.
+
+It also supports Game Boy and Game Boy Color games.
diff --git a/emulators/mgba/MESSAGE.NetBSD b/emulators/mgba/MESSAGE.NetBSD
new file mode 100644
index 00000000000..d3f5c169dbb
--- /dev/null
+++ b/emulators/mgba/MESSAGE.NetBSD
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE.NetBSD,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+Lowering the system audio latency (or blk_ms) with sysctl(8) may be
+required to achieve full performance and framerates.
+
+===========================================================================
diff --git a/emulators/mgba/Makefile b/emulators/mgba/Makefile
new file mode 100644
index 00000000000..f25a11b027d
--- /dev/null
+++ b/emulators/mgba/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD: Makefile,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+DISTNAME= mgba-0.7.2
+CATEGORIES= emulators
+MASTER_SITES= ${MASTER_SITE_GITHUB:=mgba-emu/}
+
+MAINTAINER= nia@NetBSD.org
+HOMEPAGE= https://mgba.io/
+COMMENT= Emulator for running Game Boy Advance games
+LICENSE= mpl-2.0
+
+EXTRACT_USING= bsdtar
+USE_TOOLS+= pkg-config
+USE_CMAKE= yes
+USE_LANGUAGES= c c++
+
+# using libzip
+CMAKE_ARGS+= -DUSE_MINIZIP=OFF
+
+.include "options.mk"
+.include "../../archivers/libzip/buildlink3.mk"
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../devel/libelf/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/mgba/PLIST b/emulators/mgba/PLIST
new file mode 100644
index 00000000000..2431aa9aee0
--- /dev/null
+++ b/emulators/mgba/PLIST
@@ -0,0 +1,55 @@
+@comment $NetBSD: PLIST,v 1.1 2019/06/08 22:46:03 nia Exp $
+bin/mgba
+${PLIST.qt}bin/mgba-qt
+include/mgba/flags.h
+lib/libmgba.so.0.7
+lib/libmgba.so.${PKGVERSION}
+${PLIST.qt}man/man6/mgba-qt.6
+man/man6/mgba.6
+${PLIST.qt}share/applications/mgba-qt.desktop
+share/doc/mGBA/CHANGES
+share/doc/mGBA/LICENSE
+share/doc/mGBA/README.md
+share/doc/mGBA/README_DE.md
+share/doc/mGBA/licenses/blip_buf.txt
+share/doc/mGBA/licenses/inih.txt
+share/icons/hicolor/128x128/apps/mgba.png
+share/icons/hicolor/16x16/apps/mgba.png
+share/icons/hicolor/24x24/apps/mgba.png
+share/icons/hicolor/256x256/apps/mgba.png
+share/icons/hicolor/32x32/apps/mgba.png
+share/icons/hicolor/48x48/apps/mgba.png
+share/icons/hicolor/512x512/apps/mgba.png
+share/icons/hicolor/64x64/apps/mgba.png
+share/icons/hicolor/96x96/apps/mgba.png
+${PLIST.qt}share/mgba/nointro.dat
+${PLIST.shaders}share/mgba/shaders/agb001.shader/agb001.fs
+${PLIST.shaders}share/mgba/shaders/agb001.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/ags001.shader/ags001-light.fs
+${PLIST.shaders}share/mgba/shaders/ags001.shader/ags001.fs
+${PLIST.shaders}share/mgba/shaders/ags001.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/fish.shader/fish.fs
+${PLIST.shaders}share/mgba/shaders/fish.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/gba-color.shader/gba-color.fs
+${PLIST.shaders}share/mgba/shaders/gba-color.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/lcd.shader/lcd.fs
+${PLIST.shaders}share/mgba/shaders/lcd.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/motion_blur.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/motion_blur.shader/motion_blur.fs
+${PLIST.shaders}share/mgba/shaders/pixelate.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/scanlines.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/scanlines.shader/scanlines.fs
+${PLIST.shaders}share/mgba/shaders/soften.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/soften.shader/soften.fs
+${PLIST.shaders}share/mgba/shaders/vba_pixelate.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/vba_pixelate.shader/vba_pixelate.fs
+${PLIST.shaders}share/mgba/shaders/vignette.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/vignette.shader/vignette.fs
+${PLIST.shaders}share/mgba/shaders/wiiu.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/wiiu.shader/wiiu.fs
+${PLIST.shaders}share/mgba/shaders/xbr-lv2.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/xbr-lv2.shader/xbr.fs
+${PLIST.shaders}share/mgba/shaders/xbr-lv2.shader/xbr.vs
+${PLIST.shaders}share/mgba/shaders/xbr-lv3.shader/manifest.ini
+${PLIST.shaders}share/mgba/shaders/xbr-lv3.shader/xbr.fs
+${PLIST.shaders}share/mgba/shaders/xbr-lv3.shader/xbr.vs
diff --git a/emulators/mgba/distinfo b/emulators/mgba/distinfo
new file mode 100644
index 00000000000..80d1339ae9d
--- /dev/null
+++ b/emulators/mgba/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+SHA1 (mgba-0.7.2.tar.gz) = 342b40efa743f9966ad0e9d3448a8d3f4314c008
+RMD160 (mgba-0.7.2.tar.gz) = 0ad8a97d1307bad71b13d12ee0d8c7bbb2599117
+SHA512 (mgba-0.7.2.tar.gz) = e63519299358ef73939d07012cd6880478d4e5b1e6161c42bcbe36e5207af3dcbe4c147fd1a94432ddbe5fbdf5d2c9755d90984ea800bf9d9860d7f806f996cd
+Size (mgba-0.7.2.tar.gz) = 11255680 bytes
+SHA1 (patch-CMakeLists.txt) = f0b106e75cd2697fe81c7b962159cfa5ed4c6681
+SHA1 (patch-include_mgba-util_math.h) = 448ca1bb3bbe2812e7d9482917c488ddcf3b48f0
+SHA1 (patch-include_mgba-util_platform_posix_threading.h) = c5c737be68340e3571934d43bf0c6eab8bc34978
+SHA1 (patch-version.cmake) = 7d6d44febe7bb0ff2231452f037def7cb3782e21
diff --git a/emulators/mgba/options.mk b/emulators/mgba/options.mk
new file mode 100644
index 00000000000..0ce468a7790
--- /dev/null
+++ b/emulators/mgba/options.mk
@@ -0,0 +1,48 @@
+# $NetBSD: options.mk,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.mgba
+
+PKG_SUPPORTED_OPTIONS+= ffmpeg imagemagick qt5 opengl
+PKG_SUGGESTED_OPTIONS+= ffmpeg imagemagick qt5 opengl
+
+PLIST_VARS+= qt shaders
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mffmpeg)
+CMAKE_ARGS+= -DUSE_FFMPEG=ON
+.include "../../multimedia/ffmpeg4/buildlink3.mk"
+.else
+CMAKE_ARGS+= -DUSE_FFMPEG=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mimagemagick)
+CMAKE_ARGS+= -DUSE_MAGICK=ON
+.include "../../graphics/ImageMagick/buildlink3.mk"
+.else
+CMAKE_ARGS+= -DUSE_MAGICK=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mqt5)
+PLIST.qt= yes
+CMAKE_ARGS+= -DBUILD_QT=ON
+.include "../../x11/qt5-qtbase/buildlink3.mk"
+.include "../../x11/qt5-qtmultimedia/buildlink3.mk"
+.include "../../x11/qt5-qttools/buildlink3.mk"
+.else
+CMAKE_ARGS+= -DBUILD_QT=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mopengl)
+CMAKE_ARGS+= -DBUILD_GL=ON
+CMAKE_ARGS+= -DUSE_EPOXY=ON
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../graphics/libepoxy/buildlink3.mk"
+.else
+CMAKE_ARGS+= -DBUILD_GL=OFF
+CMAKE_ARGS+= -DUSE_EPOXY=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mopengl) && !empty(PKG_OPTIONS:Mqt5)
+PLIST.shaders= yes
+.endif
diff --git a/emulators/mgba/patches/patch-CMakeLists.txt b/emulators/mgba/patches/patch-CMakeLists.txt
new file mode 100644
index 00000000000..8b00c580bb9
--- /dev/null
+++ b/emulators/mgba/patches/patch-CMakeLists.txt
@@ -0,0 +1,17 @@
+$NetBSD: patch-CMakeLists.txt,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+Fix locale detection.
+
+--- CMakeLists.txt.orig 2019-02-25 01:33:16.000000000 +0000
++++ CMakeLists.txt
+@@ -391,7 +391,9 @@ if(HAVE_LOCALTIME_R)
+ list(APPEND FUNCTION_DEFINES HAVE_LOCALTIME_R)
+ endif()
+
+-if(HAVE_NEWLOCALE AND HAVE_FREELOCALE AND HAVE_USELOCALE OR APPLE)
++check_include_files("locale.h" HAVE_LOCALE)
++
++if(HAVE_LOCALE OR APPLE)
+ list(APPEND FUNCTION_DEFINES HAVE_LOCALE)
+ if (HAVE_SNPRINTF_L)
+ list(APPEND FUNCTION_DEFINES HAVE_SNPRINTF_L)
diff --git a/emulators/mgba/patches/patch-include_mgba-util_math.h b/emulators/mgba/patches/patch-include_mgba-util_math.h
new file mode 100644
index 00000000000..64975f46ea0
--- /dev/null
+++ b/emulators/mgba/patches/patch-include_mgba-util_math.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-include_mgba-util_math.h,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+NetBSD defines popcount32 in libc.
+
+--- include/mgba-util/math.h.orig 2017-07-16 19:04:50.000000000 +0000
++++ include/mgba-util/math.h
+@@ -10,11 +10,15 @@
+
+ CXX_GUARD_START
+
++#ifndef __NetBSD__
+ static inline uint32_t popcount32(unsigned bits) {
+ bits = bits - ((bits >> 1) & 0x55555555);
+ bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
+ return (((bits + (bits >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
+ }
++#else
++unsigned int popcount32(uint32_t);
++#endif
+
+ static inline unsigned clz32(uint32_t bits) {
+ #if defined(__GNUC__) || __clang__
diff --git a/emulators/mgba/patches/patch-include_mgba-util_platform_posix_threading.h b/emulators/mgba/patches/patch-include_mgba-util_platform_posix_threading.h
new file mode 100644
index 00000000000..848af2cfd44
--- /dev/null
+++ b/emulators/mgba/patches/patch-include_mgba-util_platform_posix_threading.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-include_mgba-util_platform_posix_threading.h,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+Support NetBSD pthreads.
+
+--- include/mgba-util/platform/posix/threading.h.orig 2019-02-25 01:33:16.000000000 +0000
++++ include/mgba-util/platform/posix/threading.h
+@@ -95,6 +95,8 @@ static inline int ThreadSetName(const ch
+ #elif defined(__FreeBSD__) || defined(__OpenBSD__)
+ pthread_set_name_np(pthread_self(), name);
+ return 0;
++#elif defined(__NetBSD__)
++ return pthread_setname_np(pthread_self(), "%s", (void *)name);
+ #elif defined(__HAIKU__)
+ rename_thread(find_thread(NULL), name);
+ return 0;
diff --git a/emulators/mgba/patches/patch-version.cmake b/emulators/mgba/patches/patch-version.cmake
new file mode 100644
index 00000000000..362654187a1
--- /dev/null
+++ b/emulators/mgba/patches/patch-version.cmake
@@ -0,0 +1,22 @@
+$NetBSD: patch-version.cmake,v 1.1 2019/06/08 22:46:03 nia Exp $
+
+Avoid looking for git to determine the version string.
+
+--- version.cmake.orig 2019-01-27 00:06:06.000000000 +0000
++++ version.cmake
+@@ -8,15 +8,6 @@ set(LIB_VERSION_ABI 0.7)
+ set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
+ set(SUMMARY "${PROJECT_NAME} Game Boy Advance Emulator")
+
+-find_program(GIT git)
+-if(GIT AND NOT SKIP_GIT)
+- execute_process(COMMAND ${GIT} describe --always --abbrev=40 --dirty WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_COMMIT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+- execute_process(COMMAND ${GIT} describe --always --dirty WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_COMMIT_SHORT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+- execute_process(COMMAND ${GIT} symbolic-ref --short HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_BRANCH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+- execute_process(COMMAND ${GIT} rev-list HEAD --count WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_REV ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+- execute_process(COMMAND ${GIT} describe --tag --exact-match WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_TAG ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+-endif()
+-
+ if(NOT GIT_REV)
+ set(GIT_REV -1)
+ endif()