Skip to content
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

Better Chromium: install Raspberry Pi Foundation chromium on rpi Ubuntu #2529

Merged
merged 3 commits into from
Jan 20, 2024

Conversation

theofficialgman
Copy link
Collaborator

@theofficialgman theofficialgman commented Jan 15, 2024

suggestion from #2528
closes #2528

see https://github.com/Pi-Apps-Coders/chromium-debs for the repo that re-hosts the rpi debs

@theofficialgman
Copy link
Collaborator Author

theofficialgman commented Jan 16, 2024

known issues: this triggers the frankendebian check
see latest commits

@theofficialgman theofficialgman force-pushed the better-chromium-ubuntu-rpi branch 3 times, most recently from 73018d1 to 92a7aad Compare January 16, 2024 03:22
@theofficialgman theofficialgman marked this pull request as ready for review January 16, 2024 03:40
@Botspot
Copy link
Owner

Botspot commented Jan 16, 2024

Also I am fairly sure that for widevine to show up at all on ubuntu, this logic needs to be changed to display the widevine option for the chromium package.

#detect if Widevine is enabled
if [ -d /opt/WidevineCdm ];then
  widevine=TRUE
else
  widevine=FALSE
fi
#detect if Widevine can be enabled
if package_available libwidevinecdm0 && package_installed chromium-browser;then
  widevine_possible=TRUE
  widevine_message=(--field="Enable Widevine DRM (for Netflix, Spotify)":CHK "$widevine")
else
  widevine_possible=FALSE
  widevine_message=()
fi

@theofficialgman
Copy link
Collaborator Author

theofficialgman commented Jan 16, 2024

Also I am fairly sure that for widevine to show up at all on ubuntu, this logic needs to be changed to display the widevine option for the chromium package.

#detect if Widevine is enabled
if [ -d /opt/WidevineCdm ];then
  widevine=TRUE
else
  widevine=FALSE
fi
#detect if Widevine can be enabled
if package_available libwidevinecdm0 && package_installed chromium-browser;then
  widevine_possible=TRUE
  widevine_message=(--field="Enable Widevine DRM (for Netflix, Spotify)":CHK "$widevine")
else
  widevine_possible=FALSE
  widevine_message=()
fi

Nope. The logic is good and working since the piOS libwidevinecdm0 and chromium-browser packages are used. See the apt repo.

There is no such chromium package on any version of ubuntu.
Only vanilla debian has a chromium package and there would likely never be a time when chromium-browser was unavailable and libwidevinecdm0 available. Additionally, vanilla chromium would not be able to benefit from libwidevinecdm0 since that package places widevine in a non-standard /opt folder that vanilla chromium does not look for when attempting to load widevine. The final nail in vanilla debian chromium is that it should not even attempt to look for widevine on arm64 at all (needs an additional patch), that is only added in piOS chromium-browser and ubuntu chromium-browser (snap and bionic deb) thanks to my request https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/2008433

@Botspot
Copy link
Owner

Botspot commented Jan 16, 2024

Nope. The logic is good and working since the piOS libwidevinecdm0 and chromium-browser packages are used. See the apt repo.

It appeared to me that the chromium package was to be used on ubuntu, as seen in this code snippet:

# Ubuntu must be 22.10+ (GLIBC 2.36+) to be compatible with widevine
  if printf '%s\n' "22.10" "$__os_release" | sort -CV; then
    echo 'Package: chromium*
Pin: release o=Pi-Apps-Coders chromium-debs
Pin-Priority: 1000
Package: libwidevinecdm0
Pin: release o=Pi-Apps-Coders chromium-debs
Pin-Priority: 500
Package: chromium*
Pin: release o=Ubuntu*
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/chromium >/dev/null

But now I see your wildcard character * which explains everything. Is there a reason you did not specify chromium-browser* instead?

@theofficialgman
Copy link
Collaborator Author

But now I see your wildcard character * which explains everything. Is there a reason you did not specify chromium-browser* instead?

Yes. There are other packages that need to be included. Refer to the apt repo https://github.com/Pi-Apps-Coders/chromium-debs/releases/tag/apt-release

@Botspot
Copy link
Owner

Botspot commented Jan 16, 2024

chromium-* then?

@Botspot
Copy link
Owner

Botspot commented Jan 16, 2024

Also, surely you have ruled out the option for directly using the https://archive.raspberrypi.com/debian/ repo on ubuntu but restricting it to only offer the chromium packages, right?

@theofficialgman
Copy link
Collaborator Author

Also, surely you have ruled out the option for directly using the https://archive.raspberrypi.com/debian/ repo on ubuntu but restricting it to only offer the chromium packages, right?

@Botspot yes, that was previously done, see 92a7aad . I ruled it too dangerous if the user happened to remove the pin they could end up with a broken system. It also triggers the frankendebian check so that is another problem with using it.

@theofficialgman
Copy link
Collaborator Author

chromium-* then?

yeah that is fine as well. The pi-apps-coders chromium-debs apt repos contents are fixed so the exact pin format does not really matter.
https://github.com/Pi-Apps-Coders/chromium-debs/blob/3845b4f2785e8058ea2e12f06f14e2bcb5f1ac9f/download-chromium.sh#L3-L11

@theofficialgman theofficialgman force-pushed the better-chromium-ubuntu-rpi branch 3 times, most recently from 9ae33de to fc08215 Compare January 16, 2024 22:17
safer than adding the entire archive.raspberrypi.com repo. If the user removed the pin priority they could break their system.

only show libwidevinecdm0 on 22.10+

suggestion from #2528

closes #2528

use force removal of pi-apps-coders-chromium repo

since Better Chromium requires that chromium be installed before running, chromium will never get purged as part of purge_packages since it must have either been marked manually installed or automatically installed by another package
@theofficialgman
Copy link
Collaborator Author

I have tested every iteration of this. I think it is all working as intended and suggested here #2528 (comment)

@theofficialgman
Copy link
Collaborator Author

@Botspot is anything else needed here?

@Botspot
Copy link
Owner

Botspot commented Jan 19, 2024

Looks good. Merge at will.

@theofficialgman theofficialgman merged commit 7c27141 into master Jan 20, 2024
3 checks passed
@theofficialgman theofficialgman deleted the better-chromium-ubuntu-rpi branch January 20, 2024 18:14
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.

Add WideVine support in Ubuntu through Pi-Apps
2 participants