diff --git a/app-text/htmldoc/htmldoc-1.9.1.recipe b/app-text/htmldoc/htmldoc-1.9.1.recipe
deleted file mode 100644
index 0d97b0883..000000000
--- a/app-text/htmldoc/htmldoc-1.9.1.recipe
+++ /dev/null
@@ -1,52 +0,0 @@
-SUMMARY="HTML file processor and converter"
-DESCRIPTION="HTMLDOC converts HTML files and web pages into index HTML, \
-Adobe Postscript or Adobe Portable Document Format files (pdf)."
-HOMEPAGE="https://www.msweet.org/htmldoc/index.html"
-COPYRIGHT="1997-2006 Easy Software Products"
-LICENSE="GNU GPL v2"
-REVISION="3"
-SOURCE_URI="https://github.com/michaelrsweet/htmldoc/releases/download/v$portVersion/htmldoc-$portVersion-source.tar.gz"
-CHECKSUM_SHA256="cbee52b9e6f5485086db1b86d7ed0609925fef325a88cf96a6d11a5859117094"
-SOURCE_DIR=""
-PATCHES="htmldoc-$portVersion.patchset"
-
-ARCHITECTURES="all"
-
-PROVIDES="
- htmldoc = $portVersion compat >= 1.8
- cmd:htmldoc = $portVersion compat >= 1.8
- "
-REQUIRES="
- haiku
- lib:libjpeg
- lib:libpng16
- lib:libz
- "
-
-BUILD_REQUIRES="
- devel:libjpeg
- devel:libpng16
- devel:libz
- "
-BUILD_PREREQUIRES="
- haiku_devel
- cmd:autoconf
- cmd:gcc
- cmd:ld
- cmd:make
- cmd:sed
- "
-
-BUILD()
-{
- touch doc/htmldoc.1
- autoconf
- chmod 755 configure
- runConfigure ./configure
- make $jobArgs
-}
-
-INSTALL()
-{
- make install
-}
diff --git a/app-text/htmldoc/htmldoc-1.9.16.recipe b/app-text/htmldoc/htmldoc-1.9.16.recipe
new file mode 100644
index 000000000..62a3f4570
--- /dev/null
+++ b/app-text/htmldoc/htmldoc-1.9.16.recipe
@@ -0,0 +1,63 @@
+SUMMARY="HTML file processor and converter"
+DESCRIPTION="HTMLDOC converts HTML files and web pages into index HTML, \
+Adobe Postscript or Adobe Portable Document Format files (pdf)."
+HOMEPAGE="https://www.msweet.org/htmldoc/index.html"
+COPYRIGHT="1997-2006 Easy Software Products"
+LICENSE="GNU GPL v2"
+REVISION="1"
+SOURCE_URI="https://github.com/michaelrsweet/htmldoc/releases/download/v$portVersion/htmldoc-$portVersion-source.tar.gz"
+CHECKSUM_SHA256="b1086385c4c16cdabe428ab1aa041266baebee39f222cf6a3947b41027b7dae3"
+PATCHES="htmldoc-$portVersion.patchset"
+
+ARCHITECTURES="all !x86_gcc2"
+SECONDARY_ARCHITECTURES="x86"
+
+# we only want the binaries for primary architecture
+commandBinDir=$binDir
+commandSuffix=$secondaryArchSuffix
+if [ "$targetArchitecture" = x86_gcc2 ]; then
+ commandSuffix=
+ commandBinDir=$prefix/bin
+fi
+
+PROVIDES="
+ htmldoc$secondaryArchSuffix = $portVersion compat >= 1.8
+ cmd:htmldoc$commandSuffix = $portVersion compat >= 1.8
+ "
+REQUIRES="
+ haiku$secondaryArchSuffix
+ lib:libjpeg$secondaryArchSuffix
+ lib:libgnutls$secondaryArchSuffix
+ lib:libpng16$secondaryArchSuffix
+ lib:libz$secondaryArchSuffix
+ "
+
+BUILD_REQUIRES="
+ haiku${secondaryArchSuffix}_devel
+ devel:libjpeg$secondaryArchSuffix
+ devel:libgnutls$secondaryArchSuffix
+ devel:libgcrypt$secondaryArchSuffix
+ devel:libpng16$secondaryArchSuffix
+ devel:libz$secondaryArchSuffix
+ "
+BUILD_PREREQUIRES="
+ cmd:autoconf
+ cmd:gcc$secondaryArchSuffix
+ cmd:ld$secondaryArchSuffix
+ cmd:make
+ cmd:pkg_config$secondaryArchSuffix
+# cmd:sed
+ "
+
+BUILD()
+{
+ autoconf
+ runConfigure --omit-dirs binDir ./configure \
+ --bindir=$commandBinDir
+ make $jobArgs
+}
+
+INSTALL()
+{
+ make install
+}
diff --git a/app-text/htmldoc/patches/htmldoc-1.9.1.patchset b/app-text/htmldoc/patches/htmldoc-1.9.16.patchset
similarity index 80%
rename from app-text/htmldoc/patches/htmldoc-1.9.1.patchset
rename to app-text/htmldoc/patches/htmldoc-1.9.16.patchset
index 4af8fc166..7f12ac2ab 100644
--- a/app-text/htmldoc/patches/htmldoc-1.9.1.patchset
+++ b/app-text/htmldoc/patches/htmldoc-1.9.16.patchset
@@ -1,14 +1,14 @@
-From 31c65e31db8832f8861c1fe204eba5a1e1f2376d Mon Sep 17 00:00:00 2001
+From efca126ccc5e956b8fe535d04170fd0b12f9083f Mon Sep 17 00:00:00 2001
From: Scott McCreary
Date: Mon, 23 May 2011 16:13:13 +0000
Subject: Fixed directories for htmldoc.
diff --git a/configure.ac b/configure.ac
-index c7d00d5..c759932 100644
+index 7fa027a..a10b476 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -102,7 +102,7 @@ AC_SUBST(LDFLAGS)
+@@ -130,7 +130,7 @@ AC_SUBST(LDFLAGS)
AC_CHECK_LIB(m,pow)
AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL))
@@ -18,18 +18,18 @@ index c7d00d5..c759932 100644
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
diff --git a/htmldoc/http.h b/htmldoc/http.h
-index ab2d1f9..b67db14 100644
+index fc5983d..7678eda 100644
--- a/htmldoc/http.h
+++ b/htmldoc/http.h
-@@ -79,6 +79,8 @@ extern "C" {
+@@ -117,6 +117,8 @@ extern "C" {
# define s6_addr32 _S6_un._S6_u32
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
# define s6_addr32 __u6_addr.__u6_addr32
+# elif defined(__HAIKU__)
+# define s6_addr32 s6_addr
- # elif defined(WIN32)
+ # elif defined(_WIN32)
/*
* Windows only defines byte and 16-bit word members of the union and
--
-2.13.1
+2.37.3