pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox firefox: Enable build without nodejs depen...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e572fdddabcf
branches:  trunk
changeset: 451892:e572fdddabcf
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Mon May 03 16:31:37 2021 +0000

description:
firefox: Enable build without nodejs dependency

Patch is from martin@.
For the architecture that is not supported by nodejs, for example sparc64,
lang/nodejs should not be in www/firefox dependency.

diffstat:

 www/firefox/Makefile              |  65 ++++++++++++++++++++++++++++++++++++++-
 www/firefox/distinfo              |   6 +++-
 www/firefox/files/node-wrapper.sh |   9 +++++
 www/firefox/mozilla-common.mk     |  13 +++++--
 4 files changed, 87 insertions(+), 6 deletions(-)

diffs (158 lines):

diff -r f8f74e64c551 -r e572fdddabcf www/firefox/Makefile
--- a/www/firefox/Makefile      Mon May 03 16:28:46 2021 +0000
+++ b/www/firefox/Makefile      Mon May 03 16:31:37 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.476 2021/04/21 11:42:53 adam Exp $
+# $NetBSD: Makefile,v 1.477 2021/05/03 16:31:37 ryoon Exp $
 
 FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
 MOZ_BRANCH=            88.0
@@ -11,11 +11,39 @@
 MASTER_SITES+= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
 EXTRACT_SUFX=  .tar.xz
 
+DISTFILES=     ${DEFAULT_DISTFILES} nodejs-output-88.0.tgz
+SITES.nodejs-output-88.0.tgz=  ${MASTER_SITE_LOCAL}
+
 MAINTAINER=    ryoon%NetBSD.org@localhost
 HOMEPAGE=      https://www.mozilla.org/en-US/firefox/
 COMMENT=       Web browser with support for extensions (version ${FIREFOX_VER:tu:C/\\.[[:digit:]\.]*//})
 LICENSE=       mpl-1.1
 
+# -------- BEFORE UPDATING THIS PACKAGE PLEASE READ & UNDERSTAND: -------
+#
+# This package works around a (stupid) build time dependency on nodejs
+# (which is not available for all architectures and unnecessary for the
+# real build). To do this, it places some additional burden on the
+# maintainer.
+#
+# While working on the package, please make sure you have
+#
+#      FIREFOX_MAINTAINER=yes
+#
+# set in your build environment.
+# When the package is ready for commit (but before commit), do:
+#
+#      make maintainer-files
+#
+# This will do another round (depending on state of your work dir at this
+# moment) of one or two builds and generate a cache of all output that
+# nodejs generates during a build.
+#
+# When this is done, just commit the results (they will be in the files/
+# directory).
+#
+# -----------------------------------------------------------------------
+
 UNLIMIT_RESOURCES+=    datasize virtualsize
 
 WRKSRC=                ${WRKDIR}/firefox-${FIREFOX_VER:C/b.*//}
@@ -106,6 +134,41 @@
        cd ${WRKSRC} && mkdir ${OBJDIR}
        cd ${WRKSRC}/${OBJDIR} && touch old-configure.vars
        # Do not fetch Rust Cargo file via network during build
+.if !defined(FIREFOX_MAINTAINER)
+       mv ${WRKDIR}/dist ${WRKSRC}/${OBJDIR}
+.endif
+
+.if defined(FIREFOX_MAINTAINER)
+# Create files needed only by the firefox maintainer when updating
+# the package
+# XXX - manually removing the .*_done files is wrong!
+.PHONY: build-list
+build-list:
+       cd ${WRKSRC}/${OBJDIR}/dist/bin/browser/chrome && \
+               find . -type f | sort > ${OUT:Q}
+
+NODE_LIST="${WRKDIR}/node.list"
+NO_NODE_LIST="${WRKDIR}/no-node.list"
+NODE_FILES="${WRKDIR}/node.flist"
+
+.PHONY: maintainer-files
+maintainer-files:
+       rm -f ${FILESDIR}/node-wrapper.sh
+       V=$$( node -v ) && \
+           printf '#! /bin/sh\n\nVERS=%s\n\nif [ "$$1" = "-v" ] || [ "$$1" = "--version" ]; then\n\tprintf "$${VERS}\\n"\nfi\n\nexit 0\n' $$V \
+           > ${FILESDIR}/node-wrapper.sh && \
+           chmod 0755 ${FILESDIR}/node-wrapper.sh
+       rm -f ${WRKDIR}/.build_done ${WRKDIR}/.configure_done
+       $(MAKE) MAINTAINER_INTERNAL=yes build
+       $(MAKE) MAINTAINER_INTERNAL=yes OUT="${NO_NODE_LIST}" build-list
+       $(MAKE) OUT="${NODE_LIST}" build-list
+       ${DIFF} -u "${NO_NODE_LIST}" "${NODE_LIST}" | \
+           ${AWK} \
+           '/^\+\.\//{ printf("dist/bin/browser/chrome/%s\n", gensub(/^\+\.\//, "", "")) }' \
+           > "${NODE_FILES}"
+       cd ${WRKSRC}/${OBJDIR} && tar -c -T "${NODE_FILES}" -z \
+           -f ${FILESDIR}/nodejs-output-${PKGVERSION_NOREV}.tgz
+.endif
 
 post-build:
        ${SED} -e 's|@MOZILLA@|${MOZILLA}|g'                            \
diff -r f8f74e64c551 -r e572fdddabcf www/firefox/distinfo
--- a/www/firefox/distinfo      Mon May 03 16:28:46 2021 +0000
+++ b/www/firefox/distinfo      Mon May 03 16:31:37 2021 +0000
@@ -1,9 +1,13 @@
-$NetBSD: distinfo,v 1.433 2021/04/19 13:50:07 ryoon Exp $
+$NetBSD: distinfo,v 1.434 2021/05/03 16:31:37 ryoon Exp $
 
 SHA1 (firefox-88.0.source.tar.xz) = 7a40f520b5a91b9214debf4674acf553a852bd29
 RMD160 (firefox-88.0.source.tar.xz) = 2e272a4497231a65c6a0fe9ee3550771d05d55fe
 SHA512 (firefox-88.0.source.tar.xz) = f58f44f2f0d0f54eae5ab4fa439205feb8b9209b1bf2ea2ae0c9691e9e583bae2cbd4033edb5bdf4e37eda5b95fca688499bed000fe26ced8ff4bbc49347ce31
 Size (firefox-88.0.source.tar.xz) = 373744508 bytes
+SHA1 (nodejs-output-88.0.tgz) = e36945e45df7311113f4cd4c44dc76218444f7f8
+RMD160 (nodejs-output-88.0.tgz) = ebde4f6b207b42d997d6791eaf17ab8f8d9310af
+SHA512 (nodejs-output-88.0.tgz) = bdaad8a9ba4c3ad501018a4da0889194d47c0b9321fb265d4f14cee0588672e4ea113b3b3314b40ba0f54e09d8961e0d0732aede511830073180834ede82a1cf
+Size (nodejs-output-88.0.tgz) = 200656 bytes
 SHA1 (patch-aa) = 15b8567cee2af9853f6949c80345ffcb1fd3852a
 SHA1 (patch-browser_app_profile_firefox.js) = 89cea0a66457c96ad0b94aaa524aa5942ad781d0
 SHA1 (patch-build_moz.configure_rust.configure) = 25ddfacd29cebbc6db005dbe61a2a7446d480678
diff -r f8f74e64c551 -r e572fdddabcf www/firefox/files/node-wrapper.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox/files/node-wrapper.sh Mon May 03 16:31:37 2021 +0000
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+VERS=v14.16.1
+
+if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
+       printf "${VERS}\n"
+fi
+
+exit 0
diff -r f8f74e64c551 -r e572fdddabcf www/firefox/mozilla-common.mk
--- a/www/firefox/mozilla-common.mk     Mon May 03 16:28:46 2021 +0000
+++ b/www/firefox/mozilla-common.mk     Mon May 03 16:31:37 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mozilla-common.mk,v 1.201 2021/04/21 22:21:08 gutteridge Exp $
+# $NetBSD: mozilla-common.mk,v 1.202 2021/05/03 16:31:37 ryoon Exp $
 #
 # common Makefile fragment for mozilla packages based on gecko 2.0.
 #
@@ -21,10 +21,11 @@
 GCC_REQD+=             7
 
 TOOL_DEPENDS+=         cbindgen>=0.16.0:../../devel/cbindgen
-.if ${MACHINE_ARCH} == "sparc64"
-CONFIGURE_ARGS+=       --disable-nodejs
+
+.if defined(FIREFOX_MAINTAINER) && !defined(MAINTAINER_INTERNAL)
+TOOL_DEPENDS+=         nodejs-[0-9]*:../../lang/nodejs
 .else
-TOOL_DEPENDS+=         nodejs-[0-9]*:../../lang/nodejs
+CONFIGURE_ENV+=                NODEJS="${FILESDIR}/node-wrapper.sh"
 .endif
 
 TOOL_DEPENDS+=         ${PYPKGPREFIX}-sqlite3-[0-9]*:../../databases/py-sqlite3
@@ -114,7 +115,11 @@
 
 # Build outside ${WRKSRC}
 # Try to avoid conflict with config/makefiles/xpidl/Makefile.in
+.if ${MAINTAINER_INTERNAL:Uno} == "yes
+OBJDIR=                        ../no-node-build
+.else
 OBJDIR=                        ../build
+.endif
 CONFIGURE_DIRS=                ${OBJDIR}
 CONFIGURE_SCRIPT=      ${WRKSRC}/configure
 



Home | Main Index | Thread Index | Old Index