Sat Dec 28 19:32:18 2019 UTC ()
Add a package for the Commander X16 computer system emulator.


(thorpej)
diff -r0 -r1.1 pkgsrc/emulators/x16-emulator/DESCR
diff -r0 -r1.1 pkgsrc/emulators/x16-emulator/Makefile
diff -r0 -r1.1 pkgsrc/emulators/x16-emulator/PLIST
diff -r0 -r1.1 pkgsrc/emulators/x16-emulator/distinfo
diff -r0 -r1.1 pkgsrc/emulators/x16-emulator/patches/patch-Makefile
diff -r0 -r1.1 pkgsrc/emulators/x16-emulator/patches/patch-main.c

File Added: pkgsrc/emulators/x16-emulator/DESCR
This is an emulator for the Commander X16 computer system.

File Added: pkgsrc/emulators/x16-emulator/Makefile
# $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"

File Added: pkgsrc/emulators/x16-emulator/PLIST
@comment $NetBSD: PLIST,v 1.1 2019/12/28 19:32:18 thorpej Exp $
bin/x16emu

File Added: pkgsrc/emulators/x16-emulator/distinfo
$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

File Added: pkgsrc/emulators/x16-emulator/patches/patch-Makefile
$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)

File Added: pkgsrc/emulators/x16-emulator/patches/Attic/patch-main.c
$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--;