summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorthorpej <thorpej@pkgsrc.org>2019-12-28 19:32:18 +0000
committerthorpej <thorpej@pkgsrc.org>2019-12-28 19:32:18 +0000
commita77f6e2d7a7ea176fe5275991989bce8d68c35a6 (patch)
tree67f988fb36d023edd48d8652af3b0f370dfff068 /emulators
parentafa32ac16d6b9a5dd42aec71ad5d8faa46fff088 (diff)
downloadpkgsrc-a77f6e2d7a7ea176fe5275991989bce8d68c35a6.tar.gz
Add a package for the Commander X16 computer system emulator.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/x16-emulator/DESCR1
-rw-r--r--emulators/x16-emulator/Makefile25
-rw-r--r--emulators/x16-emulator/PLIST2
-rw-r--r--emulators/x16-emulator/distinfo8
-rw-r--r--emulators/x16-emulator/patches/patch-Makefile16
-rw-r--r--emulators/x16-emulator/patches/patch-main.c22
6 files changed, 74 insertions, 0 deletions
diff --git a/emulators/x16-emulator/DESCR b/emulators/x16-emulator/DESCR
new file mode 100644
index 00000000000..219207fa304
--- /dev/null
+++ b/emulators/x16-emulator/DESCR
@@ -0,0 +1 @@
+This is an emulator for the Commander X16 computer system.
diff --git a/emulators/x16-emulator/Makefile b/emulators/x16-emulator/Makefile
new file mode 100644
index 00000000000..5750d381d94
--- /dev/null
+++ b/emulators/x16-emulator/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1 2019/12/28 19:32:18 thorpej Exp $
+
+DISTNAME= x16-emulator-35
+CATEGORIES= emulators
+MASTER_SITES= ${MASTER_SITE_GITHUB:=commanderx16/}
+GITHUB_PROJECT= x16-emulator
+GITHUB_TAG= r${PKGVERSION_NOREV}
+
+MAINTAINER= thorpej@NetBSD.org
+HOMEPAGE= http://commanderx16.com/
+COMMENT= Emulator for the Commander X16 computer system
+LICENSE= 2-clause-bsd
+
+DEPENDS+= x16-rom-35{,nb*}:../../emulators/x16-rom
+MAKE_ENV+= ROM_RELATIVE_PATH=../share/x16/
+
+USE_TOOLS+= gmake
+
+INSTALLATION_DIRS+= bin
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/x16emu ${DESTDIR}${PREFIX}/bin
+
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/x16-emulator/PLIST b/emulators/x16-emulator/PLIST
new file mode 100644
index 00000000000..d3fb34a17a6
--- /dev/null
+++ b/emulators/x16-emulator/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2019/12/28 19:32:18 thorpej Exp $
+bin/x16emu
diff --git a/emulators/x16-emulator/distinfo b/emulators/x16-emulator/distinfo
new file mode 100644
index 00000000000..3175faf9969
--- /dev/null
+++ b/emulators/x16-emulator/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2019/12/28 19:32:18 thorpej Exp $
+
+SHA1 (x16-emulator-35.tar.gz) = 831e1acb2eecc5edb36f86925f00fabd6abb8321
+RMD160 (x16-emulator-35.tar.gz) = 1b5945db7ba879978bf77e7ad5362a93c9a464c0
+SHA512 (x16-emulator-35.tar.gz) = ec014b6ad13a7631d533b665c7544689629167261ffe0f0941c9381ea8cc6b3803a27deac0d76de7aa2fdae3dc438d8f0abbabe9f55ed0221e7fa0f0d39fbf3c
+Size (x16-emulator-35.tar.gz) = 123338 bytes
+SHA1 (patch-Makefile) = 450a069978bbd940d680437368dd880756879bd1
+SHA1 (patch-main.c) = db0721d145546dd60ed40b8e9151cd26493e07ad
diff --git a/emulators/x16-emulator/patches/patch-Makefile b/emulators/x16-emulator/patches/patch-Makefile
new file mode 100644
index 00000000000..fafa70ba537
--- /dev/null
+++ b/emulators/x16-emulator/patches/patch-Makefile
@@ -0,0 +1,16 @@
+$NetBSD: patch-Makefile,v 1.1 2019/12/28 19:32:18 thorpej Exp $
+
+Allow the default location of the X16 ROM to be overridden.
+
+--- Makefile.orig 2019-12-28 18:52:41.000000000 +0000
++++ Makefile
+@@ -48,6 +48,9 @@ ifneq ("$(wildcard ./rom_labels.h)","")
+ HEADERS+=rom_labels.h
+ endif
+
++ifdef ROM_RELATIVE_PATH
++ CFLAGS+=-DROM_RELATIVE_PATH=\"$(ROM_RELATIVE_PATH)\"
++endif
+
+ all: $(OBJS) $(HEADERS)
+ $(CC) -o $(OUTPUT) $(OBJS) $(LDFLAGS)
diff --git a/emulators/x16-emulator/patches/patch-main.c b/emulators/x16-emulator/patches/patch-main.c
new file mode 100644
index 00000000000..3b11c63cc5f
--- /dev/null
+++ b/emulators/x16-emulator/patches/patch-main.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-main.c,v 1.1 2019/12/28 19:32:18 thorpej Exp $
+
+Allow the default location of the X16 ROM to be overridden.
+
+--- main.c.orig 2019-12-28 19:00:35.000000000 +0000
++++ main.c
+@@ -436,9 +436,13 @@ main(int argc, char **argv)
+
+ char *base_path = SDL_GetBasePath();
+
+- // This causes the emulator to load ROM data from the executable's directory when
+- // no ROM file is specified on the command line.
++ // This causes the emulator to load ROM data from the executable's
++ // directory (or somewhere nearby if ROM_RELATIVE_PATH is specified)
++ // when no ROM file is specified on the command line.
+ memcpy(rom_path, base_path, strlen(base_path) + 1);
++#ifdef ROM_RELATIVE_PATH
++ strncpy(rom_path + strlen(rom_path), ROM_RELATIVE_PATH, PATH_MAX - strlen(rom_path));
++#endif
+ strncpy(rom_path + strlen(rom_path), rom_filename, PATH_MAX - strlen(rom_path));
+
+ argc--;