git: b877870321e9 - main - misc/compat14x: Add COMPAT32 option

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Mon, 23 Jun 2025 06:32:20 UTC
The branch main has been updated by arrowd:

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

commit b877870321e9648e76830352f1ed3aa41478c70f
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-06-23 06:31:47 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-06-23 06:32:12 +0000

    misc/compat14x: Add COMPAT32 option
    
    PR:             287699
---
 misc/compat14x/Makefile        | 18 ++++++++++++++----
 misc/compat14x/pkg-plist.amd64 |  2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/misc/compat14x/Makefile b/misc/compat14x/Makefile
index 8b25f38d7f4a..c8510455521d 100644
--- a/misc/compat14x/Makefile
+++ b/misc/compat14x/Makefile
@@ -1,12 +1,13 @@
 PORTNAME=	compat14x
 PORTVERSION=	14.2.1402000.20250430
+PORTREVISION=	1
 CATEGORIES=	misc
 MASTER_SITES=	LOCAL/arrowd
 PKGNAMESUFFIX=	-${ARCH}
 DISTNAME=	${PORTNAME}-${ARCH}-${PORTVERSION}
 
 MAINTAINER=	arrowd@FreeBSD.org
-COMMENT=	Convenience package to install the compat13x libraries
+COMMENT=	Convenience package to install the compat14x libraries
 
 LICENSE=	BSD2CLAUSE
 
@@ -18,22 +19,31 @@ TARGET_DIR=	${PREFIX}/lib/compat
 TARGET32_DIR=	${PREFIX}/lib32/compat
 USE_LDCONFIG=	${TARGET_DIR}
 
+OPTIONS_DEFINE=	COMPAT32
+OPTIONS_DEFAULT=COMPAT32
+OPTIONS_EXCLUDE_aarch64=COMPAT32
+OPTIONS_EXCLUDE_i386=COMPAT32
+COMPAT32_DESC=	Install 32-bit compat libraries
+OPTIONS_SUB=	yes
+
 .include <bsd.port.pre.mk>
 
 .if ${OSREL:R} < 14
 IGNORE=		is for FreeBSD 14.x and newer
 .endif
 
-.if ${ARCH} == amd64
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MCOMPAT32}
 USE_LDCONFIG32=	${TARGET32_DIR}
 .endif
 
 do-install:
 	@${MKDIR} -m 0755 ${STAGEDIR}${TARGET_DIR}
 	(cd ${WRKSRC}/lib && ${INSTALL_LIB} *.so.* ${STAGEDIR}${TARGET_DIR})
-.if ${ARCH} == amd64
+
+do-install-COMPAT32-on:
 	@${MKDIR} ${STAGEDIR}${TARGET32_DIR}
 	(cd ${WRKSRC}/lib32 && ${INSTALL_LIB} *.so.* ${STAGEDIR}${TARGET32_DIR})
-.endif
 
 .include <bsd.port.post.mk>
diff --git a/misc/compat14x/pkg-plist.amd64 b/misc/compat14x/pkg-plist.amd64
index 836459079f4d..08bba09dc92e 100644
--- a/misc/compat14x/pkg-plist.amd64
+++ b/misc/compat14x/pkg-plist.amd64
@@ -1,2 +1,2 @@
 lib/compat/libmd.so.6
-lib32/compat/libmd.so.6
+%%COMPAT32%%lib32/compat/libmd.so.6