git: 894b6047198a - main - emulators/catapult: re-add port: GUI for openMSX

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Sat, 25 Dec 2021 11:00:16 UTC
The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=894b6047198a926ba19f7da8ad4c5c702062eba4

commit 894b6047198a926ba19f7da8ad4c5c702062eba4
Author:     Daniel Menelkir <menelkir@itroll.org>
AuthorDate: 2021-12-25 10:56:53 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2021-12-25 10:59:25 +0000

    emulators/catapult: re-add port: GUI for openMSX
    
    Catapult is a frontend for OpenMSX, the open source MSX
    emulator that tries to achieve near-perfect emulation by
    using a novel emulation model.
    
    WWW: https://openmsx.org
    
    PR:             257892
    Reported by:    Daniel Menelkir <menelkir@itroll.org> (new maintainer)
---
 MOVED                                             |  1 -
 emulators/Makefile                                |  1 +
 emulators/catapult/Makefile                       | 76 +++++++++++++++++++++++
 emulators/catapult/distinfo                       |  3 +
 emulators/catapult/files/patch-build_detectsys.py | 11 ++++
 emulators/catapult/pkg-descr                      |  5 ++
 emulators/catapult/pkg-plist                      | 44 +++++++++++++
 7 files changed, 140 insertions(+), 1 deletion(-)

diff --git a/MOVED b/MOVED
index ada668c011c7..a31a3e3a6780 100644
--- a/MOVED
+++ b/MOVED
@@ -13750,7 +13750,6 @@ devel/pychecker||2020-01-27|Has expired: Unmaintained, uses EOLed python27
 devel/pymacs||2020-01-27|Has expired: Unmaintained, uses EOLed python27
 devel/trac-bitten||2020-01-27|Has expired: Unmaintained, uses EOLed python27
 devel/wxGlade||2020-01-27|Has expired: Unmaintained, uses EOLed python27
-emulators/catapult||2020-01-27|Has expired: Unmaintained, uses EOLed python27
 emulators/dynagui||2020-01-27|Has expired: Unmaintained, uses EOLed python27
 finance/mybudget||2020-01-27|Has expired: Unmaintained, uses EOLed python27
 finance/sabernetdcs-client||2020-01-27|Has expired: Unmaintained, uses EOLed python27
diff --git a/emulators/Makefile b/emulators/Makefile
index 474bddb0bdd2..a5926fd975fc 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -10,6 +10,7 @@
     SUBDIR += bochs
     SUBDIR += bsvc
     SUBDIR += cannonball
+    SUBDIR += catapult
     SUBDIR += cemu
     SUBDIR += cingb
     SUBDIR += citra
diff --git a/emulators/catapult/Makefile b/emulators/catapult/Makefile
new file mode 100644
index 000000000000..19aa630ec5e1
--- /dev/null
+++ b/emulators/catapult/Makefile
@@ -0,0 +1,76 @@
+PORTNAME=	catapult
+PORTVERSION=	17.0
+CATEGORIES=	emulators
+MASTER_SITES=	https://github.com/openMSX/openMSX/releases/download/RELEASE_${PORTVERSION:S/./_/g}/
+DISTNAME=	openmsx-${PORTNAME}-${PORTVERSION}
+
+MAINTAINER=	menelkir@itroll.org
+COMMENT=	GUI for openMSX
+
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/doc/GPL.txt
+
+BUILD_DEPENDS=	openmsx:emulators/openmsx
+RUN_DEPENDS=	openmsx:emulators/openmsx
+
+USES=		gmake pkgconfig python gnome
+USE_GNOME+=	libxml2
+USE_WX=		3.0
+MAKEFILE=	GNUmakefile
+MAKE_ARGS=	INSTALL_BASE="${PREFIX}" \
+		INSTALL_SHARE_DIR="${DATADIR}" \
+		INSTALL_DOC_DIR="${DOCSDIR}" \
+		CATAPULT_FLAVOUR="portbld" \
+		CATAPULT_OPENMSX_BINARY="${LOCALBASE}/bin/openmsx" \
+		CATAPULT_OPENMSX_SHARE="${LOCALBASE}/share/openmsx" \
+		CATAPULT_NO_DESKTOP_HOOKS="true" \
+		SYMLINK_FOR_BINARY="false" \
+		PYTHON="${PYTHON_CMD}"
+
+MAKE_JOBS_UNSAFE=	yes
+
+OPTIONS_DEFINE= DEBUG DOCS
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDEBUG}
+CFLAGS+=	-DDEBUG
+CATAPULT_STRIP=	false
+.else
+CFLAGS+=	-DNDEBUG
+CATAPULT_STRIP=	true
+.endif
+
+post-extract:
+	${CP} ${WRKSRC}/build/platform-freebsd.mk \
+		${WRKSRC}/build/platform-dragonfly.mk
+
+post-patch:
+	@${REINPLACE_CMD} 's|$$(INSTALL_BASE)|${DATADIR}|' \
+		${WRKSRC}/build/info2code.mk
+	@${REINPLACE_CMD} '/-Wno-literal/s|^CXXFLAGS|#CXXFLAGS| ; \
+		 /--cxx/s|^CXX|#CXX| ; \
+		 /COMPILE=/s|g++|$$(CXX)| ; \
+		 s|@$$(CXX)|$$(CXX)|' ${WRKSRC}/build/main.mk
+	@${REINPLACE_CMD} 's|wx-config --|${WX_CONFIG:T} --|g' \
+		${WRKSRC}/build/probe.mk
+	@${REINPLACE_CMD} '/^Exec/s|%INSTALL_BASE%|${PREFIX}| ; \
+		 /^Icon/s|%INSTALL_BASE%|${DATADIR}| ; \
+		 /^DocPath/s|%INSTALL_BASE%/doc|${DOCSDIR}|' \
+		${WRKSRC}/desktop/openMSX-Catapult.desktop
+	@${ECHO_CMD} > ${WRKSRC}/build/flavour-portbld.mk
+	@${ECHO_CMD} 'CXXFLAGS+=${CXXFLAGS}' \
+		>> ${WRKSRC}/build/flavour-portbld.mk
+	@${ECHO_CMD} 'LINK_FLAGS+=${LDFLAGS}' \
+		>> ${WRKSRC}/build/flavour-portbld.mk
+	@${ECHO_CMD} 'CATAPULT_STRIP:=${CATAPULT_STRIP}' \
+		>> ${WRKSRC}/build/flavour-portbld.mk
+
+post-install:
+	${MKDIR} ${STAGEDIR}${DATADIR}/resources/icons
+	${INSTALL_DATA} ${WRKSRC}/src/catapult.xpm \
+		${STAGEDIR}${DATADIR}/resources/icons
+	cd ${WRKSRC}/desktop && ${INSTALL_DATA} openMSX-Catapult.desktop \
+		${STAGEDIR}${DESKTOPDIR}
+
+.include <bsd.port.mk>
diff --git a/emulators/catapult/distinfo b/emulators/catapult/distinfo
new file mode 100644
index 000000000000..a79a6e2e17fa
--- /dev/null
+++ b/emulators/catapult/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1629146501
+SHA256 (openmsx-catapult-17.0.tar.gz) = e8b53765292b9692e4047247ee2726236c2eab7d9a9e5338bc316542501df871
+SIZE (openmsx-catapult-17.0.tar.gz) = 1196727
diff --git a/emulators/catapult/files/patch-build_detectsys.py b/emulators/catapult/files/patch-build_detectsys.py
new file mode 100644
index 000000000000..7249b45bcab8
--- /dev/null
+++ b/emulators/catapult/files/patch-build_detectsys.py
@@ -0,0 +1,11 @@
+--- build/detectsys.py.orig	2021-08-16 20:45:31 UTC
++++ build/detectsys.py
+@@ -10,7 +10,7 @@ def detectOS():
+ 	Raises ValueError if no known OS is detected.
+ 	'''
+ 	os = system().lower()
+-	if os in ('linux', 'darwin', 'freebsd', 'netbsd', 'openbsd', 'gnu'):
++	if os in ('linux', 'darwin', 'dragonfly', 'freebsd', 'netbsd', 'openbsd', 'gnu'):
+ 		return os
+ 	elif os.startswith('gnu/'):
+ 		# GNU userland on non-Hurd kernel, for example Debian GNU/kFreeBSD.
diff --git a/emulators/catapult/pkg-descr b/emulators/catapult/pkg-descr
new file mode 100644
index 000000000000..5905814d69e7
--- /dev/null
+++ b/emulators/catapult/pkg-descr
@@ -0,0 +1,5 @@
+Catapult is a frontend for OpenMSX, the open source MSX
+emulator that tries to achieve near-perfect emulation by
+using a novel emulation model.
+
+WWW: https://openmsx.org
diff --git a/emulators/catapult/pkg-plist b/emulators/catapult/pkg-plist
new file mode 100644
index 000000000000..2b0b2f7838b0
--- /dev/null
+++ b/emulators/catapult/pkg-plist
@@ -0,0 +1,44 @@
+bin/catapult
+share/applications/openMSX-Catapult.desktop
+%%DATADIR%%/resources/bitmaps/about.png
+%%DATADIR%%/resources/bitmaps/diskimage.png
+%%DATADIR%%/resources/bitmaps/eject.png
+%%DATADIR%%/resources/bitmaps/file.png
+%%DATADIR%%/resources/bitmaps/harddisk.png
+%%DATADIR%%/resources/bitmaps/ledoff.png
+%%DATADIR%%/resources/bitmaps/ledon.png
+%%DATADIR%%/resources/bitmaps/romimage.png
+%%DATADIR%%/resources/bitmaps/tapeimage.png
+%%DATADIR%%/resources/dialogs/about.xrc
+%%DATADIR%%/resources/dialogs/audiocontrols.xrc
+%%DATADIR%%/resources/dialogs/catapult.xrc
+%%DATADIR%%/resources/dialogs/checkconfigs.xrc
+%%DATADIR%%/resources/dialogs/config.xrc
+%%DATADIR%%/resources/dialogs/fullscreen.xrc
+%%DATADIR%%/resources/dialogs/input.xrc
+%%DATADIR%%/resources/dialogs/ipsselect.xrc
+%%DATADIR%%/resources/dialogs/misccontrols.xrc
+%%DATADIR%%/resources/dialogs/romtype.xrc
+%%DATADIR%%/resources/dialogs/screenshot.xrc
+%%DATADIR%%/resources/dialogs/session.xrc
+%%DATADIR%%/resources/dialogs/status.xrc
+%%DATADIR%%/resources/dialogs/videocontrols.xrc
+%%DATADIR%%/resources/icons/catapult.xpm
+%%PORTDOCS%%%%DOCSDIR%%/GPL.txt
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/authors.txt
+%%PORTDOCS%%%%DOCSDIR%%/manual/audio.png
+%%PORTDOCS%%%%DOCSDIR%%/manual/compile.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/index.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/input.png
+%%PORTDOCS%%%%DOCSDIR%%/manual/mainscreen.png
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual-minty.css
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual-purple.css
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual.css
+%%PORTDOCS%%%%DOCSDIR%%/manual/misc.png
+%%PORTDOCS%%%%DOCSDIR%%/manual/session.png
+%%PORTDOCS%%%%DOCSDIR%%/manual/status.png
+%%PORTDOCS%%%%DOCSDIR%%/manual/user.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/video.png
+%%PORTDOCS%%%%DOCSDIR%%/release-history.txt
+%%PORTDOCS%%%%DOCSDIR%%/release-notes.txt