Hi everyone,

(I still haven't learned CVS. I patched the GitHub mirror)

This patch greatly simplifies the maintenance of the mozconfig file in LibreWolf, used for build-time configuration. The port patches mozconfig, because its use invalidates use of CONFIGURE_ARGS.

The port currently maintains an entire file at: files/mozconfig-openbsd

The file is copied, and then additional, conditional build-time configuration is performed by the Makefile via pre-configure. This design means that the mozconfig must be maintained versus upstream, and it's quite easy to forget checking upstream changes. Upstream changes are rarer, but I did have to update mozconfig recently.

In this new design, a simple patch is maintained the normal way, using the ports system's own patching mechanism. Additional build-time configuration is still performed in pre-configure. To avoid duplicated configuration on re-builds, the mozconfig is copied on the first build and then the copy is restored on subsequent builds; this copy is the original version, as created by the patch at patches/patch-mozconfig.

Please note: this patch should be applied on top of the previous patch that I sent to this list, that updated the mozconfig and policy configs. That is why REVISION=1 in the Makefile, because the previous patch added REVISION=0

If it is so desired, maintainers may squash these two patches together. For convenience, I have also attached *that* patch to this email.

The benefit of this patch is that it is now quite impossible to forget checking upstream changes on mozconfig, because we patch it the normal way. If the patch doesn't apply on updates, then we well know it. This also updates rebases, as the mozconfig changes can now be updated automatically using: make update-patches

--
Company director, Minifree Ltd
Registered in England, No. 9361826 | VAT No. GB202190462
Registered Office: 19 Hilton Road, Canvey Island, Essex SS8 9QA, UK

From 63ccf1eeca81f099f73d64f961d04a60a8aa89d1 Mon Sep 17 00:00:00 2001
From: Leah Rowe <[email protected]>
Date: Sun, 30 Aug 2026 09:20:53 +0100
Subject: [PATCH 1/1] www/librewolf: Patch mozconfig directly

We currently maintain files/mozconfig-openbsd, which means
that upstream mozconfig changes must be synced manually.

With this change, we can just update mozconfig using:
make update-patches
(or manually)

This reduces the probability that mozconfig-openbsd goes
out of sync with upstream, thereby somewhat automating the
maintenance process.

We still need to configure it at build time. It is important
that stale variables do not persist on re-builds, or that
variables are not repeated. Therefore, a copy is created of
the mozconfig on first build, and restored on subsequent
builds subject to build-time configuration.

This causes no behavioural change. It is being done to make
maintenance easier. One other, more minor change:

MOZILLA_PROJECT is no longer used in mozconfig. This is part
of a general effort, as shown by this patch, to simplify the
maintenance of LibreWolf in OpenBSD.

Signed-off-by: Leah Rowe <[email protected]>
---
 www/librewolf/Makefile                | 11 +++-
 www/librewolf/files/mozconfig-openbsd | 81 ---------------------------
 www/librewolf/patches/patch-mozconfig | 68 ++++++++++++++++++++++
 3 files changed, 76 insertions(+), 84 deletions(-)
 delete mode 100644 www/librewolf/files/mozconfig-openbsd
 create mode 100644 www/librewolf/patches/patch-mozconfig

diff --git a/www/librewolf/Makefile b/www/librewolf/Makefile
index 7ad98e9ae31..55a7bad687b 100644
--- a/www/librewolf/Makefile
+++ b/www/librewolf/Makefile
@@ -15,7 +15,7 @@ ONLY_FOR_ARCHS =	amd64 aarch64 riscv64
 # librewolf-149.0.2-2 (upstream) becomes librewolf-149.0.2pl2 (patch level 2)
 MOZILLA_DIST_VERSION =	154.0.1-3
 MOZILLA_VERSION =	${MOZILLA_DIST_VERSION:C/-([0-9]+)$/pl\1/}
-REVISION = 0
+REVISION = 1
 
 MOZILLA_PROJECT =	librewolf
 MOZILLA_CODENAME =	browser
@@ -127,9 +127,14 @@ do-test:
 		    ./mach xpcshell-test --sequential --keep-going
 
 MOZCONFIG = ${WRKSRC}/mozconfig
+MOZCONFIG_ORIG = ${WRKSRC}/mozconfig.obsd
 pre-configure:
-	cp "${FILESDIR}/mozconfig-openbsd" "${MOZCONFIG}"
-	sed -i -e "s,%%MOZILLA_PROJECT%%,${MOZILLA_PROJECT},g" "${MOZCONFIG}"
+	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)
diff --git a/www/librewolf/files/mozconfig-openbsd b/www/librewolf/files/mozconfig-openbsd
deleted file mode 100644
index eb5b8aebe8f..00000000000
--- a/www/librewolf/files/mozconfig-openbsd
+++ /dev/null
@@ -1,81 +0,0 @@
-# Maintenance notes: %%VARIABLE%% is populated from the Makefile.
-# This file closely matches upstream's mozconfig, with only surgical
-# changes made for integration with the OpenBSD ports system. Changes,
-# relative to upstream, are annotated where appropriate. Please ensure
-# that this file is updated appropriately, tracking upstream changes.
-
-ac_add_options --enable-application=browser
-
-# OpenBSD www/mozilla-firefox doesn't allow sideloading, but upstream
-# librewolf does. We disable it in the OpenBSD LibreWolf port.
-# ac_add_options --allow-addon-sideload
-ac_add_options --disable-crashreporter
-# upstream sets this unconditionally. we set conditionally in our Makefile
-# ac_add_options --disable-debug
-ac_add_options --disable-default-browser-agent
-# Upstream adds this, but we set it conditionally in our Makefile
-# ac_add_options --disable-tests
-ac_add_options --disable-updater
-ac_add_options --disable-cargo-incremental
-ac_add_options --enable-hardening
-ac_add_options --enable-stl-hardening
-ac_add_options --enable-optimize
-ac_add_options --enable-release
-# upstream uses --enable-rust-simd but www/mozilla-firefox does not.
-# --enable-rust-simd caused a build error in librewolf 150.0-1
-# 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
-# 
-# ...but openbsd is not a member of "regular systems", so we comment these;
-# mozjemalloc neither compiles nor runs safely, on OpenBSD (porting required)
-
-# upstream does: --with-app-name=librewolf
-ac_add_options --with-app-name=%%MOZILLA_PROJECT%%
-# upstream does: ac_add_options --with-branding=browser/branding/librewolf
-ac_add_options --with-branding=browser/branding/%%MOZILLA_PROJECT%%
-
-# LibreWolf upstream adds these, but we remove these for OpenBSD hardening
-# ac_add_options --with-unsigned-addon-scopes=app,system
-
-ac_add_options --with-l10n-base=$PWD/lw/l10n
-
-# OpenBSD www/firefox doesn't use this, so we won't. Disabling.
-# ac_add_options --enable-bootstrap
-
-# upstream does: MOZ_TELEMETRY_REPORTING=
-# upstream does: MOZ_REQUIRE_SIGNING=
-# upstream does: MOZILLA_OFFICIAL=1
-# upstream does: export MOZ_APP_REMOTINGNAME=LibreWolf
-
-export MOZ_APP_REMOTINGNAME=LibreWolf
-
-mk_add_options MOZ_CRASHREPORTER=0
-mk_add_options MOZ_DATA_REPORTING=0
-mk_add_options MOZ_SERVICES_HEALTHREPORT=0
-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"
-# upstream comments this, but we uncomment it for the ports system:
-export LDFLAGS="$LDFLAGS"
-
-# Everything below the line are OpenBSD *additions*
-# -----------------------------------------------------
-
-# The types of additions here are ones that should always
-# be hardcoded, on OpenBSD. Additions subject to configuration
-# are handled inside the Makefile, via pre-configure.
-
-# 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/librewolf/patches/patch-mozconfig b/www/librewolf/patches/patch-mozconfig
new file mode 100644
index 00000000000..011bd84fadf
--- /dev/null
+++ b/www/librewolf/patches/patch-mozconfig
@@ -0,0 +1,68 @@
+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,20 +1,29 @@
++# %%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
+ ac_add_options --enable-stl-hardening
+ ac_add_options --enable-optimize
+ ac_add_options --enable-release
+-ac_add_options --enable-rust-simd
++# Rust SIMD option causes build errors on OpenBSD:
++# 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 +42,19 @@
+ 
+ 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
-- 
2.47.3

From 4512b917e53c6d32466b15a14c1949fb34db4c57 Mon Sep 17 00:00:00 2001
From: Leah Rowe <[email protected]>
Date: Sat, 29 Aug 2026 13:43:03 +0100
Subject: [PATCH 1/1] Update LibreWolf policy and mozconfig

Recent updates to LibreWolf did not incorporate the new
disablement policy regarding AI. It should be noted that
LibreWolf upstream already disabled these the same way,
but did not lock these settings the same way. I have made
OpenBSD's LibreWolf port configure AI the same way as the
FireFox port (turn it all off and lock the toggles).

A minor change to mozconfig has also been made,
exporting the MOZ_APP_REMOTINGNAME string correctly.
This change is imported from upstream's newest mozconfig.

I also removed two unnecessary WANTLIB entries. Xtst
and freebl3 are not used by www/mozilla-firefox. I'm
not sure why freebl3 was added by yaydn (it was not
explained), so I've simply removed it. The firefox
port already removed Xtst several updates ago.

As the current LibreWolf version in OpenBSD is up to date,
this patch is therefore a revision only. REVISION has
been updated in the Makefile accordingly.

Extra note regarding AI:

GenerativeAI setting still retained, and expanded based
on the policy config shown by the justthebrowser project.
The individual AIControls settings from www/mozilla-firefox
are also present, adapted for LibreWolf. JustTheBrowser
disables AI in both ways: via GenerativeAI and AIControls
toggle settings.

Signed-off-by: Leah Rowe <[email protected]>
---
 www/librewolf/Makefile                       |  3 +-
 www/librewolf/files/mozconfig-openbsd        |  4 +
 www/librewolf/patches/patch-lw_policies_json | 83 +++++++++++++++++---
 3 files changed, 80 insertions(+), 10 deletions(-)

diff --git a/www/librewolf/Makefile b/www/librewolf/Makefile
index 9a215e1e3ab..7ad98e9ae31 100644
--- a/www/librewolf/Makefile
+++ b/www/librewolf/Makefile
@@ -15,6 +15,7 @@ ONLY_FOR_ARCHS =	amd64 aarch64 riscv64
 # librewolf-149.0.2-2 (upstream) becomes librewolf-149.0.2pl2 (patch level 2)
 MOZILLA_DIST_VERSION =	154.0.1-3
 MOZILLA_VERSION =	${MOZILLA_DIST_VERSION:C/-([0-9]+)$/pl\1/}
+REVISION = 0
 
 MOZILLA_PROJECT =	librewolf
 MOZILLA_CODENAME =	browser
@@ -59,7 +60,7 @@ BUILD_DEPENDS +=	devel/py-setuptools
 RUN_DEPENDS =		graphics/ffmpeg
 
 # uses pledge()
-WANTLIB += Xrandr Xtst freebl3
+WANTLIB += Xrandr
 
 CONFIGURE_STYLE =	simple
 CONFIGURE_SCRIPT =	${MODPY_BIN} ${WRKSRC}/configure.py
diff --git a/www/librewolf/files/mozconfig-openbsd b/www/librewolf/files/mozconfig-openbsd
index 2ef2958106d..eb5b8aebe8f 100644
--- a/www/librewolf/files/mozconfig-openbsd
+++ b/www/librewolf/files/mozconfig-openbsd
@@ -45,8 +45,12 @@ ac_add_options --with-l10n-base=$PWD/lw/l10n
 # OpenBSD www/firefox doesn't use this, so we won't. Disabling.
 # ac_add_options --enable-bootstrap
 
+# upstream does: MOZ_TELEMETRY_REPORTING=
 # upstream does: MOZ_REQUIRE_SIGNING=
 # upstream does: MOZILLA_OFFICIAL=1
+# upstream does: export MOZ_APP_REMOTINGNAME=LibreWolf
+
+export MOZ_APP_REMOTINGNAME=LibreWolf
 
 mk_add_options MOZ_CRASHREPORTER=0
 mk_add_options MOZ_DATA_REPORTING=0
diff --git a/www/librewolf/patches/patch-lw_policies_json b/www/librewolf/patches/patch-lw_policies_json
index f4d54544311..ba045f030c7 100644
--- a/www/librewolf/patches/patch-lw_policies_json
+++ b/www/librewolf/patches/patch-lw_policies_json
@@ -3,14 +3,79 @@ perhaps send these to librewolf upstream as well
 Index: lw/policies.json
 --- lw/policies.json.orig
 +++ lw/policies.json
-@@ -30,6 +30,10 @@
-         "DisableSetDesktopBackground": false,
-         "DisableTelemetry": true,
-         "DontCheckDefaultBrowser": true,
+@@ -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,
-+        "GenerativeAI": {
-+            "Enabled": false
+         "OverridePostUpdatePage": "",
+         "SkipTermsOfUse": true,
+         "SupportMenu": {
+@@ -84,6 +106,11 @@
+             "SkipOnboarding": true,
+             "MoreFromMozilla": false,
+             "FirefoxLabs": false
 +        },
-         "WebsiteFilter": {
-             "Block": [
-                 "https://localhost/*";
++        "SearchEngines": {
++          "Remove": [
++            "Perplexity"
++          ]
+         }
+     }
+ }
-- 
2.47.3

Attachment: OpenPGP_0x5C654067D383B1FF.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to