summaryrefslogtreecommitdiff
path: root/emulators/libretro-mgba
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2018-08-12 14:25:09 +0000
committernia <nia@pkgsrc.org>2018-08-12 14:25:09 +0000
commit7d015a9e6730e10d0ec3913fe5ba015b44821e66 (patch)
tree2510d0346fb6301969014babff1f92585d014b47 /emulators/libretro-mgba
parent8d5b0ee56928832134943495b00a4119a918c2c5 (diff)
downloadpkgsrc-7d015a9e6730e10d0ec3913fe5ba015b44821e66.tar.gz
libretro-mgba: add version 0.6.3
Libretro is a simple but powerful development interface that allows for the easy creation of emulators, games and multimedia applications that can plug straight into any libretro-compatible frontend. This development interface is open to others so that they can run these pluggable emulator and game cores also in their own programs or devices. 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/libretro-mgba')
-rw-r--r--emulators/libretro-mgba/DESCR10
-rw-r--r--emulators/libretro-mgba/Makefile46
-rw-r--r--emulators/libretro-mgba/PLIST5
-rw-r--r--emulators/libretro-mgba/distinfo9
-rw-r--r--emulators/libretro-mgba/patches/patch-CMakeLists.txt28
-rw-r--r--emulators/libretro-mgba/patches/patch-include_mgba-util_math.h22
-rw-r--r--emulators/libretro-mgba/patches/patch-version.cmake30
7 files changed, 150 insertions, 0 deletions
diff --git a/emulators/libretro-mgba/DESCR b/emulators/libretro-mgba/DESCR
new file mode 100644
index 00000000000..6feb98cfccd
--- /dev/null
+++ b/emulators/libretro-mgba/DESCR
@@ -0,0 +1,10 @@
+Libretro is a simple but powerful development interface that allows for the
+easy creation of emulators, games and multimedia applications that can plug
+straight into any libretro-compatible frontend. This development interface is
+open to others so that they can run these pluggable emulator and game cores
+also in their own programs or devices.
+
+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/libretro-mgba/Makefile b/emulators/libretro-mgba/Makefile
new file mode 100644
index 00000000000..7c2e4bbd94c
--- /dev/null
+++ b/emulators/libretro-mgba/Makefile
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.1 2018/08/12 14:25:09 nia Exp $
+
+DISTNAME= libretro-mgba-0.6.3
+CATEGORIES= emulators
+MASTER_SITES= ${MASTER_SITE_GITHUB:=mgba-emu/}
+GITHUB_PROJECT= mgba
+
+MAINTAINER= nia@NetBSD.org
+HOMEPAGE= https://docs.libretro.com/library/mgba/
+COMMENT= Libretro core based on the mGBA emulator
+LICENSE= mpl-2.0
+
+EXTRACT_USING= bsdtar
+USE_TOOLS+= pkg-config
+USE_CMAKE= yes
+
+WRKSRC= ${WRKDIR}/mgba-${PKGVERSION_NOREV}
+
+CMAKE_ARGS+= -DUSE_DEBUGGERS=OFF
+CMAKE_ARGS+= -DUSE_GDB_STUB=OFF
+
+CMAKE_ARGS+= -DUSE_EDITLINE=OFF
+CMAKE_ARGS+= -DUSE_FFMPEG=OFF
+CMAKE_ARGS+= -DUSE_ZLIB=OFF
+CMAKE_ARGS+= -DUSE_MINIZIP=OFF
+CMAKE_ARGS+= -DUSE_PNG=OFF
+CMAKE_ARGS+= -DUSE_LIBZIP=OFF
+CMAKE_ARGS+= -DUSE_MAGICK=OFF
+CMAKE_ARGS+= -DUSE_SQLITE3=OFF
+CMAKE_ARGS+= -DUSE_LZMA=OFF
+CMAKE_ARGS+= -DUSE_EPOXY=OFF
+
+CMAKE_ARGS+= -DBUILD_QT=OFF
+CMAKE_ARGS+= -DBUILD_SDL=OFF
+CMAKE_ARGS+= -DBUILD_GL=OFF
+
+CMAKE_ARGS+= -DBUILD_LIBRETRO=ON
+CMAKE_ARGS+= -DSKIP_LIBRARY=ON
+CMAKE_ARGS+= -DLIBRETRO_LIBDIR=${PREFIX}/lib/libretro
+
+CFLAGS+= -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600
+
+INSTALLATION_DIRS+= ${PREFIX}/lib/libretro
+
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/libretro-mgba/PLIST b/emulators/libretro-mgba/PLIST
new file mode 100644
index 00000000000..4dac1363654
--- /dev/null
+++ b/emulators/libretro-mgba/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2018/08/12 14:25:09 nia Exp $
+include/mgba/flags.h
+lib/libretro/mgba_libretro.so
+share/doc/mGBA/CHANGES
+share/doc/mGBA/README.md
diff --git a/emulators/libretro-mgba/distinfo b/emulators/libretro-mgba/distinfo
new file mode 100644
index 00000000000..5739e6e7f61
--- /dev/null
+++ b/emulators/libretro-mgba/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2018/08/12 14:25:09 nia Exp $
+
+SHA1 (libretro-mgba-0.6.3.tar.gz) = b90d59af4ef43d0faf98f48f66514a51aa677296
+RMD160 (libretro-mgba-0.6.3.tar.gz) = a9d5cbc4f77a6ca1883707bef92313d77cf2a824
+SHA512 (libretro-mgba-0.6.3.tar.gz) = d646af7869dbcf8df671a75ecfd8c270950c013b826b23b94bacae43a77243786f198725e1b9bf17827d1ffcf6a8eef70091d53ea878bfb2450472485f42f233
+Size (libretro-mgba-0.6.3.tar.gz) = 7442154 bytes
+SHA1 (patch-CMakeLists.txt) = ec56af8fed90cd6486d797fd18fd69ac6eb00d3d
+SHA1 (patch-include_mgba-util_math.h) = 448ca1bb3bbe2812e7d9482917c488ddcf3b48f0
+SHA1 (patch-version.cmake) = 973e3b397b807be1c228e96d559f98a4d1091bae
diff --git a/emulators/libretro-mgba/patches/patch-CMakeLists.txt b/emulators/libretro-mgba/patches/patch-CMakeLists.txt
new file mode 100644
index 00000000000..c13744944ec
--- /dev/null
+++ b/emulators/libretro-mgba/patches/patch-CMakeLists.txt
@@ -0,0 +1,28 @@
+$NetBSD: patch-CMakeLists.txt,v 1.1 2018/08/12 14:25:09 nia Exp $
+
+Avoid checking for a C++ compiler, since C++ isn't required for a
+libretro build.
+
+vfs-dirent peeks into non-standard structures and also isn't required
+for a libretro build.
+
+--- CMakeLists.txt.orig 2018-04-14 20:49:19.000000000 +0000
++++ CMakeLists.txt
+@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.11)
+ if(POLICY CMP0025)
+ cmake_policy(SET CMP0025 NEW)
+ endif()
+-project(mGBA)
++project(mGBA C)
+ set(BINARY_NAME mgba CACHE INTERNAL "Name of output binaries")
+ if(NOT MSVC)
+ set(GCC_STD "c99")
+@@ -231,7 +231,7 @@ elseif(UNIX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+ endif()
+
+- list(APPEND CORE_VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-fd.c ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-dirent.c)
++ list(APPEND CORE_VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-fd.c)
+ file(GLOB OS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/posix/*.c)
+ source_group("POSIX-specific code" FILES ${OS_SRC})
+ endif()
diff --git a/emulators/libretro-mgba/patches/patch-include_mgba-util_math.h b/emulators/libretro-mgba/patches/patch-include_mgba-util_math.h
new file mode 100644
index 00000000000..65ef848ac4b
--- /dev/null
+++ b/emulators/libretro-mgba/patches/patch-include_mgba-util_math.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-include_mgba-util_math.h,v 1.1 2018/08/12 14:25:09 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/libretro-mgba/patches/patch-version.cmake b/emulators/libretro-mgba/patches/patch-version.cmake
new file mode 100644
index 00000000000..2558fee61d3
--- /dev/null
+++ b/emulators/libretro-mgba/patches/patch-version.cmake
@@ -0,0 +1,30 @@
+$NetBSD: patch-version.cmake,v 1.1 2018/08/12 14:25:09 nia Exp $
+
+Avoid looking for git to determine the version string.
+
+Correct version string.
+
+--- version.cmake.orig 2018-04-14 20:49:19.000000000 +0000
++++ version.cmake
+@@ -3,20 +3,11 @@ if(NOT PROJECT_NAME)
+ endif()
+ set(LIB_VERSION_MAJOR 0)
+ set(LIB_VERSION_MINOR 6)
+-set(LIB_VERSION_PATCH 1)
++set(LIB_VERSION_PATCH 3)
+ set(LIB_VERSION_ABI 0.6)
+ 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()