Hi everyone, Please note: the attached patch is NOT ready to merge yet.
Just FYI I'm working on this patch at the moment. I'm gonna give it a rest for a few days while working on other tasks; I also need to test it more thoroughly before it's ready for review.
See attached. What do you think?It unifies mozilla firefox and librewolf in OpenBSD, putting most browser-specific config into a new module: www/mozilla-browser
I do away with mozconfig entirely, in LibreWolf, and once again use CONFIGURE_ARGS in ports. The logic is now in sync with FireFox.
I added all of LibreWolf's hardening to the setup, so now FireFox has a more hardened set of build options mirroring what is used in LibreWolf.
I no longer patch mozconfig or policy in LibreWolf. I delete mozconfig. The policy already disables AI like OpenBSD's one does, so everything is still in sync; the only difference now is those settings are no longer locked in LibreWolf.
This is part of a general effort to simplify the maintenance of LibreWolf, which necessarily meant integrating more tightly with OpenBSD's ports build logic. This naturally led to my unifying both ports. They're still separate ports, but they re-use a lot between each other. I could probably go further and actually have them both as one port.
Note: In this WIP patch, i have not yet unified firefox-esr. That's the last job.
What do you think generally about this sort of change? Please note that the patch is not ready to merge yet. -- Company director, Minifree Ltd Registered in England, No. 9361826 | VAT No. GB202190462 Registered Office: 19 Hilton Road, Canvey Island, Essex SS8 9QA, UK
From a41e62f84aa9416bffb1eaf688b46c26a687df98 Mon Sep 17 00:00:00 2001 From: Leah Rowe <[email protected]> Date: Wed, 2 Sep 2026 00:36:02 +0100 Subject: [PATCH 1/1] WIP: the great merge Signed-off-by: Leah Rowe <[email protected]> --- www/librewolf/Makefile | 177 ++++--------------- www/librewolf/patches/patch-lw_policies_json | 81 --------- www/librewolf/patches/patch-mozconfig | 64 ------- www/mozilla-browser/mozilla-browser.port.mk | 52 ++++++ www/mozilla-firefox/Makefile | 159 ++++++++--------- www/mozilla/mozilla.port.mk | 9 +- 6 files changed, 166 insertions(+), 376 deletions(-) delete mode 100644 www/librewolf/patches/patch-lw_policies_json delete mode 100644 www/librewolf/patches/patch-mozconfig create mode 100644 www/mozilla-browser/mozilla-browser.port.mk diff --git a/www/librewolf/Makefile b/www/librewolf/Makefile index b892a47885f..a7f2852b93a 100644 --- a/www/librewolf/Makefile +++ b/www/librewolf/Makefile @@ -1,52 +1,33 @@ COMMENT = LibreWolf web browser ONLY_FOR_ARCHS = amd64 aarch64 riscv64 -# This port was implemented by copying www/mozilla-firefox and modifying it. +MAINTAINER = Leah Rowe <[email protected]> + +HOMEPAGE = https://librewolf.net/ +REVISION = 1 -# LibreWolf uses mozconfig, so CONFIGURE_ARGS has no effect. Instead, we patch -# mozconfig at build time (via pre-configure). We stay in sync with upstream's -# mozconfig, and OpenBSD's versioning, patching and configuration for Firefox, -# thereby syncing vicariously with the LibreWolf upstream. +# lots of login in mozilla.port.mk and mozilla-browser.port.mk +MODULES = www/mozilla www/mozilla-browser lang/python -# Please also know that www/firefox-i18n is unused as LibreWolf hardcodes use -# of en-US, irrespective of the main system language, for anti-fingerprinting. +CATEGORIES = www + +# mozilla public license +PERMIT_PACKAGE= Yes + +MODPY_RUNDEP = No # If upstream adds revision number -x, it will become plx in OpenBSD, e.g. # librewolf-149.0.2-2 (upstream) becomes librewolf-149.0.2pl2 (patch level 2) MOZILLA_DIST_VERSION = 155.0-1 MOZILLA_VERSION = ${MOZILLA_DIST_VERSION:C/-([0-9]+)$/pl\1/} - MOZILLA_PROJECT = librewolf MOZILLA_CODENAME = browser -MAINTAINER = Leah Rowe <[email protected]> -REVISION = 0 - -# LibreWolf doesn't provide PGO data, but we use the data -# provided by FireFox releases, re-using the OpenBSD distfile MOZILLA_PROFDATA_TASKID = cNOKkWdaQfOqEzllBpy9Rw -FFVERSION = ${MOZILLA_DIST_VERSION:C/-([0-9]+)$//} -FFDIST = firefox-${FFVERSION}.source -DISTFILES.profdata = ${FFDIST}-profdata.tar.xz{profdata.tar.xz} - -HOMEPAGE = https://librewolf.net/ -SO_VERSION = 4.0 -# Bump minor ver if shlibs deleted in components dir to avoid pkg_add -r issues -MOZILLA_LIBS = mozavcodec mozavutil mozgtk mozinference mozwayland xul \ - clearkey gkcodecs lgpllibs mozsqlite3 - -CATEGORIES = www - -MOZSITE = https://librewolf.dev/api/packages/librewolf/generic -SITES = ${MOZSITE}/librewolf-source/${MOZILLA_DIST_VERSION}/ -EXTRACT_SUFX = .tar.gz - -# mozilla public license -PERMIT_PACKAGE= Yes -# We rely on www/mozilla for build logic -MODULES = www/mozilla lang/python - -MODPY_RUNDEP = No +SO_VERSION = 5.0 +# NOTE: Must bump minor version if any shlib's are removed from the +# components dir to avoid pkg_add -r issues. +MOZILLA_LIBS = mozavcodec mozavutil mozgtk mozinference mozwayland xul clearkey gkcodecs lgpllibs mozsqlite3 COMPILER = ports-clang MODCLANG_VERSION = 22 @@ -68,40 +49,19 @@ RUN_DEPENDS = graphics/ffmpeg # uses pledge() WANTLIB += Xrandr -CONFIGURE_STYLE = simple -CONFIGURE_SCRIPT = ${MODPY_BIN} ${WRKSRC}/configure.py -MAKE_ENV += BUILD_VERBOSE_LOG="1" CARGOFLAGS="-j${MAKE_JOBS}" -.if ${MACHINE_ARCH} == aarch64 -# retguard leads to segfault at startup on arm64, cf #1973016 -CONFIGURE_ENV += CPPFLAGS="-fno-ret-protector -Wno-backend-plugin" -.else -CONFIGURE_ENV += CPPFLAGS=-Wno-backend-plugin -.endif -CONFIGURE_ENV += LDFLAGS="-Wl,--threads=4 --ld-path=${WRKDIR}/bin/ld" -# 2026497 -CONFIGURE_ENV += MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none - -MOZILLA_USE_DBUS = Yes -MOZILLA_USE_SYSTEM_AV1 =Yes -MOZILLA_USE_SYSTEM_ZLIB=Yes - -# XXX badly formed debug ? -DWZ = : -DEBUG_PACKAGES = ${BUILD_PACKAGES} - -# not built on riscv64 -COMMENT_FFVPX ?= -.if ${MACHINE_ARCH} == riscv64 -COMMENT_FFVPX = @comment # needs a trailing space -.endif -SUBST_VARS += COMMENT_FFVPX - -TEST_IS_INTERACTIVE = x11 -# needs /etc/librewolf for pledge/unveil configs -TEST_DEPENDS = ${BUILD_PKGPATH} -# re-use virtualenv from the build instead of creating another virtualenv -TEST_ENV += PATH=/bin:/usr/bin MOZ_OBJDIR="${WRKBUILD}" \ - MOZ_AUTOMATION=1 HOME="${WRKSRC}" +CONFIGURE_ARGS += --with-app-name=${MOZILLA_PROJECT} \ + --with-branding=browser/branding/${MOZILLA_PROJECT} + +# LibreWolf doesn't provide PGO data, but we use the data +# provided by FireFox releases, re-using the OpenBSD distfile +FFVERSION = ${MOZILLA_DIST_VERSION:C/-([0-9]+)$//} +FFDIST = firefox-${FFVERSION}.source +DISTFILES.profdata = ${FFDIST}-profdata.tar.xz{profdata.tar.xz} + +# LibreWolf-specific config (not currently used in firefox) +MOZSITE = https://librewolf.dev/api/packages/librewolf/generic +SITES = ${MOZSITE}/librewolf-source/${MOZILLA_DIST_VERSION}/ +EXTRACT_SUFX = .tar.gz # various strings used next in Makefile commands MOZLIB = ${PREFIX}/lib/${MOZILLA_PROJECT} @@ -111,11 +71,10 @@ MOZPREF_LEGACY = ${MOZLIB}/browser/defaults/pref MOZDIST = ${MOZLIB}/distribution MOZAPPS = ${PREFIX}/share/applications MOZICONS = ${PREFIX}/share/icons/hicolor -MOZBRAND = ${WRKSRC}/browser/branding/${MOZILLA_PROJECT} -MOZPROFDATA = ${WRKDIR}/merged.profdata +MOZBRAND ?= ${WRKSRC}/browser/branding/${MOZILLA_PROJECT} MOZDIST_INI = [Global]\nid=OpenBSD\nversion=${OSREV}\n - UVCONTENT = /etc/${MOZILLA_PROJECT}/unveil.content + pre-test: @if grep -q "${WRKOBJDIR}" "/etc/${MOZILLA_PROJECT}/unveil.content"; \ then \ @@ -127,78 +86,16 @@ pre-test: MOZTEST = ${WRKSRC}/.mozbuild/srcdirs/${MOZILLA_PROJECT}- do-test: - cd ${WRKSRC} && \ - ${SETENV} ${TEST_ENV} \ - "${MOZTEST}"*/_virtualenvs/build/bin/python \ - ./mach xpcshell-test --sequential --keep-going + cd ${WRKSRC} && ${SETENV} ${TEST_ENV} \ + "${MOZTEST}"*/_virtualenvs/build/bin/python \ + ./mach xpcshell-test --sequential --keep-going MOZCONFIG = ${WRKSRC}/mozconfig -MOZCONFIG_ORIG = ${WRKSRC}/mozconfig.obsd pre-configure: - if [ ! -f "${MOZCONFIG_ORIG}" ]; \ - then \ - cp "${MOZCONFIG}" "${MOZCONFIG_ORIG}" ; \ - fi - cp "${MOZCONFIG_ORIG}" "${MOZCONFIG}" - sed -i -e "s,%%PREFIX%%,${PREFIX},g" "${MOZCONFIG}" - sed -i -e "s,%%LOCALBASE%%,${LOCALBASE},g" "${MOZCONFIG}" -.if defined(DEBUG) - # www/mozilla sets DEBUG_CONFIGURE_ARGS, but these - # have no effect either, due to use of mozconfig - echo "ac_add_options --enable-debug" >> "${MOZCONFIG}" - echo "ac_add_options --enable-debug-symbols" >> "${MOZCONFIG}" - echo "ac_add_options --disable-install-strip" >> "${MOZCONFIG}" -.else - # these three option greatly reduce binary sizes - echo "ac_add_options --disable-debug" >> "${MOZCONFIG}" - echo "ac_add_options --disable-debug-symbols" >> "${MOZCONFIG}" - echo "ac_add_options --enable-install-strip" >> "${MOZCONFIG}" - echo "ac_add_options --disable-tests" >> "${MOZCONFIG}" -.endif -.if ${MACHINE_ARCH} != riscv64 - # LTO eats too much RAM on riscv64 - echo "ac_add_options --enable-lto=thin" >> "${MOZCONFIG}" -.endif -.if !defined(MOZILLA_USE_BUNDLED_NSS) - echo "ac_add_options --with-system-nss" >> "${MOZCONFIG}" -.endif -.if !defined(MOZILLA_USE_BUNDLED_NSPR) - echo "ac_add_options --with-system-nspr" >> "${MOZCONFIG}" -.endif -.if !defined(MOZILLA_USE_BUNDLED_ICU) - echo "ac_add_options --with-system-icu" >> "${MOZCONFIG}" -.endif -.if !defined(MOZILLA_USE_BUNDLED_FFI) - echo "ac_add_options --with-system-ffi" >> "${MOZCONFIG}" -.endif -.if defined(MOZILLA_USE_SYSTEM_AV1) - echo "ac_add_options --with-system-av1" >> "${MOZCONFIG}" -.endif -.if defined(MOZILLA_USE_SYSTEM_ZLIB) - echo "ac_add_options --with-system-zlib" >> "${MOZCONFIG}" -.endif -.if !defined(MOZILLA_USE_DBUS) - echo "ac_add_options --disable-dbus" >> "${MOZCONFIG}" -.else - echo "ac_add_options --enable-dbus" >> "${MOZCONFIG}" -.endif -.if defined(MOZILLA_PROFDATA_TASKID) -.if ${MACHINE_ARCH:Mamd64} - echo "ac_add_options --enable-profile-use" >> "${MOZCONFIG}" - echo "ac_add_options --with-pgo-profile-path=${MOZPROFDATA}" \ - >> "${MOZCONFIG}" -.endif -.endif -# from browser/config/mozconfig -.if ${MOZILLA_CODENAME:Mcomm*} - echo "ac_add_options --enable-application=${MOZILLA_CODENAME}" \ - >> "${MOZCONFIG}" -.else -#1801738 - echo "ac_add_options --enable-project=${MOZILLA_CODENAME}" \ - >> "${MOZCONFIG}" -.endif + # CONFIGURE_ARGN has no effect with mozconfig. + # We will use our own environment. + rm -f "${MOZCONFIG}" post-install: ${INSTALL_DATA_DIR} ${PREFIX}/man/man1 diff --git a/www/librewolf/patches/patch-lw_policies_json b/www/librewolf/patches/patch-lw_policies_json deleted file mode 100644 index ba045f030c7..00000000000 --- a/www/librewolf/patches/patch-lw_policies_json +++ /dev/null @@ -1,81 +0,0 @@ -perhaps send these to librewolf upstream as well - -Index: lw/policies.json ---- lw/policies.json.orig -+++ lw/policies.json -@@ -1,26 +1,47 @@ - { - "__COMMENT__ More Information": "https://github.com/mozilla/policy-templates/blob/master/README.md", - "policies": { -- "AIControls": { -+ -+ "GenerativeAI": { -+ "Enabled": false, -+ "Chatbot": false, -+ "LinkPreviews": false, -+ "TabGroups": false, -+ "Locked": true -+ }, -+ "AIControls": { -+ "Default": { -+ "Value": "blocked", -+ "Locked": true -+ }, - "Translations": { -- "Value": "available" -+ "Value": "blocked", -+ "Locked": false - }, - "PDFAltText": { -- "Value": "blocked" -+ "Value": "blocked", -+ "Locked": false - }, - "SmartTabGroups": { -- "Value": "blocked" -+ "Value": "blocked", -+ "Locked": true - }, - "LinkPreviewKeyPoints": { -- "Value": "blocked" -+ "Value": "blocked", -+ "Locked": true - }, - "SidebarChatbot": { -- "Value": "blocked" -+ "Value": "blocked", -+ "Locked": true - }, - "SmartWindow": { -- "Value": "blocked" -+ "Value": "blocked", -+ "Locked": true - } -- }, -+ -+ }, -+ -+ - "AppUpdateURL": "https://localhost", - "DisableAppUpdate": true, - "DisableDefaultBrowserAgent": true, -@@ -73,6 +94,7 @@ - "EnablePrompting": true - }, - "NoDefaultBookmarks": true, -+ "GoToIntranetSiteForSingleWordEntryInAddressBar": true, - "OverridePostUpdatePage": "", - "SkipTermsOfUse": true, - "SupportMenu": { -@@ -84,6 +106,11 @@ - "SkipOnboarding": true, - "MoreFromMozilla": false, - "FirefoxLabs": false -+ }, -+ "SearchEngines": { -+ "Remove": [ -+ "Perplexity" -+ ] - } - } - } diff --git a/www/librewolf/patches/patch-mozconfig b/www/librewolf/patches/patch-mozconfig deleted file mode 100644 index 327fa7440ef..00000000000 --- a/www/librewolf/patches/patch-mozconfig +++ /dev/null @@ -1,64 +0,0 @@ -OpenBSD-specific build-time configuration for the LibreWolf Web Browser port - -The mozconfig is conditionally modified at build time, by the OpenBSD LibreWolf -port Makefile, e.g. add --enable-dbus if MOZILLA_USE_DBUS is set. - -Makefile-based configuration is done in pre-configure, on a copy of mozconfig -created when the build is first conducted. The originally patched mozconfig is -restored on re-builds, matching what was produced by this patch. - -Index: mozconfig ---- mozconfig.orig -+++ mozconfig -@@ -1,9 +1,16 @@ -+# %%VARIABLE%% is replaced with a string set by the -+# OpenBSD port Makefile at build time. In addition to -+# these changes, the LibreWolf OpenBSD port Makefile -+# inserts conditional changes at build-time. -+ - ac_add_options --enable-application=browser - - ac_add_options --disable-crashreporter --ac_add_options --disable-debug -+# OpenBSD configures this in the port Makefile: -+# ac_add_options --disable-debug - ac_add_options --disable-default-browser-agent --ac_add_options --disable-tests -+# OpenBSD configures this in the port Makefile: -+# ac_add_options --disable-tests - ac_add_options --disable-updater - ac_add_options --disable-cargo-incremental - ac_add_options --enable-hardening -@@ -13,8 +20,9 @@ ac_add_options --enable-release - ac_add_options --enable-rust-simd - # allow replacing malloc manually, will not affect regular systems - # not compatible with ac_add_options --disable-jemalloc, which only works when preloading custom malloc --ac_add_options --enable-replace-malloc --ac_add_options --enable-jemalloc -+# NOTE: mozjemalloc is broken on OpenBSD, so we disable it there. -+# ac_add_options --enable-replace-malloc -+# ac_add_options --enable-jemalloc - - ac_add_options --with-app-name=librewolf - ac_add_options --with-branding=browser/branding/librewolf -@@ -33,7 +41,19 @@ mk_add_options MOZ_TELEMETRY_REPORTING=0 - - export CFLAGS="-ftrivial-auto-var-init=zero -fwrapv -Wno-backend-plugin $CFLAGS" - export CXXFLAGS="-ftrivial-auto-var-init=zero -fwrapv -Wno-backend-plugin $CXXFLAGS" --#export LDFLAGS= -+# Uncommented and populated for the ports system -+export LDFLAGS="$LDFLAGS" - - # Add your own stuff, libraries, architecture, etc.. - # ex: `cat mozconfig.orig mozconfig.my > mozconfig` -+ -+# OpenBSD uses e.g. -fno-ret-protector -+export CPPFLAGS="$CPPFLAGS" -+ -+ac_add_options --prefix=%%PREFIX%% -+ac_add_options --enable-sandbox -+ac_add_options --enable-forkserver -+ac_add_options --with-wasi-sysroot=%%LOCALBASE%%/share/wasi-sysroot -+ -+# ff/lw >= 46 defaults to gtk+3 -+ac_add_options --enable-default-toolkit=cairo-gtk3 diff --git a/www/mozilla-browser/mozilla-browser.port.mk b/www/mozilla-browser/mozilla-browser.port.mk new file mode 100644 index 00000000000..fac0148e3c4 --- /dev/null +++ b/www/mozilla-browser/mozilla-browser.port.mk @@ -0,0 +1,52 @@ +# generalised config for mozilla web browsers + +CONFIGURE_ARGS += --disable-crashreporter \ + --disable-cargo-incremental \ + --enable-hardening \ + --enable-stl-hardening \ + --enable-rust-simd \ + --disable-default-browser-agent + +CONFIGURE_STYLE = simple +CONFIGURE_SCRIPT = ${MODPY_BIN} ${WRKSRC}/configure.py +CONFIGURE_ARGS += --prefix=${PREFIX} +CONFIGURE_ARGS += --enable-official-branding +MAKE_ENV += BUILD_VERBOSE_LOG="1" CARGOFLAGS="-j${MAKE_JOBS}" +.if ${MACHINE_ARCH} == aarch64 +# retguard leads to segfault at startup on arm64, cf #1973016 +CONFIGURE_ENV += CPPFLAGS="-fno-ret-protector -Wno-backend-plugin" +.else +CONFIGURE_ENV += CPPFLAGS=-Wno-backend-plugin +.endif +CONFIGURE_ENV += LDFLAGS="-Wl,--threads=4 --ld-path=${WRKDIR}/bin/ld" +# 2026497 +CONFIGURE_ENV += MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none + +MOZILLA_USE_DBUS = Yes +MOZILLA_USE_SYSTEM_AV1 =Yes +CONFIGURE_ARGS += --enable-release #1386371 +CONFIGURE_ARGS += --enable-sandbox +CONFIGURE_ARGS += --enable-forkserver +CONFIGURE_ARGS += --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot +.if ${MACHINE_ARCH} != riscv64 +# LTO eats too much RAM on riscv64 +CONFIGURE_ARGS += --enable-lto=thin +.endif + +# XXX badly formed debug ? +DWZ = : +DEBUG_PACKAGES = ${BUILD_PACKAGES} +DEBUG_CONFIGURE_ARGS += --enable-debug-symbols \ + --disable-install-strip +# not built on riscv64 +COMMENT_FFVPX ?= +.if ${MACHINE_ARCH} == riscv64 +COMMENT_FFVPX = @comment # needs a trailing space +.endif +SUBST_VARS += COMMENT_FFVPX + +TEST_IS_INTERACTIVE = x11 +# needs /etc/${MOZILLA_PROJECT} for pledge/unveil configs +TEST_DEPENDS = ${BUILD_PKGPATH} +# reuse the virtualenv created by the build process (don't duplicate) +TEST_ENV += PATH=/bin:/usr/bin MOZ_OBJDIR=${WRKBUILD} MOZ_AUTOMATION=1 HOME=${WRKSRC} diff --git a/www/mozilla-firefox/Makefile b/www/mozilla-firefox/Makefile index bb0f85b5c62..3d877a26e05 100644 --- a/www/mozilla-firefox/Makefile +++ b/www/mozilla-firefox/Makefile @@ -3,6 +3,19 @@ ONLY_FOR_ARCHS = amd64 aarch64 riscv64 # Don't forget to bump www/firefox-i18n after updates. +HOMEPAGE = https://www.mozilla.org/firefox/ +REVISION = 0 + +# lots of logic in mozilla.port.mk and mozilla-browser.port.mk +MODULES = www/mozilla www/mozilla-browser lang/python + +CATEGORIES = www + +# mozilla public license +PERMIT_PACKAGE= Yes + +MODPY_RUNDEP = No + MOZILLA_VERSION = 155.0 MOZILLA_BRANCH = release MOZILLA_PROJECT = firefox @@ -10,22 +23,12 @@ MOZILLA_CODENAME = browser MOZILLA_PROFDATA_TASKID = cNOKkWdaQfOqEzllBpy9Rw WRKDIST = ${WRKDIR}/${MOZILLA_DIST}-${MOZILLA_DIST_VERSION:C/b[0-9]*//} -HOMEPAGE = https://www.mozilla.org/firefox/ -SO_VERSION = 167.0 + +SO_VERSION = 168.0 # NOTE: Must bump minor version if any shlib's are removed from the # components dir to avoid pkg_add -r issues. MOZILLA_LIBS = mozavcodec mozavutil mozgtk mozinference mozwayland xul clearkey gkcodecs lgpllibs mozsqlite3 -CATEGORIES = www - -# mozilla public license -PERMIT_PACKAGE= Yes - -# lots of logic in mozilla.port.mk -MODULES = www/mozilla lang/python - -MODPY_RUNDEP = No - COMPILER = ports-clang MODCLANG_VERSION = 22 @@ -46,103 +49,79 @@ RUN_DEPENDS = graphics/ffmpeg # uses pledge() WANTLIB += Xrandr -CONFIGURE_STYLE = simple -CONFIGURE_SCRIPT = ${MODPY_BIN} ${WRKSRC}/configure.py -CONFIGURE_ARGS += --prefix=${PREFIX} -CONFIGURE_ARGS += --enable-official-branding -MAKE_ENV += BUILD_VERBOSE_LOG="1" CARGOFLAGS="-j${MAKE_JOBS}" -.if ${MACHINE_ARCH} == aarch64 -# retguard leads to segfault at startup on arm64, cf #1973016 -CONFIGURE_ENV += CPPFLAGS="-fno-ret-protector -Wno-backend-plugin" -.else -CONFIGURE_ENV += CPPFLAGS=-Wno-backend-plugin -.endif -CONFIGURE_ENV += LDFLAGS="-Wl,--threads=4 --ld-path=${WRKDIR}/bin/ld" -# 2026497 -CONFIGURE_ENV += MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none - -MOZILLA_USE_DBUS = Yes -MOZILLA_USE_SYSTEM_AV1 =Yes -CONFIGURE_ARGS += --enable-release #1386371 -CONFIGURE_ARGS += --enable-sandbox -CONFIGURE_ARGS += --enable-forkserver -CONFIGURE_ARGS += --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot -.if ${MACHINE_ARCH} != riscv64 -# LTO eats too much RAM on riscv64 -CONFIGURE_ARGS += --enable-lto=thin -.endif - -# XXX badly formed debug ? -DWZ = : -DEBUG_PACKAGES = ${BUILD_PACKAGES} -DEBUG_CONFIGURE_ARGS += --enable-debug-symbols \ - --disable-install-strip - -# not built on riscv64 -COMMENT_FFVPX ?= -.if ${MACHINE_ARCH} == riscv64 -COMMENT_FFVPX = @comment # needs a trailing space -.endif -SUBST_VARS += COMMENT_FFVPX - -TEST_IS_INTERACTIVE = x11 -# needs /etc/firefox for pledge/unveil configs -TEST_DEPENDS = ${BUILD_PKGPATH} -# those env vars allows to reuse the virtualenv created by the build instead of creating another one -TEST_ENV += PATH=/bin:/usr/bin MOZ_OBJDIR=${WRKBUILD} MOZ_AUTOMATION=1 HOME=${WRKSRC} +MOZBRAND = ${WRKSRC}/browser/branding/official + +# various strings used next in Makefile commands +MOZLIB = ${PREFIX}/lib/${MOZILLA_PROJECT} +MOZPREF = ${MOZLIB}/browser/defaults/preferences +# legacy directory also used, as in www/firefox (possible code smell ?) +MOZPREF_LEGACY = ${MOZLIB}/browser/defaults/pref +MOZDIST = ${MOZLIB}/distribution +MOZAPPS = ${PREFIX}/share/applications +MOZICONS = ${PREFIX}/share/icons/hicolor +MOZBRAND ?= ${WRKSRC}/browser/branding/${MOZILLA_PROJECT} +MOZDIST_INI = [Global]\nid=OpenBSD\nversion=${OSREV}\n +UVCONTENT = /etc/${MOZILLA_PROJECT}/unveil.content + pre-test: - @if grep -q ${WRKOBJDIR} /etc/${MOZILLA_PROJECT}/unveil.content; then \ + @if grep -q "${WRKOBJDIR}" "/etc/${MOZILLA_PROJECT}/unveil.content"; \ + then \ return 0 ; \ else \ - echo 'WARNING: ${WRKOBJDIR} r should be added to /etc/${MOZILLA_PROJECT}/unveil.content'; \ + echo "WARNING: ${WRKOBJDIR} r must be added to ${UVCONTENT}"; \ return 1 ; \ fi +MOZTEST = ${WRKSRC}/.mozbuild/srcdirs/${MOZILLA_PROJECT}- do-test: - cd ${WRKSRC} && \ - ${SETENV} ${TEST_ENV} ${WRKSRC}/.mozbuild/srcdirs/${MOZILLA_PROJECT}-*/_virtualenvs/build/bin/python ./mach xpcshell-test --sequential --keep-going ; \ + cd ${WRKSRC} && ${SETENV} ${TEST_ENV} \ + "${MOZTEST}"*/_virtualenvs/build/bin/python \ + ./mach xpcshell-test --sequential --keep-going post-install: + ${INSTALL_DATA_DIR} ${PREFIX}/man/man1 ${SUBST_MAN} ${FILESDIR}/mozilla-firefox.1 \ ${PREFIX}/man/man1/firefox.1 - # install prefs - ${INSTALL_DATA_DIR} ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/defaults/preferences - ${SUBST_DATA} ${FILESDIR}/all-openbsd.js \ - ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/defaults/preferences/all-openbsd.js - # install distribution.ini file - ${INSTALL_DATA_DIR} ${PREFIX}/lib/${MOZILLA_PROJECT}/distribution - echo "[Global]\nid=OpenBSD\nversion=${OSREV}\nabout=Packaged by ${MAINTAINER}\n" > \ - ${PREFIX}/lib/${MOZILLA_PROJECT}/distribution/distribution.ini - # install desktop file - ${INSTALL_DATA_DIR} ${PREFIX}/share/applications/ - ${INSTALL_DATA} ${FILESDIR}/firefox.desktop \ - ${PREFIX}/share/applications/${MOZILLA_PROJECT}.desktop - - # install policies.json - ${INSTALL_DATA} ${FILESDIR}/policies.json \ - ${PREFIX}/lib/${MOZILLA_PROJECT}/distribution/policies.json + + # preferences (OpenBSD defaults + sandboxing) + ${INSTALL_DATA_DIR} ${MOZPREF} + ${SUBST_DATA} ${FILESDIR}/all-openbsd.js ${MOZPREF}/all-openbsd.js + +.for f in pledge unveil +.for t in content gpu main rdd socket utility + ${INSTALL_DATA} ${FILESDIR}/${f}.${t} ${MOZPREF}/ +.endfor +.endfor + + # distribution metadata + ${INSTALL_DATA_DIR} ${MOZDIST} + echo "${MOZDIST_INI}about=Packaged by ${MAINTAINER}\n" \ + > "${MOZDIST}/distribution.ini" + + ${INSTALL_DATA_DIR} ${MOZDIST} + ${INSTALL_DATA} ${FILESDIR}/policies.json ${MOZDIST}/policies.json # make sure TwemojiMozilla.ttf is found ${INSTALL_DATA_DIR} ${PREFIX}/share/fonts/ mv ${PREFIX}/lib/${MOZILLA_PROJECT}/fonts ${PREFIX}/share/fonts/${MOZILLA_PROJECT} - # install icons for desktop file + # desktop and icon files + ${INSTALL_DATA_DIR} ${MOZAPPS} + ${INSTALL_DATA} ${FILESDIR}/${MOZILLA_PROJECT}.desktop \ + ${MOZAPPS}/${MOZILLA_PROJECT}.desktop + .for s in 16 22 24 32 48 64 128 256 - ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/${s}x${s}/apps - ${INSTALL_DATA} ${WRKSRC}/browser/branding/official/default${s}.png \ - ${PREFIX}/share/icons/hicolor/${s}x${s}/apps/org.mozilla.${MOZILLA_PROJECT}.png + ${INSTALL_DATA_DIR} ${MOZICONS}/${s}x${s}/apps + ${INSTALL_DATA} ${MOZBRAND}/default${s}.png \ + ${MOZICONS}/${s}x${s}/apps/org.${MOZILLA_PROJECT}.png .endfor - ${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/scalable/apps - ${INSTALL_DATA} ${WRKSRC}/browser/branding/official/content/about-logo.svg \ - ${PREFIX}/share/icons/hicolor/scalable/apps/org.mozilla.${MOZILLA_PROJECT}.svg - # link default48.png to default.png to be used by default by non-icccm compliant wm - ln -f ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/chrome/icons/default/default{48,}.png + ${INSTALL_DATA_DIR} ${MOZICONS}/scalable/apps + ${INSTALL_DATA} ${MOZBRAND}/content/about-logo.svg \ + ${MOZICONS}/scalable/apps/org.${MOZILLA_PROJECT}.svg -.for f in unveil pledge -.for t in content gpu main rdd socket utility - ${INSTALL_DATA} ${FILESDIR}/${f}.${t} ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/defaults/preferences/ -.endfor -.endfor + # compatibility symlink (non-ICCCM WMs) + ln -f ${MOZLIB}/browser/chrome/icons/default/default48.png \ + ${MOZLIB}/browser/chrome/icons/default/default.png .include <bsd.port.mk> diff --git a/www/mozilla/mozilla.port.mk b/www/mozilla/mozilla.port.mk index 68e7bc78668..336ccc256d2 100644 --- a/www/mozilla/mozilla.port.mk +++ b/www/mozilla/mozilla.port.mk @@ -148,6 +148,10 @@ USE_NOBTCFI ?= Yes # no --with-system-dav1d, cf #1493397 comment 12 # no --enable-system-hunspell, removed in #1460600 +# mitigate undefined behaviour +CFLAGS += -ftrivial-auto-var-init=zero -fwrapv +CXXFLAGS += -ftrivial-auto-var-init=zero -fwrapv + AUTOCONF_VERSION = 2.13 CONFIGURE_ARGS += --with-system-zlib \ --enable-optimize="${CFLAGS}" \ @@ -161,7 +165,7 @@ MODMOZ_WANTLIB += cairo-gobject gdk-3 gtk-3 PORTHOME = ${WRKSRC} # from browser/config/mozconfig -.if ${MOZILLA_CODENAME:Mcomm*} +.if !empty(${MOZILLA_CODENAME:Mcomm*}) CONFIGURE_ARGS +=--enable-application=${MOZILLA_CODENAME} .else #1801738 @@ -176,6 +180,9 @@ SUBST_VARS += MOZILLA_PROJECT MOZILLA_VER MOZILLA_VERSION MAKE_ENV += MOZILLA_OFFICIAL=1 \ MOZ_APP_REMOTINGNAME=${MOZILLA_PROJECT} \ + MOZ_CRASHREPORTER=0 \ + MOZ_REQUIRE_SIGNING= \ + MOZ_DATA_REPORTING=0 \ SHELL=/bin/sh \ SO_VERSION="${SO_VERSION}" \ LLVM_CONFIG="${LOCALBASE}/bin/llvm-config-${MODCLANG_VERSION}" -- 2.55.0
OpenPGP_0x5C654067D383B1FF.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
