-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
widevine-cdm: add aarch64 support #337261
Conversation
4913908
to
40db96d
Compare
40db96d
to
0ef71c7
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/widevine-aarch64-input-needed/51209/1 |
Cool, thank you for putting in the effort. I was meaning to get to this myself but just haven't found the time. I'll review and test this tonight. |
|
||
runHook postInstall | ||
''; | ||
|
||
# Accoring to widevine-installer: "Hack because Chromium hardcodes a check for this right now..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot verify without being able to test
Result of 1 package built:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start, got some changes.
''; | ||
} else null; | ||
|
||
src = if stdenv.isAarch64 then fetchurl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src = if stdenv.isAarch64 then fetchurl { | |
src = fetchurl (if stdenv.isAarch64 then { | |
url = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/chromeos-lacros-arm64-squash-zstd-${lacrosVersion}"; | |
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY="; | |
} else { | |
url = "https://dl.google.com/widevine-cdm/${version}-linux-x64.zip"; | |
hash = "sha256-lGTrSzUk5FluH1o4E/9atLIabEpco3C3gZw+y6H6LJo="; | |
stripRoot = false; | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from my testing fetchurl doesn't know how to unpack a zip file without specifying an unpackPhase
5921521
to
9a83b97
Compare
I messed up something with the commits... now the add maintainers one is called the same as the other ones |
27af374
to
9bf71ba
Compare
9bf71ba
to
e332e2c
Compare
@RossComputerGuy do you know how I can get enableWideVine in chromium to select a local package so I can test |
Unsure if I understand the question correctly, but to get NIXPKGS_ALLOW_UNFREE=1 nix-build -E "(import ./. {}).chromium.override { enableWideVine = true; }" |
This is the part that's responsible for enabling widevine in chromium, it would fetch |
Where does it do that?
You can run that command in your branch.
Any dependency or derivation changes to Chromium would cause a rebuild. |
I did a quick look at Tidal HiFi and we'll have to build from source instead of the prebuilt x86_64 binary. However, I did find this issue when looking into their issues. castlabs/electron-releases#23 (comment)
I am not 100% certain if this could cause us any legal issues. Just bringing this up so more knowledable individuals could say whether this is a problem or not. |
Could u elaborate? |
Comparing to the x64 version, we're only applying one patch, that's the whole difference. Is the patch something that could bring trouble? |
Can't easily run x64 binaries on arm64
Well, it's to a proprietary executable. That executable contains video decoders which are proprietary as well. As long as the binary isn't redistributed there doesn't seem to be any legal concerns. |
I tried tidal-hifi and it obviously doesn't launch because it's only downloading the x64 binaries, I don't know why the nix package shows support for aarch64, it shouldn't in the first place. Would you say the chrome install as done now is figured out and good enough to merge? I would still like to come up with something for Firefox as well as proper versioning though. |
Yeah, Chrome is good enough.
I think we should bring the Firefox maintainers into the discussion. Maybe after merge, we create an issue and ping them so it doesn't clutter up this PR. |
Yeah good idea, so anything else from me or can you merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PS. We cannot build tidal hifi from source because it uses Castlab's electron with widevine built-in which does not support aarch64. So I'll just open a PR to remove advertised aarch64 support. |
buildInputs = [ squashfsTools curl python3 ]; | ||
|
||
unpackPhase = if stdenv.isAarch64 then '' | ||
curl -# -o lacros.squashfs "file://$src" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you copy this from upstream? Just copy the file...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate, I don't think I understand? unsquashfs wouldn't work without renaming using curl like widevine-installer does, but I only tried a few times, maybe it makes sense to figure this part out and remove curl from the buildInputs if that's what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curl in this case is a glorified copy or symlink. It makes sense to use it upstream because they're downloading from a URL. Please try cp
or ln
ing the file to see if that works, it should.
I see code copy-pasted without understanding from Asahi, I see comments marked as resolved without being addressed, this is not the kind of change we want to have. Reverting in #338262, please open a new PR and iterate. |
Credit to @dxwil for the original attempt in NixOS#337261, this is a reattempt at adding aarch64-linux support to Widevine CDM based on how Asahi Linux deals with it. Signed-off-by: Tristan Ross <[email protected]>
Credit to @dxwil for the original attempt in NixOS#337261, this is a reattempt at adding aarch64-linux support to Widevine CDM based on how Asahi Linux deals with it. Signed-off-by: Tristan Ross <[email protected]>
Credit to @dxwil for the original attempt in NixOS#337261, this is a reattempt at adding aarch64-linux support to Widevine CDM based on how Asahi Linux deals with it. Signed-off-by: Tristan Ross <[email protected]>
Description of changes
Adds support for arm64 widevine using code from widevine-installer. The package builds and outputs the relevant files in the same locations as the x64 version, although I cannot test it because I don't know how to make chromium.enableWideVine select a local version, it tries to install the x64 one (please help me on this one :).
There are also some things I would like input on from someone else:
Edit: after some googling I see that Firefox drm works out of the box for x64, but for arm the changes linked above are still necessary.
Edit 2: What I don't understand is why Firefox doesn't need a seperate flag for widevine like chromium, is it because Firefox only installs widevine if drm is explicitly enabled and chromium auto installs it on launch? Could it also have something to do with licenses, why isn't Firefox unfree when it has widevine and chromium is?
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.