commit:     6820eedb820d48207ddc90be02f276662401e7a1
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 20 22:07:02 2020 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Fri Nov 20 22:21:08 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6820eedb

www-client/vivaldi-snapshot: Add proprietary-codecs and widevine flags

This also removes the upstream "update" scripts that are most likely
to just break thing.

Bug: https://bugs.gentoo.org/647738
Bug: https://bugs.gentoo.org/653448
Bug: https://bugs.gentoo.org/733904
Bug: https://bugs.gentoo.org/753973
Package-Manager: Portage-3.0.9, Repoman-3.0.1
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 www-client/vivaldi-snapshot/metadata.xml               |  4 ++++
 .../vivaldi-snapshot-3.5.2110.3.ebuild                 | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/www-client/vivaldi-snapshot/metadata.xml 
b/www-client/vivaldi-snapshot/metadata.xml
index 3b94165dd3d..91c75704fe9 100644
--- a/www-client/vivaldi-snapshot/metadata.xml
+++ b/www-client/vivaldi-snapshot/metadata.xml
@@ -5,4 +5,8 @@
                <email>ch...@gentoo.org</email>
                <name>James Le Cuirot</name>
        </maintainer>
+       <use>
+               <flag name="proprietary-codecs">Use system 
<pkg>media-video/ffmpeg</pkg> to support patent-encumbered media codecs</flag>
+               <flag name="widevine">Unsupported closed-source DRM capability 
(required by Netflix VOD)</flag>
+       </use>
 </pkgmetadata>

diff --git a/www-client/vivaldi-snapshot/vivaldi-snapshot-3.5.2110.3.ebuild 
b/www-client/vivaldi-snapshot/vivaldi-snapshot-3.5.2110.3.ebuild
index 2884f5b9712..0041affa320 100644
--- a/www-client/vivaldi-snapshot/vivaldi-snapshot-3.5.2110.3.ebuild
+++ b/www-client/vivaldi-snapshot/vivaldi-snapshot-3.5.2110.3.ebuild
@@ -32,6 +32,7 @@ SRC_URI="
 LICENSE="Vivaldi"
 SLOT="0"
 KEYWORDS="-* ~amd64 ~arm ~arm64 ~x86"
+IUSE="proprietary-codecs widevine"
 RESTRICT="bindist mirror"
 
 DEPEND="
@@ -64,6 +65,8 @@ RDEPEND="
        x11-libs/libXrender
        x11-libs/libXtst
        x11-libs/pango[X]
+       proprietary-codecs? ( media-video/ffmpeg:0/56.58.58[chromium(-)] )
+       widevine? ( www-plugins/chrome-binary-plugins )
 "
 QA_PREBUILT="*"
 S=${WORKDIR}
@@ -98,6 +101,9 @@ src_prepare() {
                        usr/share/icons/hicolor/${d}x${d}/apps/${PN}.png || die
        done
 
+       # Remove scripts that will most likely break things.
+       rm ${VIVALDI_HOME}/update-{ffmpeg,widevine} || die
+
        pushd "${VIVALDI_HOME}/locales" > /dev/null || die
        chromium_remove_language_paks
        popd > /dev/null || die
@@ -111,4 +117,16 @@ src_install() {
        dosym /${VIVALDI_HOME}/${PN} /usr/bin/${PN}
 
        fperms 4711 /${VIVALDI_HOME}/vivaldi-sandbox
+
+       if use proprietary-codecs; then
+               dosym ../../../usr/$(get_libdir)/chromium/libffmpeg.so \
+                         /${VIVALDI_HOME}/lib/libffmpeg.so
+       fi
+
+       if use widevine; then
+               dosym ../../usr/$(get_libdir)/chromium-browser/WidevineCdm \
+                         /${VIVALDI_HOME}/WidevineCdm
+       else
+               rm "${ED}"/${VIVALDI_HOME}/WidevineCdm || die
+       fi
 }

Reply via email to