Skip to content

Instantly share code, notes, and snippets.

@shkhln
Last active July 18, 2019 20:27
Show Gist options
  • Save shkhln/63e2af7893d0e8da43aece13d9906284 to your computer and use it in GitHub Desktop.
Save shkhln/63e2af7893d0e8da43aece13d9906284 to your computer and use it in GitHub Desktop.
diff --git a/Mk/Uses/lib32.mk b/Mk/Uses/lib32.mk
new file mode 100644
index 000000000000..cd57d53b8ae5
--- /dev/null
+++ b/Mk/Uses/lib32.mk
@@ -0,0 +1,121 @@
+# $FreeBSD$
+#
+# Create a 'lib32-' companion port.
+#
+# For ports need to ship 32-bit components, or who have dependant's who need
+# 32-bit libraries.
+#
+# A port that needs a 'lib32-' companion port must:
+# - Add USES=lib32
+# - Create a slave port, in the same category, with a prefix 'lib32-'
+# - The slave port needs to:
+# - Define 'USE_LIB32'
+# - Set 'MASTERDIR' to the port without the 'lib32-' prefix
+# - Include '${MASTERDIR}/Makefile'
+#
+# For the 'lib32-' companion port the following are done:
+# - Add 'lib32-' to PKGNAMEPREFIX
+# - Patch various variables to use the 'lib32' directory instead of 'lib'
+# - Patch the pkg-plist to only include files installed under 'lib32'
+#
+# Usage:
+# USES=lib32
+#
+# Variables set by lib32:
+#
+# LIBDIR The path to the library directory
+# ${PREFIX}/lib; or
+# ${PREFIX}/lib32
+
+.if !defined(_LIB32_MK_INCLUDED)
+_LIB32_MK_INCLUDED= lib32.mk
+_USES_POST+= lib32
+
+. if defined(USE_LIB32)
+ONLY_FOR_ARCHS= amd64
+ONLY_FOR_ARCHS_REASON= 32-bit libraries only applicable on amd64
+LIBDIR= ${PREFIX}/lib32
+LDFLAGS+= -L/usr/lib32 -Wl,-rpath,/usr/lib32 # ?
+. else
+LIBDIR= ${PREFIX}/lib
+. endif
+
+.endif // _LIB32_MK_INCLUDED
+
+.if defined(_POSTMKINCLUDED) && !defined(_LIB32_MK_POST_INCLUDED)
+_LIB32_MK_POST_INCLUDED= yes
+
+. if defined(USE_LIB32)
+PKGNAMEPREFIX:= lib32-${PKGNAMEPREFIX}
+
+. if ${USES:Mlocalbase*}
+. include "${USESDIR}/localbase.mk"
+. endif
+
+. if defined(LIBS)
+LIBS:=${LIBS:S|${LOCALBASE}/lib|${LOCALBASE}/lib32|g}
+. endif
+
+#TODO: ICONV_LIB_PATH?
+
+. if defined(BUILD_DEPENDS)
+BUILD_DEPENDS:= ${BUILD_DEPENDS:C|${LOCALBASE}/libdata/pkgconfig/([^:]+):([^/]*)/(.*)|${LOCALBASE}/libdata/pkgconfig32/\1:\2/lib32-\3|g}
+. endif
+
+. if defined(RUN_DEPENDS)
+# xorgproto
+RUN_DEPENDS:= ${RUN_DEPENDS:C|${LOCALBASE}/libdata/pkgconfig/([^:]+):([^/]*)/(.*)|${LOCALBASE}/libdata/pkgconfig32/\1:\2/lib32-\3|g}
+. endif
+
+. if defined(LIB_DEPENDS)
+LIB32_DEPENDS:= ${LIB_DEPENDS:C|([^:]*):([^/]*)/(.*)|${LOCALBASE}/lib32/\1:\2/lib32-\3|g}
+BUILD_DEPENDS+= ${LIB32_DEPENDS}
+RUN_DEPENDS+= ${LIB32_DEPENDS}
+. undef LIB_DEPENDS
+. endif
+
+. if defined(USE_GL)
+BUILD_DEPENDS:= ${BUILD_DEPENDS:C!${LOCALBASE}/lib/lib(GL|EGL|GLESv2).so:graphics/mesa-libs!${LOCALBASE}/lib32/lib\1.so:graphics/lib32-mesa-libs!g}
+RUN_DEPENDS:= ${RUN_DEPENDS:C!${LOCALBASE}/lib/lib(GL|EGL|GLESv2).so:graphics/mesa-libs!${LOCALBASE}/lib32/lib\1.so:graphics/lib32-mesa-libs!g}
+. endif
+
+. for flags in CFLAGS CPPFLAGS
+${flags}:= ${${flags}:S|${LOCALBASE}/lib|${LOCALBASE}/lib32|g} -m32
+. endfor
+
+. if !defined(USE_LDCONFIG32)
+. if !defined(USE_LDCONFIG) || ${USE_LDCONFIG} == yes
+USE_LDCONFIG32:=${LIBDIR}
+. else
+USE_LDCONFIG32:=${USE_LDCONFIG:S|${PREFIX}/lib$$|${LIBDIR}|g}
+. endif
+. endif
+. undef USE_LDCONFIG
+
+PKG_CONFIG_PATH=${PREFIX}/libdata/pkgconfig32
+. export-env PKG_CONFIG_PATH
+
+. if defined(HAS_CONFIGURE) || defined(GNU_CONFIGURE)
+CONFIGURE_ARGS:=${CONFIGURE_ARGS:C|${LOCALBASE}/lib([^0-9a-z])|${LOCALBASE}/lib32\1|g:C|${LOCALBASE}/lib$$|${LOCALBASE}/lib32|g} --libdir=${LIBDIR}
+. elif ${USES:Mcmake*}
+CMAKE_ARGS+=-DCMAKE_INSTALL_LIBDIR:STRING="lib32"
+. endif
+
+_USES_stage+= 805:post-stage-lib32 935:post-plist-lib32
+
+post-stage-lib32:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/libdata/pkgconfig32
+ for p in libdata/pkgconfig lib32/pkgconfig; do \
+ if test -d ${STAGEDIR}${PREFIX}/$$p; then \
+ ${FIND} ${STAGEDIR}${PREFIX}/$$p -name "*.pc" -exec mv {} ${STAGEDIR}${PREFIX}/libdata/pkgconfig32 \;; \
+ fi \
+ done
+
+LIB32_PATTERN= (^lib\/|^@post(un)?exec .* ldconfig|${PREFIX:S|/|\/|g}\/share\/licenses|${PREFIX:S|/|\/|g}\/libdata\/ldconfig32|^libdata\/pkgconfig32)
+
+post-plist-lib32:
+ ${SED} -E -e '/${LIB32_PATTERN}/d' -e '/^@/d' -e 's|^|${STAGEDIR}${PREFIX}/|g' ${TMPPLIST} | ${XARGS} ${RM}
+ ${REINPLACE_CMD} -E -e 's|^libdata/pkgconfig/|libdata/pkgconfig32/|g' -e '/${LIB32_PATTERN}/!d' -e 's|^lib/|lib32/|g' ${TMPPLIST}
+
+. endif
+.endif // _LIB32_MK_POST_INCLUDED
diff --git a/Mk/Uses/ssl.mk b/Mk/Uses/ssl.mk
index 2de01295cb3b..6975018137b1 100644
--- a/Mk/Uses/ssl.mk
+++ b/Mk/Uses/ssl.mk
@@ -104,11 +104,20 @@ BUILD_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_POR
. if defined(_SSL_RUN_DEP)
RUN_DEPENDS+= ${LOCALBASE}/lib/libcrypto.so.${OPENSSL_SHLIBVER}:${OPENSSL_PORT}
. endif
+. if defined(USE_LIB32)
+OPENSSLRPATH= ${LOCALBASE}/lib32 # ?
+. else
OPENSSLRPATH= ${LOCALBASE}/lib
+. endif
.endif
+.if defined(USE_LIB32)
+OPENSSLLIB= ${OPENSSLBASE}/lib32 # ?
+.else
OPENSSLLIB= ${OPENSSLBASE}/lib
+.endif
+
OPENSSLINC= ${OPENSSLBASE}/include
MAKE_ENV+= OPENSSLBASE=${OPENSSLBASE}
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 8c01f2ce510e..5ced9f78335b 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1962,9 +1962,13 @@ MAKE_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}
.if defined(USE_XORG)
# Add explicit X options to avoid problems with false positives in configure
.if defined(GNU_CONFIGURE)
+.if defined(USE_LIB32)
+CONFIGURE_ARGS+=--x-libraries=${LIBDIR} --x-includes=${LOCALBASE}/include
+.else
CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
.endif
.endif
+.endif
# Macro for doing in-place file editing using regexps
REINPLACE_ARGS?= -i.bak
@@ -3466,7 +3470,7 @@ install-ldconfig-file:
. endif
. endif
. if defined(USE_LDCONFIG32)
-. if !defined(INSTALL_AS_USER)
+. if ${USE_LDCONFIG32} != "${LOCALBASE}/lib32" && !defined(INSTALL_AS_USER)
@${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
. if defined(NO_MTREE) || ${PREFIX} != ${LOCALBASE}
@${MKDIR} ${STAGEDIR}${LOCALBASE}/${LDCONFIG32_DIR}
diff --git a/audio/Makefile b/audio/Makefile
index 8d025b1ce285..0a79f098e2b0 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -368,6 +368,7 @@
SUBDIR += ladspa
SUBDIR += lame
SUBDIR += lash
+ SUBDIR += lib32-openal-soft
SUBDIR += liba52
SUBDIR += libaacplus
SUBDIR += libadplug
diff --git a/audio/lib32-openal-soft/Makefile b/audio/lib32-openal-soft/Makefile
new file mode 100644
index 000000000000..7e25cefd4453
--- /dev/null
+++ b/audio/lib32-openal-soft/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../openal-soft
+
+.include "${MASTERDIR}/Makefile"
diff --git a/audio/openal-soft/Makefile b/audio/openal-soft/Makefile
index e70f7b7057cb..32d5a070b845 100644
--- a/audio/openal-soft/Makefile
+++ b/audio/openal-soft/Makefile
@@ -14,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING
CONFLICTS= openal-200[0-9]*
-USES= cmake compiler:c11 tar:bzip2
+USES= cmake compiler:c11 lib32 tar:bzip2
USE_BINUTILS= yes
USE_LDCONFIG= yes
diff --git a/converters/Makefile b/converters/Makefile
index 7d41cb9deffa..68abad9e959d 100644
--- a/converters/Makefile
+++ b/converters/Makefile
@@ -41,6 +41,7 @@
SUBDIR += iconv-extra
SUBDIR += iconv-rfc1345
SUBDIR += ish
+ SUBDIR += lib32-libiconv
SUBDIR += libb64
SUBDIR += libiconv
SUBDIR += libticonv
diff --git a/converters/lib32-libiconv/Makefile b/converters/lib32-libiconv/Makefile
new file mode 100644
index 000000000000..6f099a9e4d4b
--- /dev/null
+++ b/converters/lib32-libiconv/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libiconv
+
+.include "${MASTERDIR}/Makefile"
diff --git a/converters/libiconv/Makefile b/converters/libiconv/Makefile
index 1f2c6aaf7a17..f36616c4d2fa 100644
--- a/converters/libiconv/Makefile
+++ b/converters/libiconv/Makefile
@@ -20,7 +20,7 @@ CONFIGURE_ARGS= --enable-static \
am_cv_func_iconv=no
INSTALL_TARGET= install-strip
MAKE_JOBS_UNSAFE= yes
-USES= libtool
+USES= lib32 libtool
USE_CSTD= gnu89
USE_LDCONFIG= yes
diff --git a/devel/Makefile b/devel/Makefile
index 80b27a88d2e4..131882e1db64 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1110,6 +1110,17 @@
SUBDIR += lemon
SUBDIR += lfcbase
SUBDIR += lfcxml
+ SUBDIR += lib32-gettext-runtime
+ SUBDIR += lib32-glib20
+ SUBDIR += lib32-libffi
+ SUBDIR += lib32-libinotify
+ SUBDIR += lib32-libpciaccess
+ SUBDIR += lib32-libpthread-stubs
+ SUBDIR += lib32-libunistring
+ SUBDIR += lib32-libunwind
+ SUBDIR += lib32-pcre
+ SUBDIR += lib32-readline
+ SUBDIR += lib32-xorg-macros
SUBDIR += libCello
SUBDIR += libIDL
SUBDIR += libPropList
diff --git a/devel/check/Makefile b/devel/check/Makefile
index 7ce632575017..35c4d05dd441 100644
--- a/devel/check/Makefile
+++ b/devel/check/Makefile
@@ -17,7 +17,7 @@ CONFIGURE_ENV= ac_cv_path_AWK_PATH=${AWK}
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
USE_LDCONFIG= yes
-USES= autoreconf libtool makeinfo pathfix pkgconfig
+USES= autoreconf lib32 libtool makeinfo pathfix pkgconfig
INFO= check
PORTDOCS= *
diff --git a/devel/gettext-runtime/Makefile b/devel/gettext-runtime/Makefile
index 711eb65e489b..2807a5c3fbc7 100644
--- a/devel/gettext-runtime/Makefile
+++ b/devel/gettext-runtime/Makefile
@@ -16,7 +16,7 @@ LICENSE_FILE_GPLv3= ${WRKSRC}/../COPYING
.include "${.CURDIR}/../gettext/Makefile.common"
-USES= charsetfix cpe iconv libtool tar:xz
+USES= charsetfix cpe iconv lib32 libtool tar:xz
USE_LDCONFIG= yes
CPE_PRODUCT= gettext
diff --git a/devel/glib20/Makefile b/devel/glib20/Makefile
index 8128aef2ee6e..077ad53c1c44 100644
--- a/devel/glib20/Makefile
+++ b/devel/glib20/Makefile
@@ -14,7 +14,7 @@ COMMENT= Some useful routines of C programming (current stable version)
LICENSE= LGPL20
-USES= tar:xz
+USES= lib32 tar:xz
PORTSCOUT= limitw:1,even
.if !defined(REFERENCE_PORT)
@@ -93,6 +93,9 @@ post-patch:
@${REINPLACE_CMD} -e 's|inotify_support=yes|inotify_support=no| ; \
s|-Werror|| ; \
s|#define HAVE_SYS_INOTIFY_H 1||' ${WRKSRC}/configure
+.if defined(USE_LIB32)
+ @${REINPLACE_CMD} -e 's|shlibpath_var=LD_LIBRARY_PATH|shlibpath_var=LD_32_LIBRARY_PATH|' ${WRKSRC}/configure
+.endif
do-build-MANPAGES-on:
.for m in glib gio gobject
diff --git a/devel/lib32-gettext-runtime/Makefile b/devel/lib32-gettext-runtime/Makefile
new file mode 100644
index 000000000000..400fa5ad5d4d
--- /dev/null
+++ b/devel/lib32-gettext-runtime/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../gettext-runtime
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-glib20/Makefile b/devel/lib32-glib20/Makefile
new file mode 100644
index 000000000000..e272f3d77981
--- /dev/null
+++ b/devel/lib32-glib20/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../glib20
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-libffi/Makefile b/devel/lib32-libffi/Makefile
new file mode 100644
index 000000000000..b8d53e39b1b1
--- /dev/null
+++ b/devel/lib32-libffi/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libffi
+
+.include "${MASTERDIR}/Makefile"
+
+CONFIGURE_ARGS+=--host=i386-portbld-freebsd
diff --git a/devel/lib32-libinotify/Makefile b/devel/lib32-libinotify/Makefile
new file mode 100644
index 000000000000..4d7f46090116
--- /dev/null
+++ b/devel/lib32-libinotify/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libinotify
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-libpciaccess/Makefile b/devel/lib32-libpciaccess/Makefile
new file mode 100644
index 000000000000..b5cefd9cf76f
--- /dev/null
+++ b/devel/lib32-libpciaccess/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libpciaccess
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-libpthread-stubs/Makefile b/devel/lib32-libpthread-stubs/Makefile
new file mode 100644
index 000000000000..73f4f77fb165
--- /dev/null
+++ b/devel/lib32-libpthread-stubs/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libpthread-stubs
+
+.include "${MASTERDIR}/Makefile"
+
+PLIST_FILES= libdata/pkgconfig32/pthread-stubs.pc
diff --git a/devel/lib32-libunistring/Makefile b/devel/lib32-libunistring/Makefile
new file mode 100644
index 000000000000..052eef2cebcf
--- /dev/null
+++ b/devel/lib32-libunistring/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libunistring
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-libunwind/Makefile b/devel/lib32-libunwind/Makefile
new file mode 100644
index 000000000000..d03b52c28e17
--- /dev/null
+++ b/devel/lib32-libunwind/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libunwind
+
+.include "${MASTERDIR}/Makefile"
+
+CONFIGURE_ARGS+=--host=i386-portbld-freebsd
+
+PLIST_SUB= ARCH=x86
diff --git a/devel/lib32-pcre/Makefile b/devel/lib32-pcre/Makefile
new file mode 100644
index 000000000000..86e61bd4793b
--- /dev/null
+++ b/devel/lib32-pcre/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../pcre
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-readline/Makefile b/devel/lib32-readline/Makefile
new file mode 100644
index 000000000000..8f83ad4e6ec2
--- /dev/null
+++ b/devel/lib32-readline/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../readline
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lib32-xorg-macros/Makefile b/devel/lib32-xorg-macros/Makefile
new file mode 100644
index 000000000000..13bc13630767
--- /dev/null
+++ b/devel/lib32-xorg-macros/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../xorg-macros
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/libffi/Makefile b/devel/libffi/Makefile
index 288cc0d970c7..7caf3399a771 100644
--- a/devel/libffi/Makefile
+++ b/devel/libffi/Makefile
@@ -15,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
TEST_DEPENDS= runtest:misc/dejagnu
-USES= libtool pathfix
+USES= lib32 libtool pathfix
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
diff --git a/devel/libinotify/Makefile b/devel/libinotify/Makefile
index 1b6e39eb0f9d..d9a56c7a1d05 100644
--- a/devel/libinotify/Makefile
+++ b/devel/libinotify/Makefile
@@ -15,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
USE_LDCONFIG= yes
-USES= autoreconf libtool
+USES= autoreconf lib32 libtool
GH_ACCOUNT= ${PORTNAME}-kqueue
GH_PROJECT= ${PORTNAME}-kqueue
diff --git a/devel/libpciaccess/Makefile b/devel/libpciaccess/Makefile
index 43a432529742..0644fe5ec00c 100644
--- a/devel/libpciaccess/Makefile
+++ b/devel/libpciaccess/Makefile
@@ -15,6 +15,8 @@ USES= autoreconf
BUILD_DEPENDS= ${LOCALBASE}/share/pciids/pci.ids:misc/pciids
RUN_DEPENDS= ${LOCALBASE}/share/pciids/pci.ids:misc/pciids
+USES= lib32
+USE_LDCONFIG= yes
CONFIGURE_ARGS= --with-pciids-path=${LOCALBASE}/share/pciids
XORG_CAT= lib
diff --git a/devel/libpthread-stubs/Makefile b/devel/libpthread-stubs/Makefile
index fb56a0b7027f..fd4d04616228 100644
--- a/devel/libpthread-stubs/Makefile
+++ b/devel/libpthread-stubs/Makefile
@@ -12,7 +12,7 @@ COMMENT= This library provides weak aliases for pthread functions
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= pathfix tar:bzip2
+USES= lib32 pathfix tar:bzip2
GNU_CONFIGURE= yes
NO_ARCH= yes
diff --git a/devel/libunistring/Makefile b/devel/libunistring/Makefile
index c2ba9e00c562..def9c91c487c 100644
--- a/devel/libunistring/Makefile
+++ b/devel/libunistring/Makefile
@@ -15,7 +15,7 @@ LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING
LICENSE_FILE_LGPL3+ = ${WRKSRC}/COPYING.LIB
LICENSE_FILE_GFDL= ${WRKSRC}/doc/libunistring.texi
-USES= alias charsetfix gmake iconv libtool tar:xz
+USES= alias charsetfix gmake iconv lib32 libtool tar:xz
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
diff --git a/devel/libunwind/Makefile b/devel/libunwind/Makefile
index 82d3d24e61fd..0a33b9ebe62e 100644
--- a/devel/libunwind/Makefile
+++ b/devel/libunwind/Makefile
@@ -20,7 +20,7 @@ OPTIONS_SUB= yes
DOCS_CONFIGURE_ON= ac_cv_path_LATEX2MAN=${TRUE}
DOCS_CONFIGURE_OFF= --disable-documentation
-USES= libtool pathfix pkgconfig
+USES= lib32 libtool pathfix pkgconfig
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
diff --git a/devel/pcre/Makefile b/devel/pcre/Makefile
index d9bf5966e2fb..b2b1d7bd83ae 100644
--- a/devel/pcre/Makefile
+++ b/devel/pcre/Makefile
@@ -14,7 +14,7 @@ COMMENT= Perl Compatible Regular Expressions library
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENCE
-USES= ${USES_${ARCH}} cpe libtool pathfix tar:bzip2
+USES= ${USES_${ARCH}} cpe lib32 libtool pathfix tar:bzip2
USES_powerpc= compiler:c++11-lang
USES_powerpcspe= compiler:c++11-lang
USES_powerpc64= compiler:c++11-lang
diff --git a/devel/readline/Makefile b/devel/readline/Makefile
index d037470f8c14..30f1fc688a32 100644
--- a/devel/readline/Makefile
+++ b/devel/readline/Makefile
@@ -19,7 +19,7 @@ OPTIONS_DEFINE= TERMCAP DOCS
OPTIONS_DEFAULT=TERMCAP
TERMCAP_DESC= Link against libtermcap
-USES= cpe
+USES= lib32 cpe
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
@@ -45,9 +45,12 @@ post-patch:
post-patch-TERMCAP-on:
@${REINPLACE_CMD} -e '/SHOBJ_LDFLAGS = / s| = |&-ltermcapw |' ${WRKSRC}/shlib/Makefile.in
+.if defined(USE_LIB32)
+ @${REINPLACE_CMD} -e '/SHOBJ_LDFLAGS = / s| = |&-m32 |' ${WRKSRC}/shlib/Makefile.in
+.endif
post-install:
- ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libhistory.so.8 ${STAGEDIR}${PREFIX}/lib/libreadline.so.8
+ ${STRIP_CMD} ${STAGEDIR}${LIBDIR}/libhistory.so.8 ${STAGEDIR}${LIBDIR}/libreadline.so.8
${INSTALL_DATA} ${WRKSRC}/readline.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
.include <bsd.port.mk>
diff --git a/devel/xorg-macros/Makefile b/devel/xorg-macros/Makefile
index 359bbcf28f5a..b54849ab5719 100644
--- a/devel/xorg-macros/Makefile
+++ b/devel/xorg-macros/Makefile
@@ -14,6 +14,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING
XORG_CAT= util
+USES= lib32
+
NO_ARCH= yes
MAKE_ARGS= pkgconfigdir="${PREFIX}/libdata/pkgconfig"
diff --git a/dns/Makefile b/dns/Makefile
index 96270101610d..b632c5eb76c9 100644
--- a/dns/Makefile
+++ b/dns/Makefile
@@ -95,6 +95,7 @@
SUBDIR += knot2-lib
SUBDIR += ldapdns
SUBDIR += ldns
+ SUBDIR += lib32-libidn2
SUBDIR += libasr
SUBDIR += libasr-devel
SUBDIR += libbind
diff --git a/dns/lib32-libidn2/Makefile b/dns/lib32-libidn2/Makefile
new file mode 100644
index 000000000000..e20f59d14537
--- /dev/null
+++ b/dns/lib32-libidn2/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libidn2
+
+.include "${MASTERDIR}/Makefile"
diff --git a/dns/libidn2/Makefile b/dns/libidn2/Makefile
index 6738c292fa3c..17138f835381 100644
--- a/dns/libidn2/Makefile
+++ b/dns/libidn2/Makefile
@@ -14,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libunistring.so:devel/libunistring
-USES= charsetfix gmake iconv libtool localbase pathfix
+USES= charsetfix gmake iconv lib32 libtool localbase pathfix
CONFIGURE_ARGS= --disable-nls \
--with-libunistring-prefix=${LOCALBASE} \
diff --git a/emulators/Makefile b/emulators/Makefile
index 8caebc29e974..fe2968fb06f7 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -61,6 +61,8 @@
SUBDIR += jzintv
SUBDIR += kcemu
SUBDIR += klh10
+ SUBDIR += lib32-tpm-emulator
+ SUBDIR += lib32-wine-devel
SUBDIR += lib765
SUBDIR += libdsk
SUBDIR += libspectrum
diff --git a/emulators/lib32-tpm-emulator/Makefile b/emulators/lib32-tpm-emulator/Makefile
new file mode 100644
index 000000000000..4f2e8291ed07
--- /dev/null
+++ b/emulators/lib32-tpm-emulator/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../tpm-emulator
+
+.include "${MASTERDIR}/Makefile"
diff --git a/emulators/lib32-wine-devel/Makefile b/emulators/lib32-wine-devel/Makefile
new file mode 100644
index 000000000000..70e5f9b5e9cb
--- /dev/null
+++ b/emulators/lib32-wine-devel/Makefile
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../wine-devel
+
+.include "${MASTERDIR}/Makefile"
+
+LDFLAGS+= -Wl,-rpath,/usr/local/lib32
+LIB32_PATTERN:= (^bin\/wine$$$|${LIB32_PATTERN})
diff --git a/emulators/tpm-emulator/Makefile b/emulators/tpm-emulator/Makefile
index 9259c4b6a44f..eb7548c0e365 100644
--- a/emulators/tpm-emulator/Makefile
+++ b/emulators/tpm-emulator/Makefile
@@ -15,18 +15,23 @@ LICENSE= GPLv2
LIB_DEPENDS= libgmp.so:math/gmp
-USES= cmake
+USES= cmake lib32
USE_RC_SUBR= tpmd
CONFIGURE_ENV= PREFIX="${PREFIX}"
CMAKE_ARGS= -DTPM_INCLUDE_DIRS:STRING="${LOCALBASE}/include" \
- -DTDDL_LIBRARY_DIRS:STRING="${LOCALBASE}/lib/tddl_emu" \
- -DTPM_LIBRARY_DIRS:STRING="${LOCALBASE}/lib"
+ -DTDDL_LIBRARY_DIRS:STRING="${LIBDIR}/tddl_emu" \
+ -DTPM_LIBRARY_DIRS:STRING="${LIBDIR}"
USE_LDCONFIG= yes
USERS= _tss
GROUPS= _tss
SUB_LIST= USERS="${USERS}" GROUPS="${GROUPS}"
PLIST_SUB= USERS="${USERS}" GROUPS="${GROUPS}"
+post-patch:
+.if defined(USE_LIB32)
+ ${REINPLACE_CMD} -e 's|DESTINATION lib/tddl_emu|DESTINATION lib32/tddl_emu|g' ${WRKSRC}/tddl/CMakeLists.txt
+.endif
+
post-install:
@${MKDIR} ${STAGEDIR}/var/run/tpm
@${MKDIR} ${STAGEDIR}${PREFIX}/var/db/tpm
diff --git a/emulators/wine-devel/Makefile b/emulators/wine-devel/Makefile
index e88860699ee3..809aeeb674ee 100644
--- a/emulators/wine-devel/Makefile
+++ b/emulators/wine-devel/Makefile
@@ -21,10 +21,13 @@ ONLY_FOR_ARCHS= amd64 i386
BUILD_DEPENDS= ${LOCALBASE}/bin/flex:textproc/flex \
prelink:sysutils/prelink
-LIB_DEPENDS= libFAudio.so:audio/faudio \
- libxml2.so:textproc/libxml2
-USES= bison desktop-file-utils gmake localbase shebangfix tar:xz
+LIB_DEPENDS= libxml2.so:textproc/libxml2
+.if !defined(USE_LIB32)
+LIB_DEPENDS+= libFAudio.so:audio/faudio
+.endif
+
+USES= bison compiler:c11 desktop-file-utils gmake lib32 localbase shebangfix tar:xz
CONFLICTS_INSTALL= wine-[0-9]* wine-staging-[0-9]* i386-wine-[0-9]* \
i386-wine-staging-[0-9]* i386-wine-devel-[0-9]*
@@ -37,6 +40,7 @@ CONFIGURE_ARGS+=--verbose \
--without-gettext --without-gettextpo \
--without-gphoto --without-gsm --without-gstreamer \
--without-krb5 \
+ --without-mingw \
--without-opencl \
--without-osmesa \
--with-oss \
@@ -46,7 +50,7 @@ CONFIGURE_ARGS+=--verbose \
--without-tiff \
--without-udev
CONFIGURE_ENV= CPPBIN="${CPP}" FLEX="${LOCALBASE}/bin/flex"
-WINELIBDIR?= ${PREFIX}/lib
+WINELIBDIR?= ${LIBDIR}
.if !defined(USE_LDCONFIG32)
USE_LDCONFIG= ${WINELIBDIR} ${WINELIBDIR}/wine
.endif
@@ -122,7 +126,7 @@ X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
.include <bsd.port.pre.mk>
-.if ${ARCH} == amd64
+.if ${ARCH} == amd64 && !defined(USE_LIB32)
# Wine is composed of three parts:
# - wine (aka this port) is the 32-bit component and runs 32-bit programs (on FreeBSD/i386)
# - wine64 (aka this part of this port) is the 64-bit component and runs 64-bit programs
diff --git a/graphics/Makefile b/graphics/Makefile
index 79871c46e022..ad26dc709c1e 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -424,6 +424,16 @@
SUBDIR += lepton
SUBDIR += leptonica
SUBDIR += lfview
+ SUBDIR += lib32-jbigkit
+ SUBDIR += lib32-jpeg-turbo
+ SUBDIR += lib32-lcms2
+ SUBDIR += lib32-libGLU
+ SUBDIR += lib32-libdrm
+ SUBDIR += lib32-mesa-libs
+ SUBDIR += lib32-png
+ SUBDIR += lib32-tiff
+ SUBDIR += lib32-vulkan-loader
+ SUBDIR += lib32-wayland
SUBDIR += lib3ds
SUBDIR += libGLU
SUBDIR += libGLw
diff --git a/graphics/jbigkit/Makefile b/graphics/jbigkit/Makefile
index c4c317e4cca0..8e62bc144c55 100644
--- a/graphics/jbigkit/Makefile
+++ b/graphics/jbigkit/Makefile
@@ -13,6 +13,7 @@ COMMENT= Lossless compression for bi-level images such as scanned pages, faxes
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
+USES= lib32
USE_LDCONFIG= yes
MANS= jbgtopbm.1 pbmtojbg.1
BINS= jbgtopbm pbmtojbg jbgtopbm85 pbmtojbg85
@@ -34,12 +35,13 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/libjbig/*.h ${STAGEDIR}${PREFIX}/include
+ @${MKDIR} ${STAGEDIR}${LIBDIR}
${INSTALL_DATA} \
- ${LIBA:S|^|${WRKSRC}/libjbig/|} ${STAGEDIR}${PREFIX}/lib
+ ${LIBA:S|^|${WRKSRC}/libjbig/|} ${STAGEDIR}${LIBDIR}
${INSTALL_LIB} \
- ${LIBS:S|^|${WRKSRC}/libjbig/|} ${STAGEDIR}${PREFIX}/lib
- ${LN} -sf libjbig.so.2 ${STAGEDIR}${PREFIX}/lib/libjbig.so
- ${LN} -sf libjbig85.so.1 ${STAGEDIR}${PREFIX}/lib/libjbig85.so
+ ${LIBS:S|^|${WRKSRC}/libjbig/|} ${STAGEDIR}${LIBDIR}
+ ${LN} -sf libjbig.so.2 ${STAGEDIR}${LIBDIR}/libjbig.so
+ ${LN} -sf libjbig85.so.1 ${STAGEDIR}${LIBDIR}/libjbig85.so
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/libjbig/jbig.txt ${STAGEDIR}${DOCSDIR}
diff --git a/graphics/jpeg-turbo/Makefile b/graphics/jpeg-turbo/Makefile
index f35544a3361d..7bc10d87ba72 100644
--- a/graphics/jpeg-turbo/Makefile
+++ b/graphics/jpeg-turbo/Makefile
@@ -20,7 +20,7 @@ LICENSE_FILE_IJG= ${WRKSRC}/README.ijg
LICENSE_FILE_ZLIB= ${WRKSRC}/LICENSE.md
LICENSE_PERMS_IJG= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= cmake cpe
+USES= cmake cpe lib32
USE_LDCONFIG= yes
CMAKE_ON= WITH_JPEG8
CPE_VENDOR= d.r.commander
diff --git a/graphics/lcms2/Makefile b/graphics/lcms2/Makefile
index cd880834d655..8216effb8492 100644
--- a/graphics/lcms2/Makefile
+++ b/graphics/lcms2/Makefile
@@ -24,7 +24,7 @@ GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
TEST_TARGET= check
USE_LDCONFIG= yes
-USES= libtool localbase:ldflags pathfix
+USES= lib32 libtool localbase:ldflags pathfix
PORTDOCS= *
diff --git a/graphics/lib32-jbigkit/Makefile b/graphics/lib32-jbigkit/Makefile
new file mode 100644
index 000000000000..4090eac70d1d
--- /dev/null
+++ b/graphics/lib32-jbigkit/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../jbigkit
+
+.include "${MASTERDIR}/Makefile"
+
+LDFLAGS+= -m32
diff --git a/graphics/lib32-jpeg-turbo/Makefile b/graphics/lib32-jpeg-turbo/Makefile
new file mode 100644
index 000000000000..a7787330862a
--- /dev/null
+++ b/graphics/lib32-jpeg-turbo/Makefile
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../jpeg-turbo
+
+.include "${MASTERDIR}/Makefile"
+
+CONFLICTS_INSTALL= lib32-jpeg-[0-9]*
+
+CONFIGURE_ARGS+=--without-simd
+
+PLIST_SUB:= ${PLIST_SUB:S/JPEG="@comment "/JPEG=""/:S/LIBTURBOJPEG=""/LIBTURBOJPEG="@comment "/}
diff --git a/graphics/lib32-lcms2/Makefile b/graphics/lib32-lcms2/Makefile
new file mode 100644
index 000000000000..c644628ca4f8
--- /dev/null
+++ b/graphics/lib32-lcms2/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../lcms2
+
+.include "${MASTERDIR}/Makefile"
diff --git a/graphics/lib32-libGLU/Makefile b/graphics/lib32-libGLU/Makefile
new file mode 100644
index 000000000000..13c2c4900c39
--- /dev/null
+++ b/graphics/lib32-libGLU/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libGLU
+
+.include "${MASTERDIR}/Makefile"
diff --git a/graphics/lib32-libdrm/Makefile b/graphics/lib32-libdrm/Makefile
new file mode 100644
index 000000000000..fc70a5e0ae38
--- /dev/null
+++ b/graphics/lib32-libdrm/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libdrm
+
+.include "${MASTERDIR}/Makefile"
diff --git a/graphics/lib32-mesa-libs/Makefile b/graphics/lib32-mesa-libs/Makefile
new file mode 100644
index 000000000000..1579e6f8fb29
--- /dev/null
+++ b/graphics/lib32-mesa-libs/Makefile
@@ -0,0 +1,16 @@
+# $FreeBSD$
+
+# mesa-libs itself is a slave port of mesa-dri
+
+USE_LIB32= yes
+MESADIR= ${.CURDIR}/../mesa-libs
+
+OPTIONS_EXCLUDE=WAYLAND
+
+.include "${.CURDIR}/../mesa-libs/Makefile"
+
+DESCR= ${MESADIR}/pkg-descr
+PLIST= ${MESADIR}/pkg-plist
+PKGHELP= ${MESADIR}/pkg-help
+PKGINSTALL= ${MESADIR}/pkg-install
+PKGDEINSTALL= ${MESADIR}/pkg-deinstall
diff --git a/graphics/lib32-png/Makefile b/graphics/lib32-png/Makefile
new file mode 100644
index 000000000000..1a2a5caefe22
--- /dev/null
+++ b/graphics/lib32-png/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../png
+
+.include "${MASTERDIR}/Makefile"
+
+CONFIGURE_ARGS+=--with-pkgconfigdir=${PREFIX}/libdata/pkgconfig32
diff --git a/graphics/lib32-tiff/Makefile b/graphics/lib32-tiff/Makefile
new file mode 100644
index 000000000000..fe59d9d9227f
--- /dev/null
+++ b/graphics/lib32-tiff/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../tiff
+
+.include "${MASTERDIR}/Makefile"
diff --git a/graphics/lib32-vulkan-loader/Makefile b/graphics/lib32-vulkan-loader/Makefile
new file mode 100644
index 000000000000..8205e1a3f3d5
--- /dev/null
+++ b/graphics/lib32-vulkan-loader/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../vulkan-loader
+
+.include "${MASTERDIR}/Makefile"
diff --git a/graphics/lib32-wayland/Makefile b/graphics/lib32-wayland/Makefile
new file mode 100644
index 000000000000..e681d4f517f3
--- /dev/null
+++ b/graphics/lib32-wayland/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../wayland
+
+.include "${MASTERDIR}/Makefile"
diff --git a/graphics/libGLU/Makefile b/graphics/libGLU/Makefile
index d2a44c4dd225..19fb70c7a215 100644
--- a/graphics/libGLU/Makefile
+++ b/graphics/libGLU/Makefile
@@ -14,7 +14,7 @@ COMMENT= OpenGL utility library
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-static
INSTALL_TARGET= install-strip
-USES= libtool pathfix pkgconfig tar:bzip2
+USES= lib32 libtool pathfix pkgconfig tar:bzip2
USE_GL= gl
USE_LDCONFIG= yes
diff --git a/graphics/libdrm/Makefile b/graphics/libdrm/Makefile
index 3f76c457c247..bf80bea39c5d 100644
--- a/graphics/libdrm/Makefile
+++ b/graphics/libdrm/Makefile
@@ -16,7 +16,7 @@ LICENSE= MIT
BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
LIB_DEPENDS= libpciaccess.so:devel/libpciaccess
-USES= gnome meson pkgconfig tar:bzip2
+USES= gnome lib32 meson pkgconfig tar:bzip2
USE_LDCONFIG= yes
OPTIONS_DEFINE= MANPAGES TESTS
diff --git a/graphics/mesa-libs/Makefile b/graphics/mesa-libs/Makefile
index 39edb7cca692..86392603f591 100644
--- a/graphics/mesa-libs/Makefile
+++ b/graphics/mesa-libs/Makefile
@@ -8,6 +8,7 @@ CATEGORIES= graphics
COMMENT= OpenGL libraries that support GLX and EGL clients
+USES= lib32
USE_XORG= xorgproto x11 xcb xdamage xext \
xfixes xshmfence xxf86vm
diff --git a/graphics/png/Makefile b/graphics/png/Makefile
index 1b6f387804a2..2f503a7bf2c3 100644
--- a/graphics/png/Makefile
+++ b/graphics/png/Makefile
@@ -18,7 +18,7 @@ LICENSE_NAME= libpng License
LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= cpe libtool tar:xz
+USES= cpe lib32 libtool tar:xz
CPE_PRODUCT= libpng
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-pkgconfigdir=${PREFIX}/libdata/pkgconfig
diff --git a/graphics/tiff/Makefile b/graphics/tiff/Makefile
index fda113033fb3..514010f7a299 100644
--- a/graphics/tiff/Makefile
+++ b/graphics/tiff/Makefile
@@ -15,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/COPYRIGHT
LIB_DEPENDS= libjbig.so:graphics/jbigkit
-USES= cpe jpeg libtool pathfix
+USES= cpe jpeg lib32 libtool pathfix
CPE_PRODUCT= libtiff
CPE_VERSION= ${DISTVERSION:C/[a-z]+//}
CPE_UPDATE= ${DISTVERSION:C/[0-9.]+//}
diff --git a/graphics/vulkan-loader/Makefile b/graphics/vulkan-loader/Makefile
index 1cdae2e9c862..7fac0e9b3ee8 100644
--- a/graphics/vulkan-loader/Makefile
+++ b/graphics/vulkan-loader/Makefile
@@ -12,7 +12,7 @@ LICENSE= APACHE20
BUILD_DEPENDS= ${LOCALBASE}/include/vulkan/vulkan.h:devel/vulkan-headers
-USES= cmake compiler:c++11-lib pkgconfig python:3.4+,build
+USES= cmake compiler:c++11-lib lib32 pkgconfig python:3.4+,build
USE_LDCONFIG= yes
USE_GITHUB= yes
@@ -38,6 +38,11 @@ XCB_LIB_DEPENDS= libX11-xcb.so:x11/libX11 \
WAYLAND_CMAKE_BOOL= BUILD_WSI_WAYLAND_SUPPORT
WAYLAND_LIB_DEPENDS= libwayland-egl.so:graphics/wayland
+.if defined(USE_LIB32)
+ASFLAGS= --32
+. export-env ASFLAGS
+.endif
+
post-patch:
# Non-x86 targets use C code, so don't abort without GNU as (e.g., on aarch64)
.if !exists(/usr/bin/as) && ${MACHINE_ARCH} != i386 && ${MACHINE_ARCH} != amd64
diff --git a/graphics/wayland/Makefile b/graphics/wayland/Makefile
index d5d9a8fc1d8f..238d969fe5de 100644
--- a/graphics/wayland/Makefile
+++ b/graphics/wayland/Makefile
@@ -19,7 +19,7 @@ LIB_DEPENDS= libexpat.so:textproc/expat2 \
CFLAGS+= "-I${LOCALBASE}/include/libepoll-shim"
-USES= autoreconf gmake gnome libtool localbase pathfix pkgconfig tar:xz
+USES= autoreconf gmake gnome libtool lib32 localbase pathfix pkgconfig tar:xz
USE_GNOME= libxslt:build
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
diff --git a/math/Makefile b/math/Makefile
index 0d0416dc29d0..4be2c3f425a2 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -309,6 +309,7 @@
SUBDIR += lean
SUBDIR += lemon
SUBDIR += levmar
+ SUBDIR += lib32-gmp
SUBDIR += libRmath
SUBDIR += libccd
SUBDIR += libflame
diff --git a/math/gmp/Makefile b/math/gmp/Makefile
index cabcd27b92de..ae096c673ccc 100644
--- a/math/gmp/Makefile
+++ b/math/gmp/Makefile
@@ -15,7 +15,7 @@ LICENSE= LGPL3
OPTIONS_DEFINE= CPU_OPTS
CPU_OPTS_DESC= Enable assembly optimizations for your CPU
-USES= libtool makeinfo tar:xz
+USES= lib32 libtool makeinfo tar:xz
HAS_CONFIGURE= yes
CONFIGURE_ENV= MAKEINFO="${MAKEINFO} --no-split"
CONFIGURE_ARGS= --prefix=${PREFIX} \
diff --git a/math/lib32-gmp/Makefile b/math/lib32-gmp/Makefile
new file mode 100644
index 000000000000..fbf2d5387af9
--- /dev/null
+++ b/math/lib32-gmp/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../gmp
+
+.include "${MASTERDIR}/Makefile"
+
+CONFIGURE_ENV+=ABI="32"
diff --git a/print/Makefile b/print/Makefile
index 1579abaa46a3..b1c4de008214 100644
--- a/print/Makefile
+++ b/print/Makefile
@@ -99,6 +99,7 @@
SUBDIR += latex2rtf
SUBDIR += latexdiff
SUBDIR += lgrind
+ SUBDIR += lib32-freetype2
SUBDIR += libgnomecups
SUBDIR += libgnomeprint
SUBDIR += libgnomeprint-reference
diff --git a/print/freetype2/Makefile b/print/freetype2/Makefile
index 70625717ff2c..5c519667c57a 100644
--- a/print/freetype2/Makefile
+++ b/print/freetype2/Makefile
@@ -22,7 +22,7 @@ LICENSE_FILE_FTL= ${WRKSRC}/docs/FTL.TXT
LICENSE_FILE_GPLv2+ = ${WRKSRC}/docs/GPLv2.TXT
LICENSE_PERMS_FTL= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-USES= cpe gmake libtool tar:bzip2
+USES= cpe gmake lib32 libtool tar:bzip2
MAKE_ENV= TOP=""
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
@@ -123,7 +123,7 @@ post-configure:
${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} setup)
post-install:
- @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libfreetype.so.*
+ @${STRIP_CMD} ${STAGEDIR}${LIBDIR}/libfreetype.so.*
post-install-DOCS-on:
(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} "${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
diff --git a/print/lib32-freetype2/Makefile b/print/lib32-freetype2/Makefile
new file mode 100644
index 000000000000..4b5b6839b5ea
--- /dev/null
+++ b/print/lib32-freetype2/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../freetype2
+
+.include "${MASTERDIR}/Makefile"
diff --git a/security/Makefile b/security/Makefile
index 4743bd8a26a0..3f740e10ffe0 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -277,6 +277,12 @@
SUBDIR += l5
SUBDIR += lasso
SUBDIR += lastpass-cli
+ SUBDIR += lib32-gnutls
+ SUBDIR += lib32-libtasn1
+ SUBDIR += lib32-nettle
+ SUBDIR += lib32-openssl
+ SUBDIR += lib32-p11-kit
+ SUBDIR += lib32-trousers
SUBDIR += libadacrypt
SUBDIR += libargon2
SUBDIR += libassuan
diff --git a/security/gnutls/Makefile b/security/gnutls/Makefile
index 1657f5b2bbb2..b6dcae49365a 100644
--- a/security/gnutls/Makefile
+++ b/security/gnutls/Makefile
@@ -20,7 +20,7 @@ LIB_DEPENDS= libgmp.so:math/gmp \
libunistring.so:devel/libunistring
RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
-USES= compiler:c11 cpe gmake iconv libtool localbase makeinfo \
+USES= compiler:c11 cpe gmake iconv lib32 libtool localbase makeinfo \
pkgconfig tar:xz
USE_LDCONFIG= yes
@@ -30,7 +30,7 @@ CONFIGURE_ARGS= --disable-guile \
--enable-local-libopts \
--with-system-priority-file=${PREFIX}/etc/gnutls/default-priorities \
--with-default-trust-store-file=${LOCALBASE}/share/certs/ca-root-nss.crt \
- --with-trousers-lib=${LOCALBASE}/lib/libtspi.so.1 \
+ --with-trousers-lib=${LIBDIR}/libtspi.so.1 \
AUTOGEN=false \
ac_cv_type_max_align_t=yes
MAKE_ENV= MAKEINFOFLAGS=--no-split
diff --git a/security/lib32-gnutls/Makefile b/security/lib32-gnutls/Makefile
new file mode 100644
index 000000000000..f9d9e97c1bec
--- /dev/null
+++ b/security/lib32-gnutls/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../gnutls
+
+.include "${MASTERDIR}/Makefile"
+
+CONFIGURE_ARGS+=--host=i386-portbld-freebsd
+
+LDFLAGS+= -lnettle -lgmp #TODO: that's just weird
diff --git a/security/lib32-libtasn1/Makefile b/security/lib32-libtasn1/Makefile
new file mode 100644
index 000000000000..b689b69b247b
--- /dev/null
+++ b/security/lib32-libtasn1/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libtasn1
+
+.include "${MASTERDIR}/Makefile"
diff --git a/security/lib32-nettle/Makefile b/security/lib32-nettle/Makefile
new file mode 100644
index 000000000000..3eb932d24786
--- /dev/null
+++ b/security/lib32-nettle/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../nettle
+
+.include "${MASTERDIR}/Makefile"
diff --git a/security/lib32-openssl/Makefile b/security/lib32-openssl/Makefile
new file mode 100644
index 000000000000..417cb7701364
--- /dev/null
+++ b/security/lib32-openssl/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../openssl
+
+.include "${MASTERDIR}/Makefile"
+
+MACHINE= i386
+.export-env MACHINE
+
+CONFIGURE_ARGS+=no-ec_nistp_64_gcc_128
diff --git a/security/lib32-p11-kit/Makefile b/security/lib32-p11-kit/Makefile
new file mode 100644
index 000000000000..3d19b5058101
--- /dev/null
+++ b/security/lib32-p11-kit/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../p11-kit
+
+.include "${MASTERDIR}/Makefile"
diff --git a/security/lib32-trousers/Makefile b/security/lib32-trousers/Makefile
new file mode 100644
index 000000000000..dbb2708e1255
--- /dev/null
+++ b/security/lib32-trousers/Makefile
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../trousers
+
+.include "${MASTERDIR}/Makefile"
+
+BUILD_DEPENDS:= ${BUILD_DEPENDS:C|${LOCALBASE}/lib/([^:]*):([^/]*)/(.*)|${LOCALBASE}/lib32/\1:\2/lib32-\3|g}
+
+BUILD_DEPENDS:= ${BUILD_DEPENDS:S|tpm-emulator|lib32-tpm-emulator|g}
+RUN_DEPENDS:= ${RUN_DEPENDS:S|tpm-emulator|lib32-tpm-emulator|g}
+
+CPPFLAGS:= ${CPPFLAGS:S|-I${LOCALBASE}/include||g}
+LDFLAGS:= ${LDFLAGS:S|${LOCALBASE}/lib|${LOCALBASE}/lib32|g}
diff --git a/security/libtasn1/Makefile b/security/libtasn1/Makefile
index a9599bcb9e6e..1234ee7af283 100644
--- a/security/libtasn1/Makefile
+++ b/security/libtasn1/Makefile
@@ -13,7 +13,7 @@ COMMENT= ASN.1 structure parser library
LICENSE= LGPL21+
LICENSE_FILE= ${WRKSRC}/COPYING.LIB
-USES= cpe pkgconfig pathfix gmake libtool
+USES= cpe pkgconfig pathfix gmake lib32 libtool
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
diff --git a/security/nettle/Makefile b/security/nettle/Makefile
index 3427c2bb2878..9d41fb0a3ec0 100644
--- a/security/nettle/Makefile
+++ b/security/nettle/Makefile
@@ -21,7 +21,7 @@ LIB_DEPENDS= libgmp.so:math/gmp
OPTIONS_DEFINE= DOCS EXAMPLES
-USES= compiler:c11 gmake localbase makeinfo pathfix
+USES= compiler:c11 gmake lib32 localbase makeinfo pathfix
CONFIGURE_ARGS= --enable-shared
CONFIGURE_ENV= M4="/usr/bin/m4 -g"
@@ -45,7 +45,7 @@ post-patch:
.endif
post-install:
- ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib*.so
+ ${STRIP_CMD} ${STAGEDIR}${LIBDIR}/lib*.so
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/security/openssl/Makefile b/security/openssl/Makefile
index 6d1068eab9e2..a073e321a77e 100644
--- a/security/openssl/Makefile
+++ b/security/openssl/Makefile
@@ -56,10 +56,10 @@ SSL2_DESC= SSLv2 protocol support
SSL3_DESC= SSLv3 protocol support
ZLIB_DESC= zlib compression support
-USES= compiler cpe perl5
+USES= compiler cpe lib32 perl5
USE_PERL5= build
MAKE_ARGS+= WHOLE_ARCHIVE_FLAG=--whole-archive
-MAKE_ENV+= LIBRPATH="${PREFIX}/lib" GREP_OPTIONS=
+MAKE_ENV+= LIBRPATH="${LIBDIR}" GREP_OPTIONS=
SUB_FILES= pkg-message
TEST_TARGET= test
@@ -127,6 +127,11 @@ post-patch:
${REINPLACE_CMD} -e 's|SHLIB_VERSION_NUMBER "1.0.0"|SHLIB_VERSION_NUMBER "${OPENSSL_SHLIBVER}"|' \
${WRKSRC}/crypto/opensslv.h
${REINPLACE_CMD} -e 's|\^GNU ld|GNU|' ${WRKSRC}/Makefile.shared
+.if defined(USE_LIB32)
+ ${REINPLACE_CMD} -e 's|/usr/local/lib/engines|/usr/local/lib32/engines|' ${WRKSRC}/crypto/opensslconf.h.in
+ ${REINPLACE_CMD} -e 's|my $$multilib = $$fields\[$$idx_multilib\];|my $$multilib = "32";|' ${WRKSRC}/Configure
+ ${REINPLACE_CMD} -e 's|LD_LIBRARY_PATH|LD_32_LIBRARY_PATH|' ${WRKSRC}/Makefile.shared
+.endif
post-patch-MAN3-off:
${GREP} -L openssl_manual_section ${WRKSRC}/doc/crypto/*.pod | ${XARGS} ${RM}
@@ -138,7 +143,7 @@ do-configure:
&& ${SETENV} CC="${CC}" FREEBSDCC="${CC}" CFLAGS="${CFLAGS}" PERL="${PERL}" \
./config --prefix=${PREFIX} --openssldir=${OPENSSLDIR} \
--install_prefix=${STAGEDIR} \
- -L${PREFIX}/lib ${CONFIGURE_ARGS}
+ -L${LIBDIR} ${CONFIGURE_ARGS}
post-configure:
${REINPLACE_CMD} \
@@ -149,8 +154,8 @@ post-configure:
post-install-SHARED-on:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/openssl \
- ${STAGEDIR}${PREFIX}/lib/lib*.so.${OPENSSL_SHLIBVER} \
- ${STAGEDIR}${PREFIX}/lib/engines/lib*.so
+ ${STAGEDIR}${LIBDIR}/lib*.so.${OPENSSL_SHLIBVER} \
+ ${STAGEDIR}${LIBDIR}/engines/lib*.so
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/security/p11-kit/Makefile b/security/p11-kit/Makefile
index 46ea1a27f2fa..9cb4e90e86b9 100644
--- a/security/p11-kit/Makefile
+++ b/security/p11-kit/Makefile
@@ -23,7 +23,7 @@ CONFIGURE_ARGS= --disable-nls --enable-debug=no \
MAKE_ENV= exampledir=${STAGEDIR}${EXAMPLESDIR}
INSTALL_TARGET= install-strip
-USES= gmake libtool pathfix pkgconfig
+USES= gmake lib32 libtool pathfix pkgconfig
USE_LDCONFIG= yes
TEST_TARGET= check
diff --git a/security/trousers/Makefile b/security/trousers/Makefile
index c1e9c46d1514..75a503d0d191 100644
--- a/security/trousers/Makefile
+++ b/security/trousers/Makefile
@@ -16,10 +16,10 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= tpm-emulator>=0.7.4_1:emulators/tpm-emulator
RUN_DEPENDS:= ${BUILD_DEPENDS}
-USES= dos2unix alias autoreconf gmake iconv libtool pkgconfig ssl
+USES= dos2unix alias autoreconf gmake iconv lib32 libtool pkgconfig ssl
DOS2UNIX_GLOB= *.h *.c
NO_WRKSUBDIR= yes
-USE_LDCONFIG= YES
+USE_LDCONFIG= yes
USE_RC_SUBR= tcsd
INSTALL_TARGET= install-strip
GNU_CONFIGURE= YES
@@ -42,6 +42,13 @@ GROUPS= _tss
OPTIONS_DEFINE= DEBUG
DEBUG_CONFIGURE_ENABLE= debug
+.if defined(USE_LIB32)
+post-patch:
+ ${REINPLACE_CMD} -e 's|-L$${ICONV_PREFIX}/lib|-L$${ICONV_PREFIX}/lib32|g' ${WRKSRC}/src/tspi/Makefile.am
+ ${REINPLACE_CMD} -e 's|$${LOCALBASE}/lib/tddl_emu|$${LOCALBASE}/lib32/tddl_emu|g' ${WRKSRC}/src/tcsd/Makefile.am
+ ${REINPLACE_CMD} -e 's|OPENSSL_LIB_DIR="$$withval/lib"|OPENSSL_LIB_DIR="$$withval/lib32"|g' ${WRKSRC}/configure.ac
+.endif
+
post-install:
${INSTALL_DATA} \
${WRKSRC}/dist/tcsd.conf ${STAGEDIR}${PREFIX}/etc/tcsd.conf.sample
diff --git a/textproc/Makefile b/textproc/Makefile
index 6043f8176d80..088c2baafd32 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -345,6 +345,8 @@
SUBDIR += lasem
SUBDIR += latex-service
SUBDIR += latex2html
+ SUBDIR += lib32-expat2
+ SUBDIR += lib32-libxml2
SUBDIR += libabw
SUBDIR += libcrm114
SUBDIR += libcroco
diff --git a/textproc/expat2/Makefile b/textproc/expat2/Makefile
index 215dc10c0aa3..07faa1cdb080 100644
--- a/textproc/expat2/Makefile
+++ b/textproc/expat2/Makefile
@@ -14,7 +14,7 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
GNU_CONFIGURE= yes
-USES= libtool pathfix tar:bz2
+USES= lib32 libtool pathfix tar:bz2
USE_LDCONFIG= yes
CONFIGURE_ARGS= --without-docbook
INSTALL_TARGET= install-strip
diff --git a/textproc/lib32-expat2/Makefile b/textproc/lib32-expat2/Makefile
new file mode 100644
index 000000000000..69865ee43635
--- /dev/null
+++ b/textproc/lib32-expat2/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../expat2
+
+.include "${MASTERDIR}/Makefile"
diff --git a/textproc/lib32-libxml2/Makefile b/textproc/lib32-libxml2/Makefile
new file mode 100644
index 000000000000..b62c9b35fcb3
--- /dev/null
+++ b/textproc/lib32-libxml2/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libxml2
+
+.include "${MASTERDIR}/Makefile"
diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
index 8a60ae724b88..ad78b77e2dc5 100644
--- a/textproc/libxml2/Makefile
+++ b/textproc/libxml2/Makefile
@@ -21,7 +21,7 @@ LICENSE_FILE_TRIO= ${FILESDIR}/LICENSE.TRIO
LICENSE_PERMS_TRIO= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
GNU_CONFIGURE= yes
-USES+= cpe gmake iconv libtool pathfix pkgconfig shebangfix
+USES+= cpe gmake lib32 iconv libtool pathfix pkgconfig shebangfix
CPE_VENDOR= xmlsoft
USE_LDCONFIG= yes
CONFIGURE_ARGS?=--with-iconv=${ICONV_PREFIX} \
diff --git a/x11-fonts/Makefile b/x11-fonts/Makefile
index 24cee4126c25..e38faa8c884d 100644
--- a/x11-fonts/Makefile
+++ b/x11-fonts/Makefile
@@ -131,6 +131,7 @@
SUBDIR += league-spartan
SUBDIR += lfpfonts-fix
SUBDIR += lfpfonts-var
+ SUBDIR += lib32-fontconfig
SUBDIR += libFS
SUBDIR += libXfont
SUBDIR += libXfont2
diff --git a/x11-fonts/fontconfig/Makefile b/x11-fonts/fontconfig/Makefile
index 72758a3be76f..8e4018322f1a 100644
--- a/x11-fonts/fontconfig/Makefile
+++ b/x11-fonts/fontconfig/Makefile
@@ -14,7 +14,8 @@ COMMENT= XML-based font configuration API for X Windows
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= gperf tar:bzip2
+USES= gperf lib32 tar:bzip2
+USE_LDCONFIG= yes
.if !defined(REFERENCE_PORT)
diff --git a/x11-fonts/lib32-fontconfig/Makefile b/x11-fonts/lib32-fontconfig/Makefile
new file mode 100644
index 000000000000..c89115e31d6a
--- /dev/null
+++ b/x11-fonts/lib32-fontconfig/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../fontconfig
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/Makefile b/x11/Makefile
index 8c284ecd781b..81b27d5e0c82 100644
--- a/x11/Makefile
+++ b/x11/Makefile
@@ -133,6 +133,23 @@
SUBDIR += kf5-plasma-framework
SUBDIR += konsole
SUBDIR += lemonbar
+ SUBDIR += lib32-libX11
+ SUBDIR += lib32-libXau
+ SUBDIR += lib32-libXcomposite
+ SUBDIR += lib32-libXcursor
+ SUBDIR += lib32-libXdamage
+ SUBDIR += lib32-libXdmcp
+ SUBDIR += lib32-libXext
+ SUBDIR += lib32-libXfixes
+ SUBDIR += lib32-libXi
+ SUBDIR += lib32-libXinerama
+ SUBDIR += lib32-libXrandr
+ SUBDIR += lib32-libXrender
+ SUBDIR += lib32-libXxf86vm
+ SUBDIR += lib32-libxcb
+ SUBDIR += lib32-libxshmfence
+ SUBDIR += lib32-xorgproto
+ SUBDIR += lib32-xtrans
SUBDIR += libICE
SUBDIR += libSM
SUBDIR += libX11
diff --git a/x11/lib32-libX11/Makefile b/x11/lib32-libX11/Makefile
new file mode 100644
index 000000000000..30b94039fbcb
--- /dev/null
+++ b/x11/lib32-libX11/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libX11
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXau/Makefile b/x11/lib32-libXau/Makefile
new file mode 100644
index 000000000000..bcced61a4369
--- /dev/null
+++ b/x11/lib32-libXau/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXau
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXcomposite/Makefile b/x11/lib32-libXcomposite/Makefile
new file mode 100644
index 000000000000..170a003a3efd
--- /dev/null
+++ b/x11/lib32-libXcomposite/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXcomposite
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXcursor/Makefile b/x11/lib32-libXcursor/Makefile
new file mode 100644
index 000000000000..94b80db7958f
--- /dev/null
+++ b/x11/lib32-libXcursor/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXcursor
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXdamage/Makefile b/x11/lib32-libXdamage/Makefile
new file mode 100644
index 000000000000..9223e3cd3ddb
--- /dev/null
+++ b/x11/lib32-libXdamage/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXdamage
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXdmcp/Makefile b/x11/lib32-libXdmcp/Makefile
new file mode 100644
index 000000000000..1aa50d1484dc
--- /dev/null
+++ b/x11/lib32-libXdmcp/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXdmcp
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXext/Makefile b/x11/lib32-libXext/Makefile
new file mode 100644
index 000000000000..fb448a9be428
--- /dev/null
+++ b/x11/lib32-libXext/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXext
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXfixes/Makefile b/x11/lib32-libXfixes/Makefile
new file mode 100644
index 000000000000..eaa148564680
--- /dev/null
+++ b/x11/lib32-libXfixes/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXfixes
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXi/Makefile b/x11/lib32-libXi/Makefile
new file mode 100644
index 000000000000..d9bdc1f0c0cf
--- /dev/null
+++ b/x11/lib32-libXi/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXi
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXinerama/Makefile b/x11/lib32-libXinerama/Makefile
new file mode 100644
index 000000000000..b3b15b4237cf
--- /dev/null
+++ b/x11/lib32-libXinerama/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXinerama
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXrandr/Makefile b/x11/lib32-libXrandr/Makefile
new file mode 100644
index 000000000000..e84e4f04ecc1
--- /dev/null
+++ b/x11/lib32-libXrandr/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXrandr
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXrender/Makefile b/x11/lib32-libXrender/Makefile
new file mode 100644
index 000000000000..61538ee6410e
--- /dev/null
+++ b/x11/lib32-libXrender/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXrender
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libXxf86vm/Makefile b/x11/lib32-libXxf86vm/Makefile
new file mode 100644
index 000000000000..1c42c0a9437e
--- /dev/null
+++ b/x11/lib32-libXxf86vm/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libXxf86vm
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libxcb/Makefile b/x11/lib32-libxcb/Makefile
new file mode 100644
index 000000000000..ed28a05a2aef
--- /dev/null
+++ b/x11/lib32-libxcb/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libxcb
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-libxshmfence/Makefile b/x11/lib32-libxshmfence/Makefile
new file mode 100644
index 000000000000..2f55a30c9113
--- /dev/null
+++ b/x11/lib32-libxshmfence/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../libxshmfence
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-xorgproto/Makefile b/x11/lib32-xorgproto/Makefile
new file mode 100644
index 000000000000..a6a415537c25
--- /dev/null
+++ b/x11/lib32-xorgproto/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../xorgproto
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/lib32-xtrans/Makefile b/x11/lib32-xtrans/Makefile
new file mode 100644
index 000000000000..6e9d319c0f9a
--- /dev/null
+++ b/x11/lib32-xtrans/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_LIB32= yes
+MASTERDIR= ${.CURDIR}/../xtrans
+
+.include "${MASTERDIR}/Makefile"
diff --git a/x11/libX11/Makefile b/x11/libX11/Makefile
index 65d9e9480983..84e34493877f 100644
--- a/x11/libX11/Makefile
+++ b/x11/libX11/Makefile
@@ -11,8 +11,9 @@ COMMENT= X11 library
LICENSE= MIT
-USES= cpe perl5
+USES= cpe lib32 perl5
XORG_CAT= lib
+USE_LDCONFIG= yes
USE_XORG= xau xdmcp xtrans xorgproto xcb
USE_PERL5= build
CPE_VENDOR= x
diff --git a/x11/libXau/Makefile b/x11/libXau/Makefile
index ee9539802685..eab72f016080 100644
--- a/x11/libXau/Makefile
+++ b/x11/libXau/Makefile
@@ -11,6 +11,8 @@ COMMENT= Authentication Protocol library for X11
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
+USES= lib32
+USE_LDCONFIG= yes
XORG_CAT= lib
USE_XORG= xorgproto
diff --git a/x11/libXcomposite/Makefile b/x11/libXcomposite/Makefile
index b8a64024f793..12f1416e6c52 100644
--- a/x11/libXcomposite/Makefile
+++ b/x11/libXcomposite/Makefile
@@ -12,6 +12,8 @@ COMMENT= X Composite extension library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
+USES= lib32
+USE_LDCONFIG= yes
XORG_CAT= lib
USE_XORG= x11 xfixes xext xorgproto
diff --git a/x11/libXcursor/Makefile b/x11/libXcursor/Makefile
index d04cbeae9ca7..8977e00b6102 100644
--- a/x11/libXcursor/Makefile
+++ b/x11/libXcursor/Makefile
@@ -11,7 +11,8 @@ COMMENT= X client-side cursor loading library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= cpe
+USES= cpe lib32
+USE_LDCONFIG= yes # ?
XORG_CAT= lib
USE_XORG= xrender x11 xfixes xorgproto
CPE_VENDOR= x
diff --git a/x11/libXdamage/Makefile b/x11/libXdamage/Makefile
index affb3c93f623..706fdd603906 100644
--- a/x11/libXdamage/Makefile
+++ b/x11/libXdamage/Makefile
@@ -11,6 +11,8 @@ COMMENT= X Damage extension library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
+USES= lib32
+USE_LDCONFIG= yes
XORG_CAT= lib
USE_XORG= x11 xfixes xorgproto
diff --git a/x11/libXdmcp/Makefile b/x11/libXdmcp/Makefile
index 0b303a8d8c82..b98cb6658127 100644
--- a/x11/libXdmcp/Makefile
+++ b/x11/libXdmcp/Makefile
@@ -10,6 +10,8 @@ COMMENT= X Display Manager Control Protocol library
LICENSE= MIT
+USES= lib32
+USE_LDCONFIG= yes
XORG_CAT= lib
USE_XORG= xorgproto:both
diff --git a/x11/libXext/Makefile b/x11/libXext/Makefile
index d7364981c790..bb8291c2914f 100644
--- a/x11/libXext/Makefile
+++ b/x11/libXext/Makefile
@@ -12,7 +12,8 @@ COMMENT= X11 Extension library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= cpe
+USES= cpe lib32
+USE_LDCONFIG= yes # ?
XORG_CAT= lib
USE_XORG= x11 xau xorgproto
CPE_VENDOR= x
diff --git a/x11/libXfixes/Makefile b/x11/libXfixes/Makefile
index 9b961274be6e..38d9acbd20f3 100644
--- a/x11/libXfixes/Makefile
+++ b/x11/libXfixes/Makefile
@@ -13,7 +13,8 @@ LICENSE= MIT
XORG_CAT= lib
USE_XORG= x11 xorgproto
-USES+= cpe
+USES+= cpe lib32
+USE_LDCONFIG= yes
CPE_PRODUCT= libxfixes
CPE_VENDOR= x
diff --git a/x11/libXi/Makefile b/x11/libXi/Makefile
index d8c46d460b17..993e2d05a1dd 100644
--- a/x11/libXi/Makefile
+++ b/x11/libXi/Makefile
@@ -14,7 +14,8 @@ LICENSE= MIT
XORG_CAT= lib
USE_XORG= x11 xext xfixes xorgproto
INSTALL_TARGET= install-strip
-USES+= cpe
+USES+= lib32 cpe
+USE_LDCONFIG= yes
CPE_PRODUCT= libxi
CPE_VENDOR= x
diff --git a/x11/libXinerama/Makefile b/x11/libXinerama/Makefile
index 4cb1d9d208b8..db64417c35cc 100644
--- a/x11/libXinerama/Makefile
+++ b/x11/libXinerama/Makefile
@@ -14,7 +14,8 @@ LICENSE= MIT
XORG_CAT= lib
USE_XORG= x11 xext xorgproto
-USES+= cpe
+USES+= cpe lib32
+USE_LDCONFIG= yes
CPE_PRODUCT= libxinerama
CPE_VENDOR= x
diff --git a/x11/libXrandr/Makefile b/x11/libXrandr/Makefile
index 05e1b28f1dc6..7dff747a60d8 100644
--- a/x11/libXrandr/Makefile
+++ b/x11/libXrandr/Makefile
@@ -11,7 +11,8 @@ COMMENT= X Resize and Rotate extension library
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-USES= cpe
+USES= cpe lib32
+USE_LDCONFIG= yes # ?
XORG_CAT= lib
USE_XORG= x11 xext xrender xorgproto
CPE_VENDOR= x
diff --git a/x11/libXrender/Makefile b/x11/libXrender/Makefile
index 7389f496efa9..840871c8ab7f 100644
--- a/x11/libXrender/Makefile
+++ b/x11/libXrender/Makefile
@@ -11,6 +11,8 @@ COMMENT= X Render extension library
LICENSE= MIT
+USES= lib32
+USE_LDCONFIG= yes
XORG_CAT= lib
USE_XORG= x11 xorgproto
diff --git a/x11/libXxf86vm/Makefile b/x11/libXxf86vm/Makefile
index 53f4fc51d3c8..591b35bd6714 100644
--- a/x11/libXxf86vm/Makefile
+++ b/x11/libXxf86vm/Makefile
@@ -13,7 +13,8 @@ LICENSE= MIT
XORG_CAT= lib
USE_XORG= xorgproto x11 xext
-USES+= cpe
+USES+= lib32 cpe
+USE_LDCONFIG= yes
CPE_PRODUCT= libxxf86vm
CPE_VENDOR= x
diff --git a/x11/libxcb/Makefile b/x11/libxcb/Makefile
index 6f82b6ee9145..4d62c6d35d43 100644
--- a/x11/libxcb/Makefile
+++ b/x11/libxcb/Makefile
@@ -20,8 +20,9 @@ RUN_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-st
CONFIGURE_ARGS+= --disable-build-docs --without-doxygen --enable-xinput
XORG_CAT= lib
-USES= cpe gmake gnome python:build
+USES= cpe gmake gnome lib32 python:build
USE_GNOME= libxslt:build
+USE_LDCONFIG= yes
USE_XORG= xau xdmcp
INSTALL_TARGET= install-strip
CPE_VENDOR= x
diff --git a/x11/libxshmfence/Makefile b/x11/libxshmfence/Makefile
index 36a9672a672d..ef7f0f204741 100644
--- a/x11/libxshmfence/Makefile
+++ b/x11/libxshmfence/Makefile
@@ -9,6 +9,8 @@ COMMENT= Shared memory 'SyncFence' synchronization primitive
LICENSE= MIT
+USES= lib32
+USE_LDCONFIG= yes
USE_XORG= xorgproto
XORG_CAT= lib
diff --git a/x11/xorgproto/Makefile b/x11/xorgproto/Makefile
index d58e0ca6906e..4050111a19b1 100644
--- a/x11/xorgproto/Makefile
+++ b/x11/xorgproto/Makefile
@@ -9,6 +9,8 @@ COMMENT= xorg protocol headers
XORG_CAT= proto
+USES= lib32
+
CONFIGURE_ARGS= --without-fop \
--without-xmlto \
--without-xsltproc \
diff --git a/x11/xtrans/Makefile b/x11/xtrans/Makefile
index d954407eb036..96dac4051cfe 100644
--- a/x11/xtrans/Makefile
+++ b/x11/xtrans/Makefile
@@ -12,6 +12,8 @@ LICENSE= MIT
XORG_CAT= lib
+USES= lib32
+
CONFIGURE_ARGS+=--disable-docs --without-xmlto
.include <bsd.port.mk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment