--- /usr/portage/www-client/vivaldi/vivaldi-2.10.1745.23_p1.ebuild 2019-12-24 01:39:43.000000000 +0200 +++ /usr/local/portage/www-client/vivaldi/vivaldi-2.10.1745.23_p1-r1.ebuild 2020-01-05 20:36:00.916684292 +0200 @@ -28,6 +28,7 @@ LICENSE="Vivaldi" SLOT="0" KEYWORDS="-* amd64 ~arm ~arm64 x86" +IUSE="+proprietary-codecs widevine" RESTRICT="bindist mirror" DEPEND=" @@ -60,6 +61,15 @@ x11-libs/libXrender x11-libs/libXtst x11-libs/pango[X] + proprietary-codecs? ( media-video/ffmpeg[chromium,x264] ) + widevine? ( + || ( + www-plugins/chrome-binary-plugins + www-client/google-chrome + www-client/google-chrome-beta + www-client/google-chrome-unstable + ) + ) " QA_PREBUILT="*" S=${WORKDIR} @@ -90,6 +100,11 @@ etc/cron.daily/ \ etc/ \ || die + # Remove update scripts that can messup the system + rm \ + ${VIVALDI_HOME}/update-ffmpeg \ + ${VIVALDI_HOME}/update-widevine \ + || die local c d for d in 16 22 24 32 48 64 128 256; do @@ -111,6 +126,34 @@ dosym /${VIVALDI_HOME}/${PN} /usr/bin/${PN} fperms 4711 /${VIVALDI_HOME}/${PN}-sandbox + + # Fix DRM support provided by Google Chrome WidevineCdm depending on the installed Chrome + if use widevine; then + if has_version www-client/google-chrome; then + einfo ":: Using www-client/google-chrome for DRM support (WidevineCdm)" + else + rm -f "${D}"/${VIVALDI_HOME}/WidevineCdm || die + + if has_version www-plugins/chrome-binary-plugins; then + einfo ":: Using www-plugins/chrome-binary-plugins for DRM support (WidevineCdm)" + dosym /usr/$(get_libdir)/chromium-browser/WidevineCdm /${VIVALDI_HOME}/WidevineCdm + elif has_version www-client/google-chrome-unstable; then + einfo ":: Using www-client/google-chrome-unstable for DRM support (WidevineCdm)" + dosym /opt/google/chrome-unstable/WidevineCdm /${VIVALDI_HOME}/WidevineCdm + elif has_version www-client/google-chrome-beta; then + einfo ":: Using www-client/google-chrome-beta for DRM support (WidevineCdm)" + dosym /opt/google/chrome-beta/WidevineCdm /${VIVALDI_HOME}/WidevineCdm + fi + fi + else + rm -f "${D}"/${VIVALDI_HOME}/WidevineCdm || die + fi + + # Enable propriety codecs through the media-video/ffmpeg[chromium] + if use proprietary-codecs; then + einfo ":: Enabling proprietary codecs support using media-video/ffmpeg[chromium]" + dosym /usr/$(get_libdir)/chromium/libffmpeg.so /${VIVALDI_HOME}/libffmpeg.so.$(ver_cut 1-2) + fi } pkg_postrm() {