summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emulators/Makefile2
-rw-r--r--emulators/x16-emulator/Makefile36
-rw-r--r--emulators/x16-emulator/distinfo3
-rw-r--r--emulators/x16-emulator/files/patch-Makefile13
-rw-r--r--emulators/x16-emulator/files/patch-main.c11
-rw-r--r--emulators/x16-emulator/pkg-descr3
-rw-r--r--emulators/x16-rom/Makefile27
-rw-r--r--emulators/x16-rom/distinfo3
-rw-r--r--emulators/x16-rom/pkg-descr3
9 files changed, 101 insertions, 0 deletions
diff --git a/emulators/Makefile b/emulators/Makefile
index 789282fc55f0..04de5231977f 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -163,6 +163,8 @@
SUBDIR += wine-mono-devel
SUBDIR += winetricks
SUBDIR += wxmupen64plus
+ SUBDIR += x16-emulator
+ SUBDIR += x16-rom
SUBDIR += x48
SUBDIR += x49gp
SUBDIR += xbraitenberg
diff --git a/emulators/x16-emulator/Makefile b/emulators/x16-emulator/Makefile
new file mode 100644
index 000000000000..209ef24dfe1c
--- /dev/null
+++ b/emulators/x16-emulator/Makefile
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+PORTNAME= x16-emulator
+DISTVERSION= r37
+CATEGORIES= emulators
+
+MAINTAINER= makc@FreeBSD.org
+COMMENT= Emulator for the Commander X16 8-bit computer
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS= ${DATADIR}/rom.bin:emulators/x16-rom
+
+USES= gmake sdl
+
+USE_SDL= sdl2
+USE_GITHUB= yes
+GH_ACCOUNT= commanderx16
+
+DESKTOP_ENTRIES= "Commander X16" \
+ "" \
+ "" \
+ "x16emu" \
+ "" \
+ true
+
+PLIST_FILES= bin/x16emu
+
+post-patch:
+ ${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX}," ${WRKSRC}/main.c
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/x16emu ${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/emulators/x16-emulator/distinfo b/emulators/x16-emulator/distinfo
new file mode 100644
index 000000000000..420b14e63260
--- /dev/null
+++ b/emulators/x16-emulator/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1585317045
+SHA256 (commanderx16-x16-emulator-r37_GH0.tar.gz) = 0c9dbf76ceb5668c32d3b9f04538cdfe891826eaac6bf57c68b13a0152ce15d2
+SIZE (commanderx16-x16-emulator-r37_GH0.tar.gz) = 130968
diff --git a/emulators/x16-emulator/files/patch-Makefile b/emulators/x16-emulator/files/patch-Makefile
new file mode 100644
index 000000000000..c55b0b18ee02
--- /dev/null
+++ b/emulators/x16-emulator/files/patch-Makefile
@@ -0,0 +1,13 @@
+--- Makefile.orig 2020-01-03 23:42:34 UTC
++++ Makefile
+@@ -10,8 +10,8 @@ else
+ SDL2CONFIG=sdl2-config
+ endif
+
+-CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Iextern/include -Iextern/src
+-LDFLAGS=$(shell $(SDL2CONFIG) --libs) -lm
++CFLAGS += $(shell $(SDL2CONFIG) --cflags) -Iextern/include -Iextern/src
++LDFLAGS += $(shell $(SDL2CONFIG) --libs) -lm
+
+ OUTPUT=x16emu
+
diff --git a/emulators/x16-emulator/files/patch-main.c b/emulators/x16-emulator/files/patch-main.c
new file mode 100644
index 000000000000..4ef3454b615c
--- /dev/null
+++ b/emulators/x16-emulator/files/patch-main.c
@@ -0,0 +1,11 @@
+--- main.c.orig 2020-01-22 19:56:11 UTC
++++ main.c
+@@ -442,7 +442,7 @@ main(int argc, char **argv)
+
+ run_after_load = false;
+
+- char *base_path = SDL_GetBasePath();
++ char *base_path = "%%PREFIX%%/share/x16-emulator/";
+
+ // This causes the emulator to load ROM data from the executable's directory when
+ // no ROM file is specified on the command line.
diff --git a/emulators/x16-emulator/pkg-descr b/emulators/x16-emulator/pkg-descr
new file mode 100644
index 000000000000..e685298310ae
--- /dev/null
+++ b/emulators/x16-emulator/pkg-descr
@@ -0,0 +1,3 @@
+This is an emulator for the Commander X16 - modern 8-bit computer.
+
+WWW: https://github.com/commanderx16
diff --git a/emulators/x16-rom/Makefile b/emulators/x16-rom/Makefile
new file mode 100644
index 000000000000..19f6093ff383
--- /dev/null
+++ b/emulators/x16-rom/Makefile
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME= x16-rom
+DISTVERSION= r37
+CATEGORIES= emulators
+
+MAINTAINER= makc@FreeBSD.org
+COMMENT= Commander X16 ROM
+
+BUILD_DEPENDS= cc65:devel/cc65
+
+USES= gmake
+
+USE_GITHUB= yes
+GH_ACCOUNT= commanderx16
+
+DATADIR= ${PREFIX}/share/x16-emulator
+PORTDATA= rom.bin
+
+post-patch:
+ ${REINPLACE_CMD} '1s,bash,sh,' ${WRKSRC}/scripts/symbolize.sh
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/build/x16/rom.bin ${STAGEDIR}/${DATADIR}
+
+.include <bsd.port.mk>
diff --git a/emulators/x16-rom/distinfo b/emulators/x16-rom/distinfo
new file mode 100644
index 000000000000..5cfc13a97de1
--- /dev/null
+++ b/emulators/x16-rom/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1585316000
+SHA256 (commanderx16-x16-rom-r37_GH0.tar.gz) = 6d33326ac95c12f09efa328bbee4e8a4c285a42599199d8d5a93d28b5801deef
+SIZE (commanderx16-x16-rom-r37_GH0.tar.gz) = 468369
diff --git a/emulators/x16-rom/pkg-descr b/emulators/x16-rom/pkg-descr
new file mode 100644
index 000000000000..71d78c52c0c1
--- /dev/null
+++ b/emulators/x16-rom/pkg-descr
@@ -0,0 +1,3 @@
+ROM containing BASIC, KERNAL, DOS and GEOS for the Commander X16 emulator.
+
+WWW: https://github.com/commanderx16