Skip to content

widevine: fetch the CDM from Google on the Mac - #2945

Merged
maralcbr merged 2 commits into
masterfrom
asahi-import-widevine
Nov 17, 2026
Merged

maralcbr merged 2 commits into
masterfrom
asahi-import-widevine

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Summary

Omarchy Mac drops the asahi-alarm repository for 4.6. Its widevine package carries Google's libwidevinecdm.so, extracted from a ChromeOS Lacros image and binary-patched for Asahi kernels. We can't host that, so this package carries none of Google's code and fetches the CDM on the Mac.

Licence. asahi-alarm's license=('custom') points to the Chrome/ChromeOS Additional Terms, which defer to the Google Terms of Service: you may not copy, modify, distribute, sell or lease any part of Google's software. Publishing the patched library from pkgs.omarchy.org, or baking it into the image on R2, would make Omacom a distributor of modified Google software. So:

  • the package ships only our own files and David Buchanan's MIT-licensed widevine_fixup.py, with its licence. It doesn't ship Google's EULA page either;
  • the library is downloaded from Google's own chromeos-localmirror and patched on the user's Mac;
  • nothing fetches it at build time, in the pacman scriptlet, or in the image build chroot.

What the package does

  • /usr/bin/widevine-fetch downloads chromeos-lacros-arm64-squash-zstd-120.0.6098.0, checks the pinned sha256 (38a57cc3…, the same as asahi-alarm's), extracts and patches libwidevinecdm.so into /opt/WidevineCdm/chromium/_platform_specific/linux_arm64/, and adds the linux_x64 placeholder and Firefox's GMP link. When the hash still matches it does nothing. --force fetches again.
  • widevine-fetch.timer is enabled by a link the package ships, because the image builder only applies omarchy-mac's presets. It runs two minutes after boot and hourly after that. Once installed, a run only checks the hash. Offline (curl can't connect or resolve) it exits 0, so it never leaves a failed unit. A bad hash or HTTP error fails the unit and deletes the download.
  • Off a booted system (no /run/systemd/system, or systemd-detect-virt --chroot) the fetch exits 0 without doing anything. The image builder's chroot has a private /run, so it can't trigger the fetch. The install scriptlet only starts the timer on a booted system, and pre_remove deletes the fetched files.
  • The Chromium manifest, the /usr/lib/chromium/WidevineCdm link, the Firefox GMP directory, prefs and profile.d script are asahi-alarm's.
  • Same name and pkgver (4.10.2891.0), pkgrel 2, provides/conflicts=('chromium-widevine'). Upgrading from asahi-alarm's build removes its packaged library, and the timer installs ours within minutes.
  • release/mac-inventory.txt lists widevine none until edge qualifies it. tests/aurora-edge/metadata.py covers it as a Mac recipe.

Upstream. asahi-alarm's recipe (checksum fixed 2026-02-28) is the newest for aarch64. The original codeberg recipe pins Lacros 128 with CDM 4.10.2710.0, and Lacros itself is discontinued. One finding: the CDM inside Lacros 120.0.6098.0 is really 4.10.2662.3, but asahi-alarm labels it 4.10.2891.0. The recipe keeps that label so installed Macs upgrade in place.

Evidence

  • pkgbuilds/widevine/test.sh, in the self-tests: no path named *.so*, *libwidevinecdm* or *squash*, no ELF or squashfs file, nothing over 64 KiB, no remote sources or build step, the scriptlet never fetches, and the fetch exits 0 in a container. A planted ELF fails it. Passes on aarch64 and x86_64.
  • End to end on aarch64 (Arch Linux ARM builder image, guard bypassed, image served from a local copy deleted afterwards): makepkg, pacman -U, fetch, dlopen through Firefox's link, a no-op second run, an offline run exiting 0, and pacman -R leaving no /opt/WidevineCdm or /var/lib/widevine.
  • metadata.py, package-metadata.sh, pkgname-unique.sh, pinned-sources.sh, build-matrix.sh and mac-package-set.sh pass locally. namcap: warnings only.
  • Not checked: DRM playback in a browser on a Mac. That's the issue's edge qualification, with the image PROVENANCE/INSPECTION showing no libwidevinecdm.so.

Merge Danger

Door: two-way

Blast Radius: Mac installs on edge with widevine

  • On edge Macs, the next update removes asahi-alarm's library. DRM stops for a few minutes until the timer fetches ours, or right away with sudo widevine-fetch. A Mac that can't reach Google stays without Widevine until it can.
  • Each Mac downloads a 154 MB image from Google once. It's deleted after the library is installed.
  • With widevine none, a whole-channel aarch64 edge -> rc promotion is refused until the inventory names its qualified version, as for the packages in omarchy-pkgs#2943.

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with Mac playback qualification still required before promotion.

Summary

Adds a Mac-only widevine package that downloads and patches Google's library on the device instead of shipping it.

  • A booted Mac fetches and patches Widevine locally.
  • Chromium and Firefox find Widevine through the package's browser setup.
  • Mac release tracking marks Widevine as not yet qualified.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Install package without Google's library] --> B[Boot timer or manual fetch]
  B --> C{Booted system?}
  C -->|No| D[Exit without downloading]
  C -->|Yes| E[Take fetch lock]
  E --> F{Installed hash matches?}
  F -->|Yes| G[Exit]
  F -->|No| H[Download pinned image]
  H --> I[Check pinned hash]
  I --> J[Extract and patch library]
  J --> K[Install library and browser links]
Loading

Reviews (4) · Last reviewed commit: "widevine: lock fetches and stop them bef..." · Reviewed by Greptile

Comment thread pkgbuilds/widevine/widevine.install Resolved
Comment thread pkgbuilds/widevine/widevine-fetch Resolved
@maralcbr
maralcbr force-pushed the asahi-import-widevine branch from 2f78c57 to ebd8c3e Compare November 17, 2026 02:42
asahi-alarm's widevine package carries Google's libwidevinecdm.so,
extracted from a ChromeOS Lacros image and binary-patched. Google's
terms forbid copying, modifying or distributing it, so this package
holds none of it. It ships the fixup script, a pinned URL and sha256 for
the Lacros arm64 image, the Chromium manifest and links, and the Firefox
prefs. widevine-fetch downloads, checks and patches the library on the
Mac itself.

A timer enabled by the package runs the fetch after boot and hourly.
Offline runs exit cleanly, and the fetch does nothing in a chroot, so an
image build never touches the blob. The install scriptlet only starts
the timer on a booted system.

Same pkgver as asahi-alarm with a higher pkgrel, so installed Macs swap
over. The package is listed as `none` in the Mac inventory until edge
qualifies it.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Two fetches, a manual one and the timer's, shared the download and the
staged library with no lock. A fetch could also finish after pre_remove
had deleted its files and leave Google's library behind. widevine-fetch
now holds a lock in /run/widevine for the whole run, and gives up once
the package is gone. pre_remove stops the units and takes the same lock
before cleaning up, and post_remove cleans up again.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
@maralcbr
maralcbr force-pushed the asahi-import-widevine branch from 03a7e89 to 9910583 Compare November 17, 2026 02:59
@maralcbr
maralcbr merged commit c80ddfc into master Nov 17, 2026
11 checks passed
@maralcbr
maralcbr deleted the asahi-import-widevine branch November 17, 2026 03:05
@github-actions

Copy link
Copy Markdown
Contributor

Publish succeeded → live

Packages: widevine (aarch64, PR artifact)

  • edge/aarch64: widevine-4.10.2891.0-2-aarch64

Commit c80ddfc · run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant