summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart De Vries2020-10-12 23:53:05 +0200
committerBart De Vries2020-10-12 23:53:05 +0200
commitcb3d87b38708c5cbb0bf97ff89ca5e7cf37b820c (patch)
tree1de05553b2c10e274555d70794ee29258942c115
downloadaur-cb3d87b38708c5cbb0bf97ff89ca5e7cf37b820c.tar.gz
Initial version of widevine-armv7h package
-rw-r--r--.SRCINFO32
-rw-r--r--LICENSE8
-rw-r--r--PKGBUILD91
-rwxr-xr-xregister_widevine_chromium3
-rwxr-xr-xregister_widevine_firefox37
-rw-r--r--widevine-armv7h.install11
6 files changed, 182 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8dfe20e6f0a1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = widevine-armv7h
+ pkgdesc = A browser plugin designed for the viewing of premium video content (version for armv7h)
+ pkgver = 4.10.1679.0
+ pkgrel = 1
+ url = https://www.widevine.com/
+ install = widevine-armv7h.install
+ arch = armv7h
+ license = custom
+ makedepends = p7zip
+ depends = gcc-libs
+ depends = glib2
+ depends = glibc
+ depends = nspr
+ depends = nss
+ provides = chromium-widevine
+ conflicts = chromium-widevine
+ conflicts = chromium-widevine-armv7h
+ noextract = chromeos_13099.110.0_jacuzzi_recovery_stable-channel_mp-v3.bin.zip
+ options = !strip
+ source = chrome-eula_text.html::https://www.google.com/intl/en/chrome/privacy/eula_text.html
+ source = https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13099.110.0_jacuzzi_recovery_stable-channel_mp-v3.bin.zip
+ source = register_widevine_chromium
+ source = register_widevine_firefox
+ source = widevine-armv7h.install
+ sha256sums = SKIP
+ sha256sums = cbec1708dd978b2353481d9ca8e022c287abfe53309d51532df2f17703a5450c
+ sha256sums = ebca260ca197c4eee5a8b76ae1fad2bf800ab99b40d8be0c2189b566bd9621d0
+ sha256sums = b976bb594b8b51d5eee1929defaebd0313c54ddd6d62241bfa4a7d5421491e12
+ sha256sums = 8790061f5a5b9eed63545a9caa0bb6452bec965313b40857657973f986b01794
+
+pkgname = widevine-armv7h
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..e711887a6147
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,8 @@
+Google LLC and its affiliates ("Google") own all legal right, title and
+interest in and to the content decryption module software ("Software") and
+related documentation, including any intellectual property rights in the
+Software. You may not use, modify, sell, or otherwise distribute the Software
+without a separate license agreement with Google. The Software is not open
+source software.
+
+If you are interested in licensing the Software, please contact www.widevine.com
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2f611a2b447a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,91 @@
+# Maintainer: Bart De Vries <bart at mogwai dot be>
+
+pkgname=widevine-armv7h
+pkgdesc='A browser plugin designed for the viewing of premium video content (version for armv7h)'
+pkgver=4.10.1679.0
+pkgrel=1
+#list od current images https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.conf
+_chromeos_ver=13099.110.0
+_chromeos_file="chromeos_${_chromeos_ver}_jacuzzi_recovery_stable-channel_mp-v3.bin"
+_rootfs_img="ROOT-A.img"
+_libwidevine="libwidevinecdm.so"
+arch=('armv7h')
+url='https://www.widevine.com/'
+license=('custom')
+depends=('gcc-libs' 'glib2' 'glibc' 'nspr' 'nss')
+provides=('chromium-widevine')
+conflicts=('chromium-widevine' 'chromium-widevine-armv7h')
+makedepends=('p7zip')
+install="widevine-armv7h.install"
+options=('!strip')
+source=("chrome-eula_text.html::https://www.google.com/intl/en/chrome/privacy/eula_text.html"
+ "https://dl.google.com/dl/edgedl/chromeos/recovery/${_chromeos_file}.zip"
+ "register_widevine_chromium"
+ "register_widevine_firefox"
+ "widevine-armv7h.install")
+noextract=("${_chromeos_file}.zip")
+sha256sums=(SKIP
+ 'cbec1708dd978b2353481d9ca8e022c287abfe53309d51532df2f17703a5450c'
+ 'ebca260ca197c4eee5a8b76ae1fad2bf800ab99b40d8be0c2189b566bd9621d0'
+ 'b976bb594b8b51d5eee1929defaebd0313c54ddd6d62241bfa4a7d5421491e12'
+ '8790061f5a5b9eed63545a9caa0bb6452bec965313b40857657973f986b01794')
+
+prepare() {
+ # Retrieve the widevinecdm lib file from the chromeos image
+ 7z e ../${_chromeos_file}.zip -y
+ 7z e ${_chromeos_file} ${_rootfs_img} -y
+ 7z e ${_rootfs_img} ${_libwidevine} -r -y
+
+ # Get major and minor version numbers from pkgver string
+ _full_version="$(grep -Eaom1 '([0-9]+\.){3}[0-9]+' ${_libwidevine})"
+ _major_version="$(echo ${_full_version} | cut -d. -f1)"
+ _minor_version="$(echo ${_full_version} | cut -d. -f2)"
+
+ # Construct necessary metadata file(s)
+ echo "{" > manifest.json
+ echo " \"name\": \"WidevineCdm\"," >> manifest.json
+ echo " \"description\": \"Widevine Content Decryption Module\"," >> manifest.json
+ echo " \"version\": \"${_full_version}\"," >> manifest.json
+ echo " \"x-cdm-codecs\": \"vp8,vp9.0,avc1,av01\"," >> manifest.json
+ echo " \"x-cdm-host-versions\": \"${_minor_version}\"," >> manifest.json
+ echo " \"x-cdm-interface-versions\": \"${_minor_version}\"," >> manifest.json
+ echo " \"x-cdm-module-versions\": \"${_major_version}\"," >> manifest.json
+ echo " \"x-cdm-persistent-license-support\": true" >> manifest.json
+ echo "}" >> manifest.json
+
+ # Create firefox preferences file
+ echo "// Set preferences related to widevine loading" > widevine.js
+ echo "pref(\"media.gmp-widevinecdm.version\", \"${_full_version}\");" >> widevine.js
+ echo "pref(\"media.gmp-widevinecdm.visible\", true);" >> widevine.js
+ echo "pref(\"media.gmp-widevinecdm.enabled\", true);" >> widevine.js
+ echo "pref(\"media.gmp-widevinecdm.autoupdate\", false);" >> widevine.js
+ echo "pref(\"media.eme.enabled\", true);" >> widevine.js
+ echo "pref(\"media.eme.encrypted-media-encryption-scheme.enabled\", true);" >> widevine.js
+
+}
+
+pkgver() {
+ echo $(grep -Eaom1 '([0-9]+\.){3}[0-9]+' ${_libwidevine})
+}
+
+package() {
+ # These are general license files
+ install -Dm644 ../chrome-eula_text.html "${pkgdir}/usr/share/licenses/${pkgname}/eula_text.html"
+ install -Dm644 ../LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+
+ # These are the files for the chromium metadata package
+ install -Dm755 ${_libwidevine} -t "${pkgdir}/opt/WidevineCdm/chromium/"
+ install -Dm644 ../LICENSE -t "${pkgdir}/opt/WidevineCdm/chromium/"
+ install -m644 manifest.json -t "${pkgdir}/opt/WidevineCdm/chromium/"
+ install -d "${pkgdir}/opt/WidevineCdm/chromium/_platform_specific/linux_arm"
+ ln -s "../../${_libwidevine}" "${pkgdir}/opt/WidevineCdm/chromium/_platform_specific/linux_arm/${_libwidevine}"
+
+ # These are the files for the firefox metadata package
+ install -d "${pkgdir}/opt/WidevineCdm/firefox"
+ ln -s "../chromium" "${pkgdir}/opt/WidevineCdm/firefox/${pkgver}"
+ install -Dm644 widevine.js -t "${pkgdir}/usr/lib/firefox/browser/defaults/preferences/"
+
+ # Registering scripts
+ install -Dm755 ../register_widevine_firefox -t "${pkgdir}/usr/bin/"
+ install -Dm755 ../register_widevine_chromium -t "${pkgdir}/usr/bin/"
+}
diff --git a/register_widevine_chromium b/register_widevine_chromium
new file mode 100755
index 000000000000..d0f3f66bdaed
--- /dev/null
+++ b/register_widevine_chromium
@@ -0,0 +1,3 @@
+#!/bin/bash
+mkdir -p ${HOME}/.config/chromium/WidevineCdm
+echo '{"Path":"/opt/WidevineCdm/chromium"}' > ${HOME}/.config/chromium/WidevineCdm/latest-component-updated-widevine-cdm
diff --git a/register_widevine_firefox b/register_widevine_firefox
new file mode 100755
index 000000000000..a7fe4092aee1
--- /dev/null
+++ b/register_widevine_firefox
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+if [[ ! -e "${HOME}/.mozilla/firefox" ]]
+then
+ echo "No firefox profiles found for user ${USER}"
+ exit
+fi
+
+cd ${HOME}/.mozilla/firefox/
+if [[ $(grep '\[Profile[^0]\]' profiles.ini) ]]
+ then PROFPATH=$(grep -E '^\[Profile|^Path|^Default' profiles.ini | grep '^Path' | cut -c6-)
+ else PROFPATH=$(grep 'Path=' profiles.ini | sed 's/^Path=//')
+fi
+PROFS=($PROFPATH)
+
+for prof in "${PROFS[@]}"
+do
+ WIDEVINE_PATH="${HOME}/.mozilla/firefox/${prof}/gmp-widevinecdm"
+ if [[ -e "${WIDEVINE_PATH}" ]]
+ then
+ if [[ -L "${WIDEVINE_PATH}" ]]
+ then
+ rm "${WIDEVINE_PATH}"
+ else
+ rm -r "${WIDEVINE_PATH}"
+ fi
+ ln -s /opt/WidevineCdm/firefox "${WIDEVINE_PATH}"
+ echo "Widevine already registered for profile ${prof}; re-registered"
+ else
+ if [[ -L "${WIDEVINE_PATH}" ]]
+ then
+ rm "${WIDEVINE_PATH}"
+ fi
+ ln -s /opt/WidevineCdm/firefox "${HOME}/.mozilla/firefox/${prof}/gmp-widevinecdm"
+ echo "Widevine registered for profile ${prof}"
+ fi
+done
diff --git a/widevine-armv7h.install b/widevine-armv7h.install
new file mode 100644
index 000000000000..ab367bafa797
--- /dev/null
+++ b/widevine-armv7h.install
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+post_install() {
+ echo ":: IMPORTANT: In order to register the widevine component with chromium and/or firefox"
+ echo " run the relevant scripts below for every user that needs widevine enabled."
+ echo " - register_widevine_firefox"
+ echo " - register_widevine_chromium"
+ echo " These scripts will add the needed entries into the user dirs for either"
+ echo " browser. This action has to be performed only once; the registering will"
+ echo " persist after package upgrades."
+}