git: f6185e251d10 - main - emulators/fceux: revive port

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Sun, 23 Jan 2022 04:14:48 UTC
The branch main has been updated by jrm:

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

commit f6185e251d1035799cccde4a68bdd2f514ae699b
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2022-01-21 22:01:50 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2022-01-23 04:14:17 +0000

    emulators/fceux: revive port
    
    Now that the build system no longer requires python27, this port can be
    revived.  The port has been completely redone from scratch based on the
    current upstream version.
    
    PR:             261402
---
 MOVED                                              |  1 -
 emulators/Makefile                                 |  1 +
 emulators/fceux/Makefile                           | 44 ++++++++++
 emulators/fceux/distinfo                           |  3 +
 emulators/fceux/files/patch-scripts_genGitHdr.sh   | 19 +++++
 .../fceux/files/patch-scripts_unix__make__docs.sh  | 18 ++++
 .../fceux/files/patch-src_drivers_Qt_sdl-sound.cpp | 12 +++
 emulators/fceux/pkg-descr                          | 20 +++++
 emulators/fceux/pkg-plist                          | 96 ++++++++++++++++++++++
 9 files changed, 213 insertions(+), 1 deletion(-)

diff --git a/MOVED b/MOVED
index ac970b27df57..c33750712c58 100644
--- a/MOVED
+++ b/MOVED
@@ -15906,7 +15906,6 @@ databases/arangodb33||2021-01-02|Has expired: Uses Python 2.7 which is EOLed ups
 devel/bzr||2021-01-02|Has expired: Uses Python 2.7 which is EOLed upstream
 devel/chromium-gn|devel/gn|2021-01-02|Has expired: Uses deprecated version of python, use devel/gn instead
 devel/mongo-cxx-driver||2021-01-02|Has expired: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream
-emulators/fceux||2021-01-02|Has expired: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream
 emulators/gem5||2021-01-02|Has expired: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream
 emulators/nonpareil||2021-01-02|Has expired: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream
 games/freera||2021-01-02|Has expired: Uses Python 2.7 version of scons, and Python 2.7 which is EOLed upstream
diff --git a/emulators/Makefile b/emulators/Makefile
index 61674dd70ad5..a23b925c5ad7 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -29,6 +29,7 @@
     SUBDIR += elliott-803
     SUBDIR += emu64
     SUBDIR += emulationstation
+    SUBDIR += fceux
     SUBDIR += fmsx
     SUBDIR += frodo
     SUBDIR += fs-uae
diff --git a/emulators/fceux/Makefile b/emulators/fceux/Makefile
new file mode 100644
index 000000000000..47ac7a49edf9
--- /dev/null
+++ b/emulators/fceux/Makefile
@@ -0,0 +1,44 @@
+PORTNAME=	fceux
+DISTVERSION=	2.6.1
+CATEGORIES=	emulators games
+MASTER_SITES=	SF/fceultra/Source%20Code/${DISTVERSION}%20src/
+
+MAINTAINER=	fuz@fuz.su
+COMMENT=	NES emulator
+
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+LIB_DEPENDS=	libminizip.so:archivers/minizip
+
+USES=		cmake desktop-file-utils gl lua:51 pkgconfig qt:5 sdl
+USE_GL=		gl glu
+USE_QT=		buildtools_build core gui opengl qmake_build sql widgets
+USE_SDL=	sdl2
+
+CFLAGS+=	-DPUBLIC_RELEASE
+CMAKE_ON=	GLVND
+
+OPTIONS_DEFINE=		DOCS FFMPEG X264 X265
+OPTIONS_DEFAULT=	FFMPEG X264 X265
+DOCS_CMAKE_BOOL=	QHELP
+DOCS_USE=		qt=help,sql
+FFMPEG_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
+X264_LIB_DEPENDS=	libx264.so:multimedia/libx264
+X265_LIB_DEPENDS=	libx265.so:multimedia/x265
+
+post-patch:
+	${REINPLACE_CMD} -e 's,/usr,${PREFIX},' ${WRKSRC}/fceux.desktop
+	${REINPLACE_CMD} -e 's:%%PKGNAME%%:${PKGNAME}:' ${WRKSRC}/scripts/genGitHdr.sh
+	${REINPLACE_CMD} -e 's,/usr,${PREFIX},' ${WRKSRC}/src/drivers/Qt/HelpPages.cpp
+
+pre-build-DOCS-on:
+	${SETENV} QHELPGENERATOR=${QHELPGENERATOR} PROJECT_ROOT=${WRKSRC} ${SH} ${WRKSRC}/scripts/unix_make_docs.sh
+
+post-install:
+	${RM} ${STAGEDIR}${DATADIR}/*.dll
+	${RM} ${STAGEDIR}${DATADIR}/*.chm
+	# currently broken and not shipped
+	${RM} ${STAGEDIR}${PREFIX}/man/man6/fceux-net-server.6
+
+.include <bsd.port.mk>
diff --git a/emulators/fceux/distinfo b/emulators/fceux/distinfo
new file mode 100644
index 000000000000..d19da94da8fb
--- /dev/null
+++ b/emulators/fceux/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1642789615
+SHA256 (fceux-2.6.1.tar.gz) = 3a845dfe97975b5c5fd2e9637fe31e79ddc2f337d99a61296134d82c641d02d6
+SIZE (fceux-2.6.1.tar.gz) = 23326768
diff --git a/emulators/fceux/files/patch-scripts_genGitHdr.sh b/emulators/fceux/files/patch-scripts_genGitHdr.sh
new file mode 100644
index 000000000000..9351d3f6ffb6
--- /dev/null
+++ b/emulators/fceux/files/patch-scripts_genGitHdr.sh
@@ -0,0 +1,19 @@
+--- scripts/genGitHdr.sh.orig	2022-01-17 18:50:37 UTC
++++ scripts/genGitHdr.sh
+@@ -3,12 +3,13 @@
+ OUTPUT_DIR=$1;
+ 
+ FILE="fceux_git_info.cpp"
+-TMP_FILE="/tmp/$FILE";
++TMP_FILE="`mktemp /tmp/$FILE.XXXXXX`";
+ 
+ echo "Output File: $OUTPUT_DIR/$FILE";
+ 
+-GIT_URL=`git config --get remote.origin.url`;
+-GIT_REV=`git rev-parse HEAD`;
++# print useful information in lieu of a git revision we don't have
++GIT_URL="FreeBSD Ports Collection";
++GIT_REV="%%PKGNAME%%";
+ 
+ echo "// fceux_git_info.cpp -- DO NOT EDIT: This file is auto-generated at build" >| $TMP_FILE;
+ echo "#include \"Qt/fceux_git_info.h\" " >> $TMP_FILE;
diff --git a/emulators/fceux/files/patch-scripts_unix__make__docs.sh b/emulators/fceux/files/patch-scripts_unix__make__docs.sh
new file mode 100644
index 000000000000..e8b03dad001d
--- /dev/null
+++ b/emulators/fceux/files/patch-scripts_unix__make__docs.sh
@@ -0,0 +1,18 @@
+--- scripts/unix_make_docs.sh.orig	2022-01-21 21:26:16 UTC
++++ scripts/unix_make_docs.sh
+@@ -1,13 +1,8 @@
+ #!/bin/bash
+ 
+-PROJECT_ROOT=$( cd "$(dirname ${BASH_SOURCE[0]})"/.. && pwd )
++cd $PROJECT_ROOT/web
+ 
+-echo $PROJECT_ROOT;
+-echo "Building for OS: $OSTYPE";
+-
+-cd $PROJECT_ROOT/web;
+-
+-qhelpgenerator fceux.qhcp -o fceux.qhc
++${QHELPGENERATOR} fceux.qhcp -o fceux.qhc
+ 
+ cp -f fceux.qhc  $PROJECT_ROOT/output
+ cp -f fceux.qch  $PROJECT_ROOT/output
diff --git a/emulators/fceux/files/patch-src_drivers_Qt_sdl-sound.cpp b/emulators/fceux/files/patch-src_drivers_Qt_sdl-sound.cpp
new file mode 100644
index 000000000000..011c34595a3c
--- /dev/null
+++ b/emulators/fceux/files/patch-src_drivers_Qt_sdl-sound.cpp
@@ -0,0 +1,12 @@
+--- src/drivers/Qt/sdl-sound.cpp.orig	2022-01-21 20:48:31 UTC
++++ src/drivers/Qt/sdl-sound.cpp
+@@ -219,8 +219,7 @@ InitSound()
+ 	spec.freq = s_SampleRate = soundrate;
+ 	spec.format = AUDIO_S16SYS;
+ 	spec.channels = 1;
+-	//spec.samples = 512;
+-	spec.samples = (int)( ( (double)s_SampleRate / getBaseFrameRate() ) );
++	spec.samples = 512;
+ 	spec.callback = fillaudio;
+ 	spec.userdata = 0;
+ 
diff --git a/emulators/fceux/pkg-descr b/emulators/fceux/pkg-descr
new file mode 100644
index 000000000000..cd4b3fc9d015
--- /dev/null
+++ b/emulators/fceux/pkg-descr
@@ -0,0 +1,20 @@
+FCEUX is a Nintendo Entertainment System (NES), Famicom, Famicom Disk
+System (FDS), and Dendy emulator.  It supports NTSC (USA/JPN), PAL
+(European), and NTSC-PAL Hybrid modes.
+
+The FCEUX concept is that of an "all in one" emulator that offers
+accurate emulation and the best options for both casual play and a
+variety of more advanced emulator functions.  For pro users, FCEUX
+offers tools for debugging, rom-hacking, map making, Tool-assisted
+movies, and Lua scripting
+
+FCEUX is an evolution of the original FCE Ultra emulator.  Over time
+FCE Ultra had separated into many distinct branches.  The concept behind
+FCEUX is to merge elements from FCEU Ultra, FCEU rerecording, FCEUXD,
+FCEUXDSP, FCEUXDSP CE, and FCEU-mm into a single branch of FCEU.
+
+As the X implies, it is an all-encompassing version of the FCEU emulator
+that provides the best of all worlds for the general player, the
+ROM-hacking community, and the Tool-Assisted Speedrun Community.
+
+WWW: https://fceux.com
diff --git a/emulators/fceux/pkg-plist b/emulators/fceux/pkg-plist
new file mode 100644
index 000000000000..97655b2af6f2
--- /dev/null
+++ b/emulators/fceux/pkg-plist
@@ -0,0 +1,96 @@
+bin/fceux
+man/man6/fceux.6.gz
+share/applications/fceux.desktop
+%%PORTDOCS%%%%DATADIR%%/fceux.qch
+%%PORTDOCS%%%%DATADIR%%/fceux.qhc
+%%PORTDOCS%%%%DATADIR%%/fceux.qhp
+%%DATADIR%%/luaScripts/AVI-HeadsUpDisplay.lua
+%%DATADIR%%/luaScripts/BoulderDash_AmoebaAI.lua
+%%DATADIR%%/luaScripts/BugsBunnyBirthdayBlowout.lua
+%%DATADIR%%/luaScripts/ButtonCount.lua
+%%DATADIR%%/luaScripts/CustomLagIndicator_RvT.lua
+%%DATADIR%%/luaScripts/Excitingbike-speedometeronly.lua
+%%DATADIR%%/luaScripts/Excitingbike.lua
+%%DATADIR%%/luaScripts/FRKfunctions.lua
+%%DATADIR%%/luaScripts/GUI-iup_button.lua
+%%DATADIR%%/luaScripts/GUI-iup_example.lua
+%%DATADIR%%/luaScripts/Galaxian.lua
+%%DATADIR%%/luaScripts/Gradius-BulletHell.lua
+%%DATADIR%%/luaScripts/JumpingFCEUXWindow.lua
+%%DATADIR%%/luaScripts/Luabot.lua
+%%DATADIR%%/luaScripts/Machrider.lua
+%%DATADIR%%/luaScripts/MegamanII-LaserEyes.lua
+%%DATADIR%%/luaScripts/MemoryWatch.lua
+%%DATADIR%%/luaScripts/Multitrack.lua
+%%DATADIR%%/luaScripts/Multitrack2.lua
+%%DATADIR%%/luaScripts/NightmareElmStreet-4Player.lua
+%%DATADIR%%/luaScripts/PunchOutChallenge.lua
+%%DATADIR%%/luaScripts/PunchOutStats.lua
+%%DATADIR%%/luaScripts/PunchOutTraining.lua
+%%DATADIR%%/luaScripts/RBIBaseball.lua
+%%DATADIR%%/luaScripts/Registerfind(CheatSearch).lua
+%%DATADIR%%/luaScripts/Rewinder.lua
+%%DATADIR%%/luaScripts/SMB-AreaScrambler.lua
+%%DATADIR%%/luaScripts/SMB-CompetitionRecorder.lua
+%%DATADIR%%/luaScripts/SMB-HitBoxes.lua
+%%DATADIR%%/luaScripts/SMB-Jetpack.lua
+%%DATADIR%%/luaScripts/SMB-Lives&HPDisplay.lua
+%%DATADIR%%/luaScripts/SMB-Mouse.lua
+%%DATADIR%%/luaScripts/SMB-Snow.lua
+%%DATADIR%%/luaScripts/SMB2U.lua
+%%DATADIR%%/luaScripts/SMB3-RainbowRiding.lua
+%%DATADIR%%/luaScripts/ShowPalette.lua
+%%DATADIR%%/luaScripts/SoundDisplay.lua
+%%DATADIR%%/luaScripts/SoundDisplay2.lua
+%%DATADIR%%/luaScripts/Sprites.lua
+%%DATADIR%%/luaScripts/SpritesSimple.lua
+%%DATADIR%%/luaScripts/Subtitler.lua
+%%DATADIR%%/luaScripts/TeenageMutantNinjaTurtles.lua
+%%DATADIR%%/luaScripts/UsingLuaBot-Documentation.txt
+%%DATADIR%%/luaScripts/UsingLuaScripting-Documentation.txt
+%%DATADIR%%/luaScripts/UsingLuaScripting-ListofFunctions.txt
+%%DATADIR%%/luaScripts/ZapperDisplay.lua
+%%DATADIR%%/luaScripts/ZapperFun.lua
+%%DATADIR%%/luaScripts/auxlib.lua
+%%DATADIR%%/luaScripts/luabot_framework.lua
+%%DATADIR%%/luaScripts/m_utils.lua
+%%DATADIR%%/luaScripts/scrolling-pitch-display.lua
+%%DATADIR%%/luaScripts/shapedefs.lua
+%%DATADIR%%/luaScripts/taseditor/InputDisplay_for_Selection.lua
+%%DATADIR%%/luaScripts/taseditor/InvertSelection.lua
+%%DATADIR%%/luaScripts/taseditor/RecordBackwards.lua
+%%DATADIR%%/luaScripts/taseditor/ShowNotes.lua
+%%DATADIR%%/luaScripts/taseditor/Swap1P2P.lua
+%%DATADIR%%/luaScripts/taseditor/TrackNoise.lua
+%%DATADIR%%/luaScripts/tetris.lua
+%%DATADIR%%/luaScripts/vnb.lua
+%%DATADIR%%/luaScripts/x_functions.lua
+%%DATADIR%%/luaScripts/x_interface.lua
+%%DATADIR%%/luaScripts/x_smb1enemylist.lua
+%%DATADIR%%/palettes/ASQ_realityA.pal
+%%DATADIR%%/palettes/ASQ_realityB.pal
+%%DATADIR%%/palettes/BMF_final2.pal
+%%DATADIR%%/palettes/BMF_final3.pal
+%%DATADIR%%/palettes/Composite_Direct_FBX.pal
+%%DATADIR%%/palettes/FCEU-13-default_nitsuja.pal
+%%DATADIR%%/palettes/FCEU-15-nitsuja_new.pal
+%%DATADIR%%/palettes/FCEUX.pal
+%%DATADIR%%/palettes/NES_Classic_FBX.pal
+%%DATADIR%%/palettes/NRS_NTSC.pal
+%%DATADIR%%/palettes/NRS_PAL.pal
+%%DATADIR%%/palettes/PC-10.pal
+%%DATADIR%%/palettes/PVM_Style_D93_FBX.pal
+%%DATADIR%%/palettes/RP2C03.pal
+%%DATADIR%%/palettes/RP2C04_0001.pal
+%%DATADIR%%/palettes/RP2C04_0002.pal
+%%DATADIR%%/palettes/RP2C04_0003.pal
+%%DATADIR%%/palettes/RP2C04_0004.pal
+%%DATADIR%%/palettes/SONY_CXA2025AS_US.pal
+%%DATADIR%%/palettes/Smooth_FBX.pal
+%%DATADIR%%/palettes/Unsaturated-V6.pal
+%%DATADIR%%/palettes/Wavebeam.pal
+%%DATADIR%%/palettes/nestopia_rgb.pal
+%%DATADIR%%/palettes/nestopia_yuv.pal
+%%DATADIR%%/palettes/r57shell_PAL.pal
+%%DATADIR%%/tools/taseditor_patterns.txt
+share/pixmaps/fceux1.png