git: 473265be54c0 - main - emulators/vt100: Add port: Simulation of VT100 terminal hardware

From: Juraj Lutter <otis_at_FreeBSD.org>
Date: Tue, 14 Dec 2021 21:36:34 UTC
The branch main has been updated by otis:

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

commit 473265be54c095c939b912db50527ee4627d38ff
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2021-12-14 21:33:41 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2021-12-14 21:33:41 +0000

    emulators/vt100: Add port: Simulation of VT100 terminal hardware
    
    This emulator emulates the internal circuitry and processor of the VT100 for a
    very realistic user experience.
    
    It is slightly patched to work smoothly on FreeBSD.  Some additional quality of
    life patches have been added in discussion with upstream and will be added to a
    future release.
    
    This is a software simulation of the VT100 hardware. The original
    firmware ROM is built in and executed by an 8080 emulator.  Other
    components include video display with character generator ROM, settings
    NVRAM, Intel 8251 USART, and a keyboard matrix scanner.  The Advance
    Video Option is not included.
    
    WWW: https://github.com/larsbrinkhoff/terminal-simulator
    
    PR:             259956
---
 emulators/Makefile                 |  1 +
 emulators/vt100/Makefile           | 32 ++++++++++++++++++++++++++++++++
 emulators/vt100/distinfo           |  3 +++
 emulators/vt100/files/patch-main.c |  9 +++++++++
 emulators/vt100/files/patch-pty.c  |  9 +++++++++
 emulators/vt100/pkg-descr          |  7 +++++++
 6 files changed, 61 insertions(+)

diff --git a/emulators/Makefile b/emulators/Makefile
index 87f32bf6aaf0..ec606176fa43 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -155,6 +155,7 @@
     SUBDIR += vmips
     SUBDIR += vmsbackup
     SUBDIR += vmw
+    SUBDIR += vt100
     SUBDIR += vxtools
     SUBDIR += wine
     SUBDIR += wine-devel
diff --git a/emulators/vt100/Makefile b/emulators/vt100/Makefile
new file mode 100644
index 000000000000..f790f502a8a5
--- /dev/null
+++ b/emulators/vt100/Makefile
@@ -0,0 +1,32 @@
+PORTNAME=	vt100
+DISTVERSION=	0.2
+CATEGORIES=	emulators
+
+MAINTAINER=	fuz@fuz.su
+COMMENT=	Simulation of VT100 terminal hardware
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC:H}/LICENSE
+
+USES=		gl gmake sdl
+USE_GITHUB=	yes
+GH_ACCOUNT=	larsbrinkhoff
+GH_PROJECT=	terminal-simulator
+USE_GL=		gl
+USE_SDL=	image2
+CFLAGS+=	-DSHADERDIR='\"${DATADIR}/\"'
+WRKSRC_SUBDIR=	vt100
+
+PLIST_FILES=	bin/vt100
+PORTDATA=	crt.shader vertex.shader
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/vt100 ${STAGEDIR}${PREFIX}/bin/
+	${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/crt.shader ${STAGEDIR}${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/vertex.shader ${STAGEDIR}${DATADIR}/
+
+do-test:
+	cd ${WRKSRC:H} && ${SH} test/test.sh
+
+.include <bsd.port.mk>
diff --git a/emulators/vt100/distinfo b/emulators/vt100/distinfo
new file mode 100644
index 000000000000..95a64b435a9c
--- /dev/null
+++ b/emulators/vt100/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1638624778
+SHA256 (larsbrinkhoff-terminal-simulator-0.2_GH0.tar.gz) = c03df1d2a4493ef7dd866e329ecb27b8016051bd2173e3405304a2de444b4e49
+SIZE (larsbrinkhoff-terminal-simulator-0.2_GH0.tar.gz) = 72930468
diff --git a/emulators/vt100/files/patch-main.c b/emulators/vt100/files/patch-main.c
new file mode 100644
index 000000000000..955854f1c37e
--- /dev/null
+++ b/emulators/vt100/files/patch-main.c
@@ -0,0 +1,9 @@
+--- main.c.orig	2021-11-20 13:13:34 UTC
++++ main.c
+@@ -1,6 +1,5 @@
+ #include "vt100.h"
+ #include "xsdl.h"
+-#define _XOPEN_SOURCE 600
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <fcntl.h>
diff --git a/emulators/vt100/files/patch-pty.c b/emulators/vt100/files/patch-pty.c
new file mode 100644
index 000000000000..206fab4e9d01
--- /dev/null
+++ b/emulators/vt100/files/patch-pty.c
@@ -0,0 +1,9 @@
+--- pty.c.orig	2021-12-05 10:19:53 UTC
++++ pty.c
+@@ -1,6 +1,3 @@
+-#define _XOPEN_SOURCE 600
+-#define _DEFAULT_SOURCE
+-#define _DARWIN_C_SOURCE
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <unistd.h>
diff --git a/emulators/vt100/pkg-descr b/emulators/vt100/pkg-descr
new file mode 100644
index 000000000000..1a8912ace98e
--- /dev/null
+++ b/emulators/vt100/pkg-descr
@@ -0,0 +1,7 @@
+This is a software simulation of the VT100 hardware. The original
+firmware ROM is built in and executed by an 8080 emulator.  Other
+components include video display with character generator ROM, settings
+NVRAM, Intel 8251 USART, and a keyboard matrix scanner.  The Advance
+Video Option is not included.
+
+WWW: https://github.com/larsbrinkhoff/terminal-simulator