Files
marfrit 108a3dabe6
build and publish packages / distcc-avahi-aarch64 (push) Successful in 1m38s
build and publish packages / lmcp-any (push) Successful in 16s
build and publish packages / lmcp-debian (push) Successful in 9s
build and publish packages / claude-his-any (push) Successful in 14s
build and publish packages / ffmpeg-v4l2-request-aarch64 (push) Successful in 13m9s
build and publish packages / claude-his-debian (push) Successful in 9s
build and publish packages / libva-v4l2-request-fourier-aarch64 (push) Successful in 25s
build and publish packages / ffmpeg-v4l2-request-debian (push) Successful in 29m16s
build and publish packages / daedalus-v4l2-debian (push) Successful in 13s
build and publish packages / mpv-fourier-aarch64 (push) Successful in 1m46s
build and publish packages / libva-v4l2-request-fourier-debian (push) Successful in 31s
build and publish packages / daedalus-v4l2-dkms-debian (push) Successful in 7s
build and publish packages / mpv-fourier-debian (push) Successful in 2m31s
firefox-fourier: ship .desktop launcher (pkgrel=7)
Stock firefox.desktop disappears when our 'provides=firefox' replaces stock
firefox-arch, so installing firefox-fourier left the user without a Plasma/GNOME
start-menu entry. Add firefox-fourier.desktop with Categories=Network;WebBrowser;
(routes under Internet on KDE Plasma 6), MIME types for the usual web schemes,
new-window / private-window actions, and the 128px icon from the package's
internal browser/chrome/icons tree.

Reported on ohm (PineTab2 / Plasma 6) — manual /usr/share/applications shim
proved the file works; this commits it to the recipe so future installs Just Work.
2026-05-20 00:09:31 +02:00

194 lines
7.0 KiB
Bash

# Maintainer: Markus Fritsche <mfritsche@reauktion.de>
#
# Firefox with V4L2 stateless (request API) hardware video decode
# unlocked for mainline-Linux Rockchip (RK3399 rkvdec, RK3566/RK3588
# hantro multiplanar, RK3588 rkvdec2). Sibling to chromium-fourier;
# same niche. No vendor MPP, no Mali blob, no panfork, no 5.10 BSP.
#
# Patch series adds 4 thin shims around upstream firefox (~+169 lines,
# zero deletions). Architecture: stateless decode rides libavcodec's
# v4l2_request hwaccel (AV_HWDEVICE_TYPE_DRM); no separate Mozilla V4L2
# decoder gets written. See ../../arch/firefox-fourier/PLAN.md for
# the full diagnosis. Mozilla bug 1969297.
pkgname=firefox-fourier
pkgver=150.0.1
pkgrel=7
pkgdesc='Firefox with V4L2 stateless HW video decode unlocked for mainline Linux Rockchip'
arch=('aarch64' 'x86_64')
url='https://www.mozilla.org/firefox'
license=('MPL-2.0')
depends=(
alsa-lib
at-spi2-core
cairo
dbus
ffmpeg
fontconfig
freetype2
gcc-libs
gdk-pixbuf2
glib2
glibc
gtk3
hicolor-icon-theme
libdrm
libpulse
libva
libxcb
libxkbcommon
mesa
nspr
nss
pango
pciutils
ttf-liberation
v4l-utils
)
makedepends=(
cbindgen
clang
imagemagick
inetutils
lld
llvm
mesa
nasm
nodejs
python
rust
unzip
wasi-compiler-rt
wasi-libc
yasm
zip
)
optdepends=(
'hunspell-en_us: spell checking, American English'
'libnotify: send notifications when downloads complete'
'pulseaudio: audio support'
)
provides=(firefox)
conflicts=(firefox)
options=('!emptydirs' '!strip')
source=(
"https://archive.mozilla.org/pub/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.xz"
'mozconfig'
# Arch's official firefox patches — toolchain glue for clang 22 +
# glibc 2.43 + Rust 1.95+. Picked up verbatim because we hit the same
# walls. arch-0001 (install-under-remoting) skipped — our launcher
# ships under /usr/bin/firefox-fourier with our own wrapper.
# https://gitlab.archlinux.org/archlinux/packaging/packages/firefox
'arch-0002-Bug-2033279-Make-enable-rust-simd-work-with-Rust-1.9.patch'
'arch-0003-Patch-glsl-optimizer-to-build-with-glibc-2.43.patch'
'arch-0004-Bug-2023597-Use-wasm32-wasip1-target-for-clang-22.1-.patch'
# firefox-fourier patches — V4L2 stateless decode unlock.
'0001-gfxinfo-v4l2-stateless-fourccs.patch'
'0002-libwrapper-hwdevice-ctx-create.patch'
'0003-ffmpegvideo-v4l2-request-route.patch'
'0004-prefs-v4l2-request.patch'
'0005-rdd-sandbox-v4l2-media-ctl.patch'
# Vendor-default prefs that gate the patched VAAPI path on RK3399 —
# widget.dmabuf.force-enabled etc. See marfrit-packages#8 for evidence.
'rockchip-fourier-defaults.js'
# Plasma/GNOME start-menu entry — categorises under Internet, picks the
# 128px firefox icon shipped under /usr/lib/firefox-fourier/browser/.
'firefox-fourier.desktop'
)
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')
prepare() {
cd "${srcdir}/firefox-${pkgver}"
# Toolchain glue (Arch upstream) — apply BEFORE the fourier patches.
patch -Np1 -i "${srcdir}/arch-0002-Bug-2033279-Make-enable-rust-simd-work-with-Rust-1.9.patch"
patch -Np1 -i "${srcdir}/arch-0003-Patch-glsl-optimizer-to-build-with-glibc-2.43.patch"
patch -Np1 -i "${srcdir}/arch-0004-Bug-2023597-Use-wasm32-wasip1-target-for-clang-22.1-.patch"
# Fourier patches — order matters; see ../PLAN.md for rationale.
patch -Np1 -i "${srcdir}/0001-gfxinfo-v4l2-stateless-fourccs.patch"
patch -Np1 -i "${srcdir}/0002-libwrapper-hwdevice-ctx-create.patch"
patch -Np1 -i "${srcdir}/0003-ffmpegvideo-v4l2-request-route.patch"
patch -Np1 -i "${srcdir}/0004-prefs-v4l2-request.patch"
patch -Np1 -i "${srcdir}/0005-rdd-sandbox-v4l2-media-ctl.patch"
cp "${srcdir}/mozconfig" .mozconfig
}
build() {
cd "${srcdir}/firefox-${pkgver}"
# Arch's makepkg.conf injects -fexceptions into CFLAGS/CXXFLAGS by
# default for hardening. Mozilla's STL wrappers refuse to compile
# with exceptions enabled (#error "STL code can only be used with
# -fno-exceptions"). Strip the offender before mach configure picks
# up the env. Same trick the upstream Arch firefox PKGBUILD uses.
CFLAGS="${CFLAGS//-fexceptions/}"
CXXFLAGS="${CXXFLAGS//-fexceptions/}"
export CFLAGS CXXFLAGS
export MOZ_NOSPAM=1
export MOZ_API_KEY_UNUSED=1
export MOZ_TELEMETRY_REPORTING=
export MOZ_REQUIRE_SIGNING=
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export PYTHON=/usr/bin/python
./mach configure
./mach build
}
package() {
cd "${srcdir}/firefox-${pkgver}"
DESTDIR="${pkgdir}" ./mach install
# Move mach's default /usr/local/* layout to /usr/* so we conflict
# with `firefox` cleanly and `provides=firefox` actually works.
# `cp -r` preserves the bin symlink (target lives in /usr/local) —
# delete it before staging the launcher so `cat >` doesn't follow a
# dangling symlink and ENOENT.
if [ -d "${pkgdir}/usr/local" ]; then
cp -r "${pkgdir}/usr/local/." "${pkgdir}/usr/"
rm -rf "${pkgdir}/usr/local"
fi
rm -f "${pkgdir}/usr/bin/firefox-fourier"
# Launcher script. mach's install drops the binary at
# /usr/lib/firefox-fourier/firefox-fourier (a small bash launcher) plus
# firefox-fourier-bin alongside; we exec the launcher.
cat > "${pkgdir}/usr/bin/firefox-fourier" <<'LAUNCHER'
#!/bin/bash
# firefox-fourier launcher — V4L2 stateless HW decode path defaults.
# Patch 4/4 already defaults media.ffmpeg.v4l2-request.enabled=true on
# Linux; the env vars below cover the platform-detection bits firefox
# still consults at startup.
export MOZ_ENABLE_WAYLAND="${MOZ_ENABLE_WAYLAND:-1}"
export MOZ_X11_EGL="${MOZ_X11_EGL:-1}"
exec /usr/lib/firefox-fourier/firefox-fourier "$@"
LAUNCHER
chmod 0755 "${pkgdir}/usr/bin/firefox-fourier"
# Vendor-default prefs (RK3399 HW-decode unlock) — closes #8.
# Lower precedence than user prefs / about:config; loaded by Firefox
# at startup from the package install dir. The 0004 patch covers
# media.ffmpeg.v4l2-request.enabled; this file covers the three
# additional prefs that gate the path to the patched code.
# Vendor-prefs install path: /usr/lib/firefox-fourier/defaults/preferences/
# (Mozilla's canonical scan dir for third-party default-pref drops.) The
# browser/defaults/preferences/ alternative looked promising but is NOT a
# vendor-prefs scan location in Firefox 150 — empirically confirmed on
# fresnel: file shipped there, VAAPI never engaged. Same file under
# defaults/preferences/ → MOZ_LOG showed `Requesting pixel format
# VAAPI_VLD` + dmabuf surfaces locking end-to-end.
install -Dm644 "${srcdir}/rockchip-fourier-defaults.js" \
"${pkgdir}/usr/lib/firefox-fourier/defaults/preferences/rockchip-fourier-defaults.js"
# Desktop entry — fileless install would leave the package without a
# start-menu entry (stock firefox.desktop disappears when our `provides`
# replaces stock firefox). Plasma & GNOME pick this up via the
# `Categories=Network;WebBrowser;` line → "Internet" submenu.
install -Dm644 "${srcdir}/firefox-fourier.desktop" \
"${pkgdir}/usr/share/applications/firefox-fourier.desktop"
}