git: e5c6d5843623 - main - emulators/wine-devel: Add support for ntsync

From: Kenneth Raplee <kenrap_at_FreeBSD.org>
Date: Wed, 09 Sep 2026 07:58:12 UTC
The branch main has been updated by kenrap:

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

commit e5c6d5843623f017fd8fa86744051b9ba3a025ea
Author:     Thibault Payet <monwarez@mailoo.org>
AuthorDate: 2026-08-23 07:23:34 +0000
Commit:     Kenneth Raplee <kenrap@FreeBSD.org>
CommitDate: 2026-09-09 07:55:56 +0000

    emulators/wine-devel: Add support for ntsync
    
    PR:             297438
    Reviewed by:    makc (mentor)
    Approved by:    arrowd (co-mentor)
---
 emulators/wine-devel/Makefile | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/emulators/wine-devel/Makefile b/emulators/wine-devel/Makefile
index a003cef1e7af..26421fc580eb 100644
--- a/emulators/wine-devel/Makefile
+++ b/emulators/wine-devel/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	wine
 DISTVERSION=	11.17
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	emulators
 MASTER_SITES=	https://dl.winehq.org/wine/source/11.x/
@@ -16,6 +17,14 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 ONLY_FOR_ARCHS=	amd64
 
 BUILD_DEPENDS=	${LOCALBASE}/bin/flex:textproc/flex
+
+.if exists(/usr/include/dev/ntsync/ntsync.h)
+HAS_NTSYNC=	yes
+.endif
+
+.if ${HAS_NTSYNC}
+BUILD_DEPENDS+=	${LOCALBASE}/include/linuxapi/linux/ntsync.h:devel/linuxapi
+.endif
 LIB_DEPENDS=	libhwloc.so:devel/hwloc2
 
 FLAVORS=	default allaudio
@@ -59,6 +68,10 @@ CONFIGURE_ARGS=	--verbose \
 		--with-usb
 CONFIGURE_ENV=	CPPBIN="${CPP}" FLEX="${LOCALBASE}/bin/flex"
 
+.if ${HAS_NTSYNC}
+CFLAGS+=	-I${WRKDIR}/include/linuxapi
+CXXFLAGS+=	-I${WRKDIR}/include/linuxapi
+.endif
 PIE_UNSAFE=	yes
 
 CONFLICTS_INSTALL=	wine
@@ -148,6 +161,14 @@ CONFIGURE_ARGS+=	--enable-win64 --libdir=${PREFIX}/lib
 PLIST_SUB+=		WINEARCH="x86_64"
 .endif
 
+.if ${HAS_NTSYNC}
+pre-configure:
+	@${MKDIR} ${WRKDIR}/include/linuxapi/linux
+	@${CP} ${LOCALBASE}/include/linuxapi/linux/ntsync.h ${WRKDIR}/include/linuxapi/linux/
+	@${CP} ${LOCALBASE}/include/linuxapi/linux/types.h ${WRKDIR}/include/linuxapi/linux/
+	@${CP} ${LOCALBASE}/include/linuxapi/linux/stddef.h ${WRKDIR}/include/linuxapi/linux/
+.endif
+
 pre-build:
 	cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${MAKE_CMD} depend