git: 06b01a346ea4 - 2025Q3 - www/librewolf: Fix build on i386, improve port

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Fri, 18 Jul 2025 23:48:33 UTC
The branch 2025Q3 has been updated by vvd:

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

commit 06b01a346ea40b6a2b0473dcab0a94cf33bd9372
Author:     Martin Filla <freebsd@sysctl.cz>
AuthorDate: 2025-07-18 23:45:53 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-07-18 23:48:27 +0000

    www/librewolf: Fix build on i386, improve port
    
    - Fix build on i386 - use www/node24 on i386 and hande sse2.
    - Unification of Makefile with Firefox - make it more similar.
    - Use ${DESKTOPDIR} instead if ${PREFIX}/share/applications.
    
    PR:     288107
    MFH:    2025Q3
    (cherry picked from commit 6f3a8ff37218c5200c8822de90577e95811c3a5e)
---
 www/librewolf/Makefile | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/www/librewolf/Makefile b/www/librewolf/Makefile
index 6592f932de9f..1bb46bc7c67a 100644
--- a/www/librewolf/Makefile
+++ b/www/librewolf/Makefile
@@ -39,15 +39,19 @@ CONFIGURE_ENV+=	MOZ_REQUIRE_SIGNING=""
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSION}${LWPATCH}
 
+FIREFOX_ICON=		${MOZILLA}.png
+FIREFOX_ICON_SRC=	${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png
+
 MOZILLA_CAP=	${MOZILLA:C/^(.).*/\1/:tu}${MOZILLA:C/^.//}
 
-MOZ_EXPORT+=	MOZ_TELEMETRY_REPORTING="" \
+MOZ_EXPORT=	MOZ_TELEMETRY_REPORTING="" \
 		MOZILLA_OFFICIAL="1" \
 		MOZ_OFFICIAL_BRANDING="1" \
 		MOZ_APP_DISPLAYNAME="${MOZILLA_CAP}" \
 		MOZ_APP_NAME="${MOZILLA}"
 
 MOZ_OPTIONS=	--enable-application=browser \
+		--with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot \
 		--allow-addon-sideload \
 		--disable-crashreporter \
 		--disable-debug \
@@ -61,21 +65,21 @@ MOZ_OPTIONS=	--enable-application=browser \
 		--with-branding=browser/branding/${MOZILLA} \
 		--with-unsigned-addon-scopes=app,system \
 		--enable-bootstrap \
-		--with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot \
 		MOZ_CRASHREPORTER=0 \
 		MOZ_DATA_REPORTING=0
 
-FIREFOX_ICON=		${MOZILLA}.png
-FIREFOX_ICON_SRC=	${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png
-
 .include "${.CURDIR}/../../www/firefox/Makefile.options"
 
 .include <bsd.port.options.mk>
 
-.if ${ARCH} == i386 && ${MACHINE_CPU:Msse2}
+.if ${ARCH} == i386
+BUILD_DEPENDS+=	node${NODEJS_VERSION}>=24:www/node${NODEJS_VERSION}
+USES+=		nodejs:24,build,env
+.  if ${MACHINE_CPU:Msse2}
 # is not enabled on i386 by default
 # Fix for error: always_inline function '_mm_setzero_si64' requires target feature 'sse2'
 CFLAGS_i386+=	-msse2
+.  endif
 .endif
 
 .if ${ARCH} == amd64
@@ -94,7 +98,7 @@ post-patch:
 	@${RM} ${WRKSRC}/mozconfig
 
 post-install:
-	${INSTALL_DATA} ${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop ${STAGEDIR}${PREFIX}/share/applications
+	${INSTALL_DATA} ${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop ${STAGEDIR}${DESKTOPDIR}
 	${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
 	${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON}