librewolf/issues
25
145

Gentoo ebuild installs Firefox language packs #2961

Closed
opened 2026年04月06日 03:11:07 +02:00 by birdcubed · 15 comments

LibreWolf Version

148.0.2-2

Operating System

Gentoo

Installation Source / Package

Official Librewolf Repository (Debian/Ubuntu/Fedora/openSUSE)

Description

Setting the L10N USE flag on the Gentoo ebuild causes Firefox language packs to be installed instead of the Librewolf ones.

I had set L10N: en-CA, which caused "Firefox" to be displayed in settings instead of "Librewolf" and caused the same WebGL prompt/permission issues as in #2927.

On line 314 of the 148.0.2_p2 ebuild:

SRC_URI+=" ${MOZ_SRC_BASE_URI}/linux-x86_64/xpi/${lang}.xpi -> ${MOZ_P_DISTFILES}-${lang}.xpi"

This should be changed to where the Librewolf language packs are located. I'd offer to do the PR, but I sadly don't know where the language packs are located.

Logs / Screenshots

No response

Checklist

  • I have searched existing issues to ensure this hasn't been reported yet.
  • I have read the FAQ and confirmed my problem isn't addressed there.
### LibreWolf Version 148.0.2-2 ### Operating System Gentoo ### Installation Source / Package Official Librewolf Repository (Debian/Ubuntu/Fedora/openSUSE) ### Description Setting the L10N USE flag on the Gentoo ebuild causes Firefox language packs to be installed instead of the Librewolf ones. I had set L10N: en-CA, which caused "Firefox" to be displayed in settings instead of "Librewolf" and caused the same WebGL prompt/permission issues as in #2927. On line 314 of the 148.0.2_p2 ebuild: ``` SRC_URI+=" ${MOZ_SRC_BASE_URI}/linux-x86_64/xpi/${lang}.xpi -> ${MOZ_P_DISTFILES}-${lang}.xpi" ``` This should be changed to where the Librewolf language packs are located. I'd offer to do the PR, but I sadly don't know where the language packs are located. ### Logs / Screenshots _No response_ ### Checklist - [x] I have searched existing issues to ensure this hasn't been reported yet. - [x] I have read the [FAQ](https://librewolf.net/docs/faq/) and confirmed my problem isn't addressed there.

Wouldn't it be possible to skip installing the mozilla langpacks and use the ones already present in https://codeberg.org/librewolf/gentoo/src/branch/master/www-client/librewolf/librewolf-148.0.2_p2.ebuild#L61?

Wouldn't it be possible to skip installing the mozilla langpacks and use the ones already present in https://codeberg.org/librewolf/gentoo/src/branch/master/www-client/librewolf/librewolf-148.0.2_p2.ebuild#L61?

Probably! I haven't really looked into how languages are stored/installed, so I was just hoping a new URL could be slotted in and the ebuild wouldn't have to change much.

Any tips on how langpacks work so I can try fixing the ebuild?

Probably! I haven't really looked into how languages are stored/installed, so I was just hoping a new URL could be slotted in and the ebuild wouldn't have to change much. Any tips on how langpacks work so I can try fixing the ebuild?
https://codeberg.org/librewolf/source/src/branch/main/assets/mozconfig.new#L25 is how we point to which langpacks to use

Either I'm confusing something or I cannot reproduce the issue.
I'm seeing the expected strings on a locally-compiled LibreWolf 148.0.2:
image
Originally posted by @doasu in librewolf/gentoo#73 (comment)

My L10N/LINGUAS env vars are:

% portageq envvar L10N LINGUAS
en en-GB pl
en en-GB pl
Either I'm confusing something or I cannot reproduce the issue. I'm seeing the expected strings on a locally-compiled LibreWolf `148.0.2`: ![image](/attachments/090eaea3-d12e-42e6-bd91-3b56e529eb60) _Originally posted by @doasu in https://codeberg.org/librewolf/gentoo/pulls/73#issuecomment-12894441_ My `L10N`/`LINGUAS` env vars are: ```console % portageq envvar L10N LINGUAS en en-GB pl en en-GB pl ```

@doasu wrote in #2961 (comment):

Either I'm confusing something or I cannot reproduce the issue. I'm seeing the expected strings on a locally-compiled LibreWolf 148.0.2: image Originally posted by @doasu in librewolf/gentoo#73 (comment)

My L10N/LINGUAS env vars are:

% portageq envvar L10N LINGUAS
en en-GB pl
en en-GB pl

It might be that they have external langpacks installed via the addon store then? (Installing additional langpacks this way was removed in release 149.0-1)

@doasu wrote in https://codeberg.org/librewolf/issues/issues/2961#issuecomment-12894516: > Either I'm confusing something or I cannot reproduce the issue. I'm seeing the expected strings on a locally-compiled LibreWolf `148.0.2`: [![image](/attachments/090eaea3-d12e-42e6-bd91-3b56e529eb60)](/librewolf/issues/attachments/090eaea3-d12e-42e6-bd91-3b56e529eb60) _Originally posted by @doasu in librewolf/gentoo#73 (comment)_ > > My `L10N`/`LINGUAS` env vars are: > > ```console > % portageq envvar L10N LINGUAS > en en-GB pl > en en-GB pl > ``` It might be that they have external langpacks installed via the addon store then? (Installing additional langpacks this way was removed in release 149.0-1)

I retract my statement, there is definitely something wrong:
(I just didn't notice the language changing from English (Traditional) to English (Simplified)) :p /j
image

I retract my statement, there is definitely something wrong: _(I just didn't notice the language changing from English (Traditional) to English (Simplified)) :p_ /j ![image](/attachments/ad10be14-97a4-44eb-b3bb-74018ba2023b)

I've been looking into a way to get language packs for LibreWolf working (at least on Gentoo).

I setup a Gitlab repository which provides languages packs using LibreWolf's sources.

I can install them manually if I disable extensions.langpacks.signatures.required in about:config and remove the section in /usr/lib64/librewolf/distribution/policies.json that prevents language packs from being installed.

Ideally I'd like to be able to drop the xpi files into /usr/lib64/librewolf/distribution/extensions/, but I need to investigate why that's not working currently.

I've been looking into a way to get language packs for LibreWolf working (at least on Gentoo). I setup a [Gitlab repository](https://gitlab.com/TheGreatMcPain/librewolf-language-packs) which provides languages packs using LibreWolf's sources. I can install them manually if I disable `extensions.langpacks.signatures.required` in `about:config` and remove the section in `/usr/lib64/librewolf/distribution/policies.json` that prevents language packs from being installed. Ideally I'd like to be able to drop the xpi files into `/usr/lib64/librewolf/distribution/extensions/`, but I need to investigate why that's not working currently.

What exactly is the intention here to diverge from the official LibreWolf build?

What exactly is the intention here to diverge from the official LibreWolf build?

Not really, I'm just trying to get the language selection to work on the Gentoo package www-client/librewolf.

At first I wanted to just see if I can provide the language packs using a Gitlab CI, so that I can just copy what Gentoo's original www-client/firefox ebuild does, but I'm gonna see what it takes to get ./mach package-multi-locale working inside our librewolf ebuild first.

Not really, I'm just trying to get the language selection to work on the Gentoo package `www-client/librewolf`. At first I wanted to just see if I can provide the language packs using a Gitlab CI, so that I can just copy what Gentoo's original `www-client/firefox` ebuild does, but I'm gonna see what it takes to get `./mach package-multi-locale` working inside our librewolf ebuild first.

Instead of trying to install them externally, why not have the build only keep the specified languages which are already in the source tarball instead?

Instead of trying to install them externally, why not have the build only keep the specified languages which are already in the source tarball instead?

@any1here wrote in #2961 (comment):

Instead of trying to install them externally, why not have the build only keep the specified languages which are already in the source tarball instead?

This is what I did in librewolf/gentoo#74/files (comment).

# Removes every directory except those whose names are present in L10N
for languagepack in *; do
[[ -d "${languagepack}" ]] || continue # not a directory; skip
rm -rf "${languagepack}"
done

It wasn't enough to make it work, though.
It seems we're missing something, because it's not enough for the lw/l10n directory to be present.

@any1here wrote in https://codeberg.org/librewolf/issues/issues/2961#issuecomment-13346901: > Instead of trying to install them externally, why not have the build only keep the specified languages which are already in the source tarball instead? This is what I did in https://codeberg.org/librewolf/gentoo/pulls/74/files#issuecomment-12912222. https://codeberg.org/librewolf/gentoo/src/commit/3a1bc63980cf346a4c5ab451d4954126afe86fba/www-client/librewolf/librewolf-148.0.2_p2.ebuild#L627-L631 It wasn't enough to make it work, though. It seems we're missing something, because it's not enough for the `lw/l10n` directory to be present.

@any1here wrote in #2961 (comment):

Instead of trying to install them externally, why not have the build only keep the specified languages which are already in the source tarball instead?

The ./mach install command used in the ebuild doesn't install the packs for some reason. I'm looking to see if our ebuild can use ./mach package-multi-locale instead.

@any1here wrote in https://codeberg.org/librewolf/issues/issues/2961#issuecomment-13346901: > Instead of trying to install them externally, why not have the build only keep the specified languages which are already in the source tarball instead? The `./mach install` command used in the ebuild doesn't install the packs for some reason. I'm looking to see if our ebuild can use `./mach package-multi-locale` instead.

This is what I've come up with.

--- librewolf-149.0.2_p2-r1.ebuild	2026年04月20日 02:58:30.610680154 -0500
+++ librewolf-149.0.2_p2-r2.ebuild	2026年04月20日 03:01:14.024852970 -0500
@@ -219,6 +219,44 @@
 	einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
 }
 
+MOZ_LANGS=(
+	ace ach af ak an ar as ast az be bg bn bn-BD bn-IN bo bqi br brx bs ca cak ca-valencia
+	ckb crh cs csb cy da de dsb el en-CA en-GB en-ZA eo es es-AR es-CL es-ES es-MX et eu fa
+	ff fi fr frp fur fy-NL ga ga-IE gd gl gn gu-IN gv he hi-IN hr hsb hto hu hy-AM hye ia id
+	ilo is it ixl ja ja-JP-mac ka kab kk km kmr kn ko kok ks ku kw lb lg lij lo lt ltg lv mai
+	meh mix mk ml mn mr ms my nb-NO ne-NP nl nn-NO nr nso ny oc or pai pa-IN pbb pl ppl pt-BR
+	pt-PT quy qvi rm ro ru rw sah sat sc scn sco si sk skr sl son sq sr ss st sv-SE sw szl ta
+	ta-LK te tg th tl tn tr trs ts tsz uk ur uz ve vi wo xcl xh zam zh-CN zh-TW zu
+)
+MOZ_LANG_MAP=()
+
+mozilla_set_globals() {
+	# https://bugs.gentoo.org/587334
+	local MOZ_TOO_REGIONALIZED_FOR_L10N=(
+		fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE
+	)
+
+	local lang xflag
+	for lang in "${MOZ_LANGS[@]}" ; do
+		# en and en_US are handled internally
+		if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then
+			continue
+		fi
+
+		# strip region subtag if $lang is in the list
+		if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then
+			xflag=${lang%%-*}
+		else
+			xflag=${lang}
+		fi
+
+		MOZ_LANG_MAP+=("l10n_${xflag/[_@]/-} ${lang}")
+
+		IUSE+=" l10n_${xflag/[_@]/-}"
+	done
+}
+mozilla_set_globals
+
 moz_clear_vendor_checksums() {
 	debug-print-function ${FUNCNAME} "$@"
 
@@ -1168,7 +1206,21 @@
 		"${BUILD_DIR}"/dist/bin/${PN} \
 		"${BUILD_DIR}"/dist/bin/plugin-container
 
-	DESTDIR="${D}" ./mach install || die
+	#DESTDIR="${D}" ./mach install || die
+	# ./mach install doesn't install the locale information for some reason.
+	# Use packge-multi-locale instead
+	local mymozlangs=()
+	for lang_tuple in "${MOZ_LANG_MAP[@]}"; do
+		IFS=' ' read -r l10n lang <<< "${lang_tuple}"
+
+		if use "${l10n}"; then
+			mymozlangs+=("${lang}")
+		fi
+	done
+	./mach package-multi-locale --locale "${mymozlangs[@]}" || die
+
+	dodir "${MOZILLA_FIVE_HOME}" || die
+	cp -r "${BUILD_DIR}"/dist/librewolf/* "${ED}"/"${MOZILLA_FIVE_HOME}" || die
 
 	## LibreWolf
 	# For some reason 'local-settings.js' doesn't get properly packaged.

It seems to be working on my end, but I've attached the new ebuild so that you can test it yourself before I go ahead and commit it.

This is what I've come up with. ``` --- librewolf-149.0.2_p2-r1.ebuild 2026年04月20日 02:58:30.610680154 -0500 +++ librewolf-149.0.2_p2-r2.ebuild 2026年04月20日 03:01:14.024852970 -0500 @@ -219,6 +219,44 @@ einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2 } +MOZ_LANGS=( + ace ach af ak an ar as ast az be bg bn bn-BD bn-IN bo bqi br brx bs ca cak ca-valencia + ckb crh cs csb cy da de dsb el en-CA en-GB en-ZA eo es es-AR es-CL es-ES es-MX et eu fa + ff fi fr frp fur fy-NL ga ga-IE gd gl gn gu-IN gv he hi-IN hr hsb hto hu hy-AM hye ia id + ilo is it ixl ja ja-JP-mac ka kab kk km kmr kn ko kok ks ku kw lb lg lij lo lt ltg lv mai + meh mix mk ml mn mr ms my nb-NO ne-NP nl nn-NO nr nso ny oc or pai pa-IN pbb pl ppl pt-BR + pt-PT quy qvi rm ro ru rw sah sat sc scn sco si sk skr sl son sq sr ss st sv-SE sw szl ta + ta-LK te tg th tl tn tr trs ts tsz uk ur uz ve vi wo xcl xh zam zh-CN zh-TW zu +) +MOZ_LANG_MAP=() + +mozilla_set_globals() { + # https://bugs.gentoo.org/587334 + local MOZ_TOO_REGIONALIZED_FOR_L10N=( + fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE + ) + + local lang xflag + for lang in "${MOZ_LANGS[@]}" ; do + # en and en_US are handled internally + if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then + continue + fi + + # strip region subtag if $lang is in the list + if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then + xflag=${lang%%-*} + else + xflag=${lang} + fi + + MOZ_LANG_MAP+=("l10n_${xflag/[_@]/-} ${lang}") + + IUSE+=" l10n_${xflag/[_@]/-}" + done +} +mozilla_set_globals + moz_clear_vendor_checksums() { debug-print-function ${FUNCNAME} "$@" @@ -1168,7 +1206,21 @@ "${BUILD_DIR}"/dist/bin/${PN} \ "${BUILD_DIR}"/dist/bin/plugin-container - DESTDIR="${D}" ./mach install || die + #DESTDIR="${D}" ./mach install || die + # ./mach install doesn't install the locale information for some reason. + # Use packge-multi-locale instead + local mymozlangs=() + for lang_tuple in "${MOZ_LANG_MAP[@]}"; do + IFS=' ' read -r l10n lang <<< "${lang_tuple}" + + if use "${l10n}"; then + mymozlangs+=("${lang}") + fi + done + ./mach package-multi-locale --locale "${mymozlangs[@]}" || die + + dodir "${MOZILLA_FIVE_HOME}" || die + cp -r "${BUILD_DIR}"/dist/librewolf/* "${ED}"/"${MOZILLA_FIVE_HOME}" || die ## LibreWolf # For some reason 'local-settings.js' doesn't get properly packaged. ``` It seems to be working on my end, but I've attached the new ebuild so that you can test it yourself before I go ahead and commit it.

I installed the 149.0.2_p2-r2 ebuild with Canadian English and Danish, and both are working! I'm getting Librewolf-specific text and the permission issues aren't happening anymore.

I installed the 149.0.2_p2-r2 ebuild with Canadian English and Danish, and both are working! I'm getting Librewolf-specific text and the permission issues aren't happening anymore.

Thanks!

Should be fixed via librewolf/gentoo@e0706977f4

Thanks! Should be fixed via https://codeberg.org/librewolf/gentoo/commit/e0706977f41b60b8a55204483ed08520efe71b26
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
Branding
Issues that relate to our logo or the branding of our browser and website.
Broken Upstream
Issue is also present in Firefox
Build
Alpine
Issues specific to the Alpine Linux build of LibreWolf.
Build
AppImage
Issues specific to the AppImage release of LibreWolf.
Build
AUR
Issues specific to the AUR build of LibreWolf.
Build
Debian
Issues specific to our official release for Debian based distros.
Build
DebianOBS
Issues specific to the non-official OBS build of LibreWolf.
Build
Fedora
Issues specific to our official release for Fedora.
Build
FedoraCOPR
Issues specific to the non-official COPR build of LibreWolf.
Build
Flatpak
Issues specific to the Flatpak release of LibreWolf.
Build
Gentoo
Issues specific to the Gentoo build of LibreWolf.
Component: Infrastructure
Issues related to infrastructure provided by LibreWolf
Component
Builds
Issues related to how we build LibreWolf
Component
Patches
Issue with one of the patches in our source code.
Component
Settings
Issues related to the settings of LibreWolf.
Component
UI
A purely cosmetic issue in our browser.
Component
Website
Issues with our website.
Docs
Change required
A needed change in our documentation.
Docs
FYI
Issues that document a change, or how stuff gets patched, built or configured.
Flag
Caution
Change that might be tricky or that needs to be carefully evaluated. Best suited for core members.
Flag
Good first issue
Suited for a first contribution as it is a straightfoward task!
FreeBSD
Issues related to the FreeBSD release of LibreWolf.
Linux
Issues realted to one or all our Linux releases.
macOS
Issues realated to the MacOS release of LibreWolf.
Needed
Help
We are stuck :-(
Needed
Info
Closing in ten days if no details are provided.
Needed
Testing
We are almost there!
Prio
High
Issues with a high priority
Prio
Low
Prio
Normal
Prio/Urgent
Issues needing immediate attention
Repositories
An issue with our repositories.
Research
Collecting informations to document something or to evaluate a change.
Source
Issues related to the source code of LibreWolf.
Status
Blocked
An issue blocked by another one.
Status
Duplicate
Look for existing issues.
Status
Icebox
Change that is not happening soon or issue that cannot be tested.
Status
Known issue
An issue that we are aware of but that we cannot fix at the moment.
Status
Not Planned
The requested feature is currently not planned
Status
Upstream
Either we upstreamed the issue or a fix is coming directly from Mozilla!
Status
Won't fix
Does not require a fix.
Type
?
What?
Type
Bug
Ouch...
Type
Discussion
Let's have a talk...
Type
Feature
A feature request.
Type
Question
Not a issue but just a user question
Type
Task
This needs to be done
Windows
Issues related to the Windows release of Librewolf.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
librewolf/issues#2961
Reference in a new issue
librewolf/issues
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?