summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2004-11-22 12:27:16 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2004-11-22 12:27:16 +0000
commit59439582e5d5d8881fab554baa7df4c9383037cc (patch)
treec9f3a732b40cffc1e6748c421f15108a12bb0f5c /emulators
parentUpgrade to staroffice 7 product update IV. (diff)
- Add SX ROM revision E (rev J does not work)
- Fix terminal allocation code under FreeBSD - Catch up with PHK's cuaa->cuad rework in -CURRENT - Avoid direct use of `unzip' command in Makefile in favor of ${UNZIP_CMD} - Utilize DATADIR and DOCSDIR marcos in pkg-plist - SIZEify - Take maintainership Approved by: fjoe (mentor, implicit)
Notes
Notes: svn path=/head/; revision=122137
Diffstat (limited to 'emulators')
-rw-r--r--emulators/x48/Makefile19
-rw-r--r--emulators/x48/distinfo5
-rw-r--r--emulators/x48/files/patch-Imakefile9
-rw-r--r--emulators/x48/files/patch-src+global.h25
-rw-r--r--emulators/x48/files/patch-src+serial.c49
-rw-r--r--emulators/x48/pkg-plist13
6 files changed, 98 insertions, 22 deletions
diff --git a/emulators/x48/Makefile b/emulators/x48/Makefile
index 97288bd99290..358173d1b6f3 100644
--- a/emulators/x48/Makefile
+++ b/emulators/x48/Makefile
@@ -7,13 +7,14 @@
PORTNAME= x48
PORTVERSION= 0.4.1e
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://www.hpcalc.org/hp48/pc/emulators/
DISTFILES= ${PORTNAME}-${PORTVERSION:S/.//g}.tgz \
- gxrom-r.zip
+ gxrom-r.zip sxrom-e.zip
EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION:S/.//g}.tgz
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= danfe@FreeBSD.org
COMMENT= A HP48 SX/GX calculator emulator
BUILD_DEPENDS= unzip:${PORTSDIR}/archivers/unzip
@@ -23,14 +24,22 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:S/e//}
USE_IMAKE= yes
NO_INSTALL_MANPAGES= yes
USE_REINPLACE= yes
+
ROMPATH= ${PREFIX}/share/x48
+.include <bsd.port.pre.mk>
+
post-patch:
@${REINPLACE_CMD} -e 's+rom.dump+${ROMPATH}/gxrom-r+' \
- ${WRKSRC}/src/dump2rom.c ${WRKSRC}/src/X48.ad
+ ${WRKSRC}/src/X48.ad
+.if ${OSVERSION} > 600004
+ @${REINPLACE_CMD} -e 's+cuaa+cuad+' ${WRKSRC}/src/X48.ad
+.endif
+
post-install:
@${MKDIR} ${ROMPATH}
- @unzip ${DISTDIR}/${DISTSUBDIR}/gxrom-r -d ${ROMPATH}
+ ${UNZIP_CMD} ${DISTDIR}/${DISTSUBDIR}/gxrom-r -d ${ROMPATH}
+ ${UNZIP_CMD} -p ${DISTDIR}/${DISTSUBDIR}/sxrom-e > ${ROMPATH}/sxrom-e
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for file in README doc/CARDS.doc doc/ROMDump.doc
@@ -38,4 +47,4 @@ post-install:
.endfor
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/emulators/x48/distinfo b/emulators/x48/distinfo
index ce2fa7aab94e..b21767b196f8 100644
--- a/emulators/x48/distinfo
+++ b/emulators/x48/distinfo
@@ -1,3 +1,6 @@
MD5 (x48-041e.tgz) = 0f03da2cea0ca3fd690dcae00f088faa
+SIZE (x48-041e.tgz) = 470212
MD5 (gxrom-r.zip) = e4ec80ac325313b006b8c94d9be8db5a
-MD5 (sxrom-j.zip) = 8f61e9ee00562e94c485028eac311cf8
+SIZE (gxrom-r.zip) = 330144
+MD5 (sxrom-e.zip) = 2fe83de489d09ed4ab7787ad01092029
+SIZE (sxrom-e.zip) = 188027
diff --git a/emulators/x48/files/patch-Imakefile b/emulators/x48/files/patch-Imakefile
index 3513e6ecee95..ed681d40d230 100644
--- a/emulators/x48/files/patch-Imakefile
+++ b/emulators/x48/files/patch-Imakefile
@@ -1,5 +1,14 @@
--- src/Imakefile.orig Sun Jul 4 17:04:21 1999
+++ src/Imakefile Sat Jun 28 19:01:04 2003
+@@ -26,7 +26,7 @@
+ UTILS = $(TOP)/utils
+ READLINE = $(TOP)/readline
+ READLINELIB = $(READLINE)/libreadline.a
+-EXTRA_LIBRARIES =
++EXTRA_LIBRARIES = -lutil
+
+ #ifdef HAVE_XSHM
+ # define XSHM_DEF -DHAVE_XSHM
@@ -60,7 +60,7 @@
LDOPTIONS = LDOPTIONS_DEF
#endif
diff --git a/emulators/x48/files/patch-src+global.h b/emulators/x48/files/patch-src+global.h
new file mode 100644
index 000000000000..cfa5b53e5848
--- /dev/null
+++ b/emulators/x48/files/patch-src+global.h
@@ -0,0 +1,25 @@
+--- src/global.h.orig Tue Sep 7 22:41:45 1999
++++ src/global.h Mon Nov 22 17:03:53 2004
+@@ -79,6 +79,14 @@
+
+ #else /* Not Linux */
+
++#if defined(__FreeBSD__)
++
++#ifndef FREEBSD
++#define FREEBSD 1
++#endif
++
++#else /* Not FreeBSD */
++
+ #if defined(sun) && defined(unix)
+
+ #if defined(__svr4__) || defined(SVR4) || defined(SYSV)
+@@ -106,6 +114,7 @@
+ #endif /* Not HP-UX */
+ #endif /* Not Solaris */
+ #endif /* Sun && Unix */
++#endif /* Not FreeBSD */
+ #endif /* Not Linux */
+
+ #ifdef SYSV
diff --git a/emulators/x48/files/patch-src+serial.c b/emulators/x48/files/patch-src+serial.c
index bcc52d4d5c65..9a4ebf77dee9 100644
--- a/emulators/x48/files/patch-src+serial.c
+++ b/emulators/x48/files/patch-src+serial.c
@@ -18,7 +18,36 @@
#include <sys/termios.h>
#endif
-@@ -238,7 +240,7 @@
+@@ -135,8 +137,23 @@
+
+ wire_fd = -1;
+ ttyp = -1;
++#ifdef FREEBSD
++ int tty_m, tty_s;
++#endif
+ if (useTerminal)
+ {
++#ifdef FREEBSD
++ if (openpty(&tty_m, &tty_s, tty_dev_name, NULL, NULL) == 0)
++ {
++ if (verbose)
++ printf("%s: wire connection on %s\n", progname, tty_dev_name);
++ wire_fd = tty_m;
++ ttyp = tty_s;
++ wire_name = strdup(tty_dev_name);
++ }
++ else
++ perror("openpty");
++#else /* FREEBSD */
+ #ifdef IRIX
+ if ((p = _getpty(&wire_fd, O_RDWR | O_EXCL | O_NDELAY, 0666, 0)) == NULL)
+ {
+@@ -234,11 +251,12 @@
+ #endif /* LINUX */
+ #endif /* SOLARIS */
+ #endif /* IRIX */
++#endif /* FREEBSD */
+ }
if (ttyp >= 0)
{
@@ -27,7 +56,7 @@
if (tcgetattr(ttyp, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0)
-@@ -263,7 +265,7 @@
+@@ -263,7 +281,7 @@
if (ttyp >= 0)
{
@@ -36,7 +65,7 @@
if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0)
-@@ -291,7 +293,7 @@
+@@ -291,7 +309,7 @@
if (ir_fd >= 0)
{
@@ -45,7 +74,7 @@
if (tcgetattr(ir_fd, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0)
-@@ -315,7 +317,7 @@
+@@ -315,7 +333,7 @@
if (ir_fd >= 0)
{
@@ -54,7 +83,7 @@
if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0)
-@@ -344,7 +346,7 @@
+@@ -344,7 +362,7 @@
if (ir_fd >= 0)
{
@@ -63,7 +92,7 @@
if (tcgetattr(ir_fd, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0)
-@@ -358,6 +360,10 @@
+@@ -358,6 +376,10 @@
}
}
@@ -74,7 +103,7 @@
ttybuf.c_cflag &= ~CBAUD;
baud &= 0x7;
-@@ -404,9 +410,11 @@
+@@ -404,9 +426,11 @@
ttybuf.c_cflag |= B9600;
}
@@ -87,7 +116,7 @@
if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0)
-@@ -422,7 +430,7 @@
+@@ -422,7 +446,7 @@
if (ttyp >= 0)
{
@@ -96,7 +125,7 @@
if (tcgetattr(ttyp, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0)
-@@ -437,6 +445,9 @@
+@@ -437,6 +461,9 @@
}
}
@@ -106,7 +135,7 @@
ttybuf.c_cflag &= ~CBAUD;
baud &= 0x7;
-@@ -482,10 +493,11 @@
+@@ -482,10 +509,11 @@
fprintf(stderr, "%s: can\'t set baud rate, using 9600\n", progname);
ttybuf.c_cflag |= B9600;
}
diff --git a/emulators/x48/pkg-plist b/emulators/x48/pkg-plist
index dda3be31352d..ba2b097c9ae6 100644
--- a/emulators/x48/pkg-plist
+++ b/emulators/x48/pkg-plist
@@ -3,9 +3,10 @@ bin/dump2rom
bin/mkcard
bin/x48
lib/X11/app-defaults/X48
-share/x48/gxrom-r
-@dirrm share/x48
-%%PORTDOCS%%share/doc/x48/CARDS.doc
-%%PORTDOCS%%share/doc/x48/README
-%%PORTDOCS%%share/doc/x48/ROMDump.doc
-%%PORTDOCS%%@dirrm share/doc/x48
+%%DATADIR%%/gxrom-r
+%%DATADIR%%/sxrom-e
+@dirrm %%DATADIR%%
+%%PORTDOCS%%%%DOCSDIR%%/CARDS.doc
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/ROMDump.doc
+%%PORTDOCS%%@dirrm %%DOCSDIR%%