summaryrefslogtreecommitdiff
path: root/emulators/ucon64
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2018-03-07 12:34:55 +0000
committerwiz <wiz@pkgsrc.org>2018-03-07 12:34:55 +0000
commit302e2593c996f69928018a433f21d33d8722bee7 (patch)
tree191e41aac9ffddb5e66b5ecb93d7047c4b77641a /emulators/ucon64
parent67ecf30d50bd0e4ebf75adf60d7fd717625c1d9f (diff)
downloadpkgsrc-302e2593c996f69928018a433f21d33d8722bee7.tar.gz
ucon64: add patches from upstream to improve build on NetBSD.
Bump PKGREVISION.
Diffstat (limited to 'emulators/ucon64')
-rw-r--r--emulators/ucon64/Makefile12
-rw-r--r--emulators/ucon64/PLIST3
-rw-r--r--emulators/ucon64/distinfo15
-rw-r--r--emulators/ucon64/patches/patch-Makefile70
-rw-r--r--emulators/ucon64/patches/patch-backup_libcd64_Makefile54
-rw-r--r--emulators/ucon64/patches/patch-backup_libcd64_cd64io.c39
-rw-r--r--emulators/ucon64/patches/patch-backup_libcd64_cd64io.h19
-rw-r--r--emulators/ucon64/patches/patch-config.mak.in13
-rw-r--r--emulators/ucon64/patches/patch-configure24
-rw-r--r--emulators/ucon64/patches/patch-configure.in27
-rw-r--r--emulators/ucon64/patches/patch-libdiscmage_libdiscmage.h25
-rw-r--r--emulators/ucon64/patches/patch-misc_parallel.c54
-rw-r--r--emulators/ucon64/patches/patch-misc_unzip.h12
13 files changed, 347 insertions, 20 deletions
diff --git a/emulators/ucon64/Makefile b/emulators/ucon64/Makefile
index 3343e6eb1ab..6792eee77be 100644
--- a/emulators/ucon64/Makefile
+++ b/emulators/ucon64/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.11 2018/03/04 15:20:02 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2018/03/07 12:34:55 wiz Exp $
DISTNAME= ucon64-2.1.0-src
PKGNAME= ${DISTNAME:S/-src//}
+PKGREVISION= 1
CATEGORIES= emulators
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ucon64/}
@@ -18,10 +19,17 @@ GNU_CONFIGURE= yes
USE_TOOLS+= gmake
CHECK_PORTABILITY_SKIP+=install_beos.sh
-INSTALLATION_DIRS= bin share/examples/ucon64 share/doc/ucon64/images
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == NetBSD
+MAKE_ENV+= OSTYPE=netbsd
+.endif
+
+INSTALLATION_DIRS= bin lib share/examples/ucon64 share/doc/ucon64/images
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/ucon64 ${DESTDIR}${PREFIX}/bin
+ ${INSTALL_LIB} ${WRKSRC}/libdiscmage/libdiscmage.so ${DESTDIR}${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/[a-z]*.txt \
${DESTDIR}${PREFIX}/share/examples/ucon64
${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/*.html \
diff --git a/emulators/ucon64/PLIST b/emulators/ucon64/PLIST
index 0d7520431ff..d9095b8c831 100644
--- a/emulators/ucon64/PLIST
+++ b/emulators/ucon64/PLIST
@@ -1,5 +1,6 @@
-@comment $NetBSD: PLIST,v 1.3 2018/03/04 15:20:02 wiz Exp $
+@comment $NetBSD: PLIST,v 1.4 2018/03/07 12:34:55 wiz Exp $
bin/ucon64
+lib/libdiscmage.so
share/doc/ucon64/changes.html
share/doc/ucon64/developers.html
share/doc/ucon64/faq.html
diff --git a/emulators/ucon64/distinfo b/emulators/ucon64/distinfo
index e8e20bd4736..d3f81f80155 100644
--- a/emulators/ucon64/distinfo
+++ b/emulators/ucon64/distinfo
@@ -1,9 +1,16 @@
-$NetBSD: distinfo,v 1.8 2018/03/04 15:20:02 wiz Exp $
+$NetBSD: distinfo,v 1.9 2018/03/07 12:34:55 wiz Exp $
SHA1 (ucon64-2.1.0-src.tar.gz) = 83506c965ba4ab6fa7122c9dcebbabe6c553cbc3
RMD160 (ucon64-2.1.0-src.tar.gz) = b3b6b95a44cb50ac7e3634d07b1b50960fb971f8
SHA512 (ucon64-2.1.0-src.tar.gz) = da2dbe8a573e7dc779f69859f4d3508d4818dcfd99b6b397a7b23a2038a1d8c85835fae9e237a1639ec6179e8ceabb95fd0d65f95f963de99bc61024f686580e
Size (ucon64-2.1.0-src.tar.gz) = 1348408 bytes
-SHA1 (patch-Makefile) = 6e9ad6f6c02d109aee3a71f7abb3b68d43cedf15
-SHA1 (patch-libdiscmage_libdiscmage.h) = 07a52a12091c8220ba5fa50fd7926e77c772208d
-SHA1 (patch-misc_unzip.h) = 25434ddffb3ff1f5d69530ff08d70791bd4ac2ba
+SHA1 (patch-Makefile) = 9cfc3c474562d5073099286a9659e4e5d4cf5d2f
+SHA1 (patch-backup_libcd64_Makefile) = b46127daa77cd9516954365897247c8f33088883
+SHA1 (patch-backup_libcd64_cd64io.c) = b47d14bb41708caa5a582444d5f4ef35cda973ea
+SHA1 (patch-backup_libcd64_cd64io.h) = 026c79ecc577e701b27113d369e6c8d977f01d53
+SHA1 (patch-config.mak.in) = 87db3e62bbd5fa94fa83878b227e3ed3ff8920e1
+SHA1 (patch-configure) = a4b89f6885abe731b75f6277bc563ec992f8d0c9
+SHA1 (patch-configure.in) = 3d5a3ecad1b50499b001eda39ec0100d0ed8ee16
+SHA1 (patch-libdiscmage_libdiscmage.h) = 7a5ced96ae619fd843d3b1acdcd28788937cc79a
+SHA1 (patch-misc_parallel.c) = 164137f352049698a2ff4758bd3dda72ab4dadec
+SHA1 (patch-misc_unzip.h) = 3a065530cd80c74985a997459ee67847b8f75864
diff --git a/emulators/ucon64/patches/patch-Makefile b/emulators/ucon64/patches/patch-Makefile
index 13014a8bf18..66aa8d76e9d 100644
--- a/emulators/ucon64/patches/patch-Makefile
+++ b/emulators/ucon64/patches/patch-Makefile
@@ -1,6 +1,6 @@
-$NetBSD: patch-Makefile,v 1.1 2018/03/04 15:20:02 wiz Exp $
+$NetBSD: patch-Makefile,v 1.2 2018/03/07 12:34:55 wiz Exp $
-Do not hardcode -O3.
+Patch from upstream to improve build on NetBSD.
--- Makefile.orig 2017-08-05 23:02:35.000000000 +0000
+++ Makefile
@@ -13,3 +13,69 @@ Do not hardcode -O3.
LDFLAGS0:=$(LDFLAGS)
ifeq ($(findstring darwin,$(OSTYPE)),) # false if OSTYPE contains "darwin"
# On Mac OS X using -s gives the following warning:
+@@ -54,9 +54,14 @@ endif
+
+ else # UNIX, BeOS or Mac OS X (Darwin)
+
++ifdef USE_PARALLEL
+ ifeq ($(findstring openbsd,$(OSTYPE)),openbsd) # for example "openbsd3.4"
+-# i386_iopl() is located in libi386.a
+-LDFLAGS+=$(LIBI386)
++# i386_iopl() is located in libi386.a. Use -lamd64 for amd64_iopl().
++LDFLAGS+=$(LIBIOPL_OPENBSD)
++endif
++ifeq ($(findstring netbsd,$(OSTYPE)),netbsd)
++LDFLAGS+=$(LIBIOPL_NETBSD)
++endif
+ endif
+
+ ifdef USE_DISCMAGE
+@@ -72,10 +77,12 @@ ifdef DLOPEN
+ ifneq ($(OSTYPE),beos)
+ ifeq ($(findstring freebsd,$(OSTYPE)),) # false if OSTYPE contains "freebsd"
+ ifeq ($(findstring openbsd,$(OSTYPE)),) # false if OSTYPE contains "openbsd"
++ifeq ($(findstring netbsd,$(OSTYPE)),) # false if OSTYPE contains "netbsd"
+ LDFLAGS+=-ldl
+ endif
+ endif
+ endif
++endif
+
+ else # DLOPEN
+ ifdef USE_DISCMAGE # GNU specific: "simply expanded variable"
+@@ -231,7 +238,7 @@ ifdef USE_DISCMAGE
+ .PHONY: libdiscmage/$(FULLLIBNAME_DM)
+ libdiscmage/$(FULLLIBNAME_DM):
+ ifeq ($(GCC_WIN),1)
+- cd libdiscmage && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
++ cd libdiscmage && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
+ else
+ ifdef DJGPP
+ cd libdiscmage
+@@ -240,7 +247,7 @@ ifdef DJGPP
+ $(MAKE)
+ cd ..
+ else
+- cd libdiscmage && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
++ cd libdiscmage && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
+ endif # DJGPP
+ endif # GCC_WIN
+ endif # USE_DISCMAGE
+@@ -250,7 +257,7 @@ ifdef USE_LIBCD64
+ #.PHONY: backup/libcd64/libcd64.a Do not force linking an executable.
+ backup/libcd64/libcd64.a:
+ ifeq ($(GCC_WIN),1)
+- cd backup/libcd64 && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
++ cd backup/libcd64 && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
+ else
+ ifdef DJGPP
+ cd backup/libcd64
+@@ -259,7 +266,7 @@ ifdef DJGPP
+ $(MAKE)
+ cd ../..
+ else
+- cd backup/libcd64 && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE)
++ cd backup/libcd64 && CFLAGS="$(CFLAGS0)" LDFLAGS="$(LDFLAGS0)" $(MAKE)
+ endif # DJGPP
+ endif # GCC_WIN
+ endif # USE_LIBCD64
diff --git a/emulators/ucon64/patches/patch-backup_libcd64_Makefile b/emulators/ucon64/patches/patch-backup_libcd64_Makefile
new file mode 100644
index 00000000000..4146e853747
--- /dev/null
+++ b/emulators/ucon64/patches/patch-backup_libcd64_Makefile
@@ -0,0 +1,54 @@
+$NetBSD: patch-backup_libcd64_Makefile,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- backup/libcd64/Makefile.orig 2016-02-11 00:32:59.000000000 +0000
++++ backup/libcd64/Makefile
+@@ -2,9 +2,9 @@ CC=gcc
+
+ ifdef DEBUG
+ # I think we only use gnu99 instead of c99 due to va_args extensions.
+-CFLAGS+=-I. -Wall -W -pg -g -pedantic -ansi -DDEBUG
++CFLAGS+=-I. -Wall -W -std=gnu99 -pg -g -pedantic -ansi -DDEBUG
+ else
+-CFLAGS+=-I. -Wall -W -O6 -funroll-loops -fexpensive-optimizations
++CFLAGS+=-I. -Wall -W -std=gnu99 -O6 -funroll-loops -fexpensive-optimizations
+ endif
+
+ ifndef DJGPP
+@@ -40,14 +40,6 @@ LDFLAGS+=-Wl,--out-implib,libcd64dll.a
+ endif
+ endif
+
+-# The next check is not really specific to FreeBSD or OpenBSD -- the version of
+-# gcc I use is just old.
+-ifeq ($(findstring FreeBSD,$(OSTYPE)),)
+-ifeq ($(findstring OpenBSD,$(OSTYPE)),)
+-CFLAGS+=-std=gnu99
+-endif
+-endif
+-
+
+ DEFAULT_BUILD=1
+
+@@ -90,8 +82,18 @@ endif
+
+ ifeq ($(findstring OpenBSD,$(OSTYPE)),OpenBSD)
+ # i386_iopl() is located in libi386.a (note the .a)
+-LIBS+=/usr/lib/libi386.a
+-LDFLAGS+=-L/usr/lib -li386
++#LIBS+=/usr/lib/libi386.a
++#LDFLAGS+=-li386
++LIBS+=/usr/lib/libamd64.a
++LDFLAGS+=-lamd64
++RAWIO=1
++endif
++
++ifeq ($(findstring NetBSD,$(OSTYPE)),NetBSD)
++#LIBS+=/usr/lib/libi386.a
++#LDFLAGS+=-li386
++LIBS+=/usr/lib/libx86_64.a
++LDFLAGS+=-lx86_64
+ RAWIO=1
+ endif
+
diff --git a/emulators/ucon64/patches/patch-backup_libcd64_cd64io.c b/emulators/ucon64/patches/patch-backup_libcd64_cd64io.c
new file mode 100644
index 00000000000..e66f757f018
--- /dev/null
+++ b/emulators/ucon64/patches/patch-backup_libcd64_cd64io.c
@@ -0,0 +1,39 @@
+$NetBSD: patch-backup_libcd64_cd64io.c,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- backup/libcd64/cd64io.c.orig 2017-07-29 05:55:48.000000000 +0000
++++ backup/libcd64/cd64io.c
+@@ -827,14 +827,29 @@ int cd64_open_rawio(struct cd64_t *cd64)
+ return 0;
+ }
+ }
+-#elif defined __OpenBSD__
+- /* I cannot test i386_set_ioperm(), so I only use i386_iopl() */
++#elif (defined __OpenBSD__ || defined __NetBSD__) && defined __i386__
+ ret = i386_iopl(3);
+ if (ret == -1) {
+ cd64->notice_callback2("i386_iopl: %s", strerror(errno));
+ return 0;
+ }
+-#elif defined __FreeBSD__
++#endif
++#ifdef __x86_64__
++#ifdef __OpenBSD__
++ ret = amd64_iopl(3);
++ if (ret == -1) {
++ cd64->notice_callback2("amd64_iopl: %s", strerror(errno));
++ return 0;
++ }
++#elif defined __NetBSD__
++ ret = x86_64_iopl(3);
++ if (ret == -1) {
++ cd64->notice_callback2("x86_64_iopl: %s", strerror(errno));
++ return 0;
++ }
++#endif
++#endif
++#ifdef __FreeBSD__
+ cd64->portdevfd = open("/dev/io", O_RDWR);
+ if (cd64->portdevfd == -1) {
+ cd64->portdevfd = 0;
diff --git a/emulators/ucon64/patches/patch-backup_libcd64_cd64io.h b/emulators/ucon64/patches/patch-backup_libcd64_cd64io.h
new file mode 100644
index 00000000000..8d630925e19
--- /dev/null
+++ b/emulators/ucon64/patches/patch-backup_libcd64_cd64io.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-backup_libcd64_cd64io.h,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- backup/libcd64/cd64io.h.orig 2015-11-29 19:31:07.000000000 +0000
++++ backup/libcd64/cd64io.h
+@@ -34,10 +34,10 @@ int cd64_xfer_portdev(struct cd64_t *cd6
+ #if defined __linux__ && (defined __i386__ || defined __x86_64__)
+ #include <sys/io.h>
+ #endif
+-#ifdef __OpenBSD__
++#if (defined __OpenBSD__ || defined __NetBSD__) && (defined __i386__ || defined __x86_64__)
+ #include <sys/types.h>
+ #include <machine/sysarch.h>
+-#include <i386/pio.h>
++#include <machine/pio.h>
+ /* pio.h defines several I/O functions & macros, including the macros inb() and
+ * outb(). This shows that using a bit of inline assembly is not such a bad idea
+ * at all. */
diff --git a/emulators/ucon64/patches/patch-config.mak.in b/emulators/ucon64/patches/patch-config.mak.in
new file mode 100644
index 00000000000..d7719d9b4bb
--- /dev/null
+++ b/emulators/ucon64/patches/patch-config.mak.in
@@ -0,0 +1,13 @@
+$NetBSD: patch-config.mak.in,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- config.mak.in.orig 2017-04-26 18:39:41.000000000 +0000
++++ config.mak.in
+@@ -7,4 +7,5 @@
+
+ CC=@CC@
+ CFLAGS+=@DEFS@
+-LIBI386=@LIBI386_MAKE@
++LIBIOPL_OPENBSD=@LIBIOPL_OPENBSD_MAKE@
++LIBIOPL_NETBSD=@LIBIOPL_NETBSD_MAKE@
diff --git a/emulators/ucon64/patches/patch-configure b/emulators/ucon64/patches/patch-configure
new file mode 100644
index 00000000000..65db7026513
--- /dev/null
+++ b/emulators/ucon64/patches/patch-configure
@@ -0,0 +1,24 @@
+$NetBSD: patch-configure,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- configure.orig 2017-04-28 17:02:28.000000000 +0000
++++ configure
+@@ -629,7 +629,7 @@ RANLIB
+ LIBOBJS
+ DEFINE_USB_MAKE
+ DEFINE_ZLIB_MAKE
+-LIBI386_MAKE
++LIBIOPL_NETBSD_MAKE
+ DEFINE_LIBCD64_MAKE
+ DEFINE_DISCMAGE_MAKE
+ DEFINE_DLOPEN_MAKE
+@@ -3300,7 +3300,7 @@ $as_echo "#define USE_LIBCD64 1" >>confd
+
+ DEFINE_LIBCD64_MAKE="USE_LIBCD64=1"
+ else
+- LIBI386_MAKE="-li386"
++ LIBIOPL_NETBSD_MAKE="-lx86_64"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libcd64" >&5
+ $as_echo "$with_libcd64" >&6; }
diff --git a/emulators/ucon64/patches/patch-configure.in b/emulators/ucon64/patches/patch-configure.in
new file mode 100644
index 00000000000..3045a1f1628
--- /dev/null
+++ b/emulators/ucon64/patches/patch-configure.in
@@ -0,0 +1,27 @@
+$NetBSD: patch-configure.in,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- configure.in.orig 2017-04-28 17:01:51.000000000 +0000
++++ configure.in
+@@ -139,13 +139,16 @@ if test $with_libcd64 = yes; then
+ AC_DEFINE(USE_LIBCD64, 1, [build with libcd64 support (default: no)])
+ DEFINE_LIBCD64_MAKE="USE_LIBCD64=1"
+ else
+- dnl libi386 is necessary under OpenBSD, but only if libcd64 isn't enabled. The
+- dnl reason is that libcd64 already (statically) links to libi386.
+- LIBI386_MAKE="-li386"
++ dnl libi386 or libamd64 is necessary on OpenBSD, but only if libcd64 isn't
++ dnl enabled, because libcd64 already links to libi386 or libamd64.
++dnl LIBIOPL_MAKE="-li386"
++ LIBIOPL_OPENBSD_MAKE="-lamd64"
++ LIBIOPL_NETBSD_MAKE="-lx86_64"
+ fi
+ AC_MSG_RESULT($with_libcd64)
+ AC_SUBST(DEFINE_LIBCD64_MAKE)
+-AC_SUBST(LIBI386_MAKE)
++AC_SUBST(LIBIOPL_OPENBSD_MAKE)
++AC_SUBST(LIBIOPL_NETBSD_MAKE)
+
+
+ AC_MSG_CHECKING(whether to build without gzip and zip support)
diff --git a/emulators/ucon64/patches/patch-libdiscmage_libdiscmage.h b/emulators/ucon64/patches/patch-libdiscmage_libdiscmage.h
index 3372020e4e7..28f69999fd4 100644
--- a/emulators/ucon64/patches/patch-libdiscmage_libdiscmage.h
+++ b/emulators/ucon64/patches/patch-libdiscmage_libdiscmage.h
@@ -1,15 +1,28 @@
-$NetBSD: patch-libdiscmage_libdiscmage.h,v 1.1 2018/03/04 15:20:02 wiz Exp $
+$NetBSD: patch-libdiscmage_libdiscmage.h,v 1.2 2018/03/07 12:34:55 wiz Exp $
-Fix build on NetBSD.
+Patch from upstream to improve build on NetBSD.
--- libdiscmage/libdiscmage.h.orig 2015-11-16 01:33:49.000000000 +0000
+++ libdiscmage/libdiscmage.h
-@@ -28,7 +28,7 @@ extern "C" {
+@@ -1,8 +1,8 @@
+ /*
+ libdiscmage.h - libdiscmage
+
+-Copyright (c) 2002 - 2004 NoisyB
+-Copyright (c) 2002 - 2004 dbjh
++Copyright (c) 2002 - 2004 NoisyB
++Copyright (c) 2002 - 2004, 2018 dbjh
+
+
+ This library is free software; you can redistribute it and/or
+@@ -28,9 +28,7 @@ extern "C" {
#include <stdio.h> // FILENAME_MAX
-#if defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__ || \
-+#if defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__ || defined(__NetBSD__) \
- defined __solaris__ || defined __MINGW32__ || defined __CYGWIN__ || \
- defined __BEOS__ || defined AMIGA || defined __APPLE__ // Mac OS X actually
+- defined __solaris__ || defined __MINGW32__ || defined __CYGWIN__ || \
+- defined __BEOS__ || defined AMIGA || defined __APPLE__ // Mac OS X actually
++#if !(defined __MSDOS__ || defined _MSC_VER)
// We cannot use config.h (for HAVE_INTTYPES_H), because this header file may be
+ // installed in a system include directory
+ #include <inttypes.h>
diff --git a/emulators/ucon64/patches/patch-misc_parallel.c b/emulators/ucon64/patches/patch-misc_parallel.c
new file mode 100644
index 00000000000..76b016537ae
--- /dev/null
+++ b/emulators/ucon64/patches/patch-misc_parallel.c
@@ -0,0 +1,54 @@
+$NetBSD: patch-misc_parallel.c,v 1.1 2018/03/07 12:34:55 wiz Exp $
+
+Patch from upstream to improve build on NetBSD.
+
+--- misc/parallel.c.orig 2017-10-25 17:32:00.000000000 +0000
++++ misc/parallel.c
+@@ -45,10 +45,10 @@ Foundation, Inc., 675 Mass Ave, Cambridg
+ #else
+ #error No sys/io.h; configure with --disable-parallel
+ #endif
+-#elif defined __OpenBSD__ // __linux__ && __GLIBC__
++#elif defined __OpenBSD__ || defined __NetBSD__ // __linux__ && __GLIBC__
+ #include <machine/sysarch.h>
+ #include <sys/types.h>
+-#elif defined __BEOS__ || defined __FreeBSD__ // __OpenBSD__
++#elif defined __BEOS__ || defined __FreeBSD__ // __OpenBSD__ || __NetBSD__
+ #include <fcntl.h>
+ #elif defined AMIGA // __BEOS__ || __FreeBSD__
+ #include <fcntl.h>
+@@ -698,7 +698,7 @@ parport_open (unsigned short port)
+ } // causes core dump
+ #endif // __linux__ && (__i386__ || __x86_64__) && !USE_PPDEV
+
+-#ifdef __OpenBSD__ // || defined __NetBSD__, add after feature request ;-)
++#if (defined __OpenBSD__ || defined __NetBSD__) && defined __i386__
+ // We use i386_iopl() on OpenBSD for the same reasons we use iopl() on Linux
+ // (i386_set_ioperm() has the same limitation as ioperm()).
+ if (i386_iopl (3) == -1)
+@@ -709,6 +709,25 @@ parport_open (unsigned short port)
+ exit (1);
+ }
+ #endif
++#ifdef __x86_64__
++#ifdef __OpenBSD__
++ if (amd64_iopl (3) == -1)
++ {
++ fputs ("ERROR: Could not set the I/O privilege level to 3\n"
++ " (This program needs root privileges for the requested action)\n",
++ stderr);
++ exit (1);
++ }
++#elif defined __NetBSD__
++ if (x86_64_iopl (3) == -1)
++ {
++ fputs ("ERROR: Could not set the I/O privilege level to 3\n"
++ " (This program needs root privileges for the requested action)\n",
++ stderr);
++ exit (1);
++ }
++#endif
++#endif
+
+ #if (defined __i386__ || defined __x86_64__ || defined _WIN32) && !defined USE_PPDEV
+
diff --git a/emulators/ucon64/patches/patch-misc_unzip.h b/emulators/ucon64/patches/patch-misc_unzip.h
index 54892a01b96..74474973671 100644
--- a/emulators/ucon64/patches/patch-misc_unzip.h
+++ b/emulators/ucon64/patches/patch-misc_unzip.h
@@ -1,16 +1,18 @@
-$NetBSD: patch-misc_unzip.h,v 1.1 2018/03/04 15:20:02 wiz Exp $
+$NetBSD: patch-misc_unzip.h,v 1.2 2018/03/07 12:34:55 wiz Exp $
-Define OF() macro that's not available everywhere.
+Patch from upstream to improve build on NetBSD.
--- misc/unzip.h.orig 2016-03-03 14:12:07.000000000 +0000
+++ misc/unzip.h
-@@ -48,6 +48,9 @@
- #ifdef __cplusplus
+@@ -49,6 +49,11 @@
extern "C" {
#endif
+
++// On NetBSD, OF is not defined in zconf.h, which is included by zlib.h.
+#ifndef OF
+#define OF(x) x
+#endif
-
++
#ifndef _ZLIB_H
#include "zlib.h"
+ #endif