Add a WIDEVINE option (default on) so DRM playback works with no
browser-side setup once the CDM is present. The option links
${PREFIX}/lib/WidevineCdm into the Brave install directory, where the
component updater discovers it as a preinstalled component, and runs a
pre-launch seed script that sets brave.widevine_opted_in and maintains
the Widevine component hint file: Chromium registers the CDM at
startup from the hint and never repairs it itself, so the script
plants the hint before the first launch and repoints it when its
target no longer holds a CDM (e.g. after the CDM port is reinstalled),
while leaving intact hints -- including one naming a newer
component-updated CDM -- alone.
The option adds no dependency: Google's license permits fetching the
CDM but not redistributing it (www/linux-widevine-cdm is
no-pkg-mirror), so a RUN_DEPENDS would keep linux-brave itself off the
package mirrors. Everything the option installs is inert until the
user builds www/linux-widevine-cdm from ports -- the symlink dangles
and the seed script only acts when the CDM is present -- and DRM
starts working on the next launch after the CDM appears. Verified
against Netflix, Disney+, Hulu, Amazon Prime Video, discovery+, Dish
Anywhere, and Pandora, including recovery across a CDM
remove/reinstall cycle.
Wrapper improvements:
- Re-exec under dbus-run-session when no session bus is present (new RUN_DEPENDS on devel/dbus).
- Use hardware GL when a writable DRM render node and the Linux Mesa DRI drivers (graphics/linux-rl9-dri) are present, software rendering otherwise; BRAVE_GPU=1/0 forces.
- With hardware GL, prefer ANGLE-on-Vulkan when the Linux Vulkan loader (x11-toolkits/linux-rl9-vulkan) and a hardware driver ICD are present: GL command streams from the Linux Mesa drivers have proven prone to GPU hangs on some kernel driver pairings, while the Vulkan path drives the same hardware reliably; BRAVE_VULKAN=1/0 forces.
- Never inherit a FreeBSD-side LD_PRELOAD; drop --test-type (ImmediateCrash under the Linuxulator); fix PULSE_COOKIE (literal ~ never expanded inside quotes).
- Fix pre-existing pulseaudio socket detection: pass -uw to sockstat (without -w long local addresses truncate, clipping the native socket path so the match never fired and PULSE_SERVER was never exported); quote $(whoami) against usernames bearing whitespace (pw(8) rejects them, vipw(8) does not).
Suppress the unsupported-flag warning banner via the supported
CommandLineFlagSecurityWarningsEnabled policy: the wrapper must pass
--no-sandbox because the Linuxulator lacks user namespaces.
Rewrite pkg-message to the essentials (Linuxulator setup, CDM install
step, Widevine and GPU behavior). Drop shared-mime-info dependency:
the package installs nothing under share/mime.