33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
# INSTALL
|
|
|
|
checksum=274b473c4b4a3bcd0839e777ed466550daceae4352570ca4f342e824506163f8
|
|
_baseUrl="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable"
|
|
_filename="google-chrome-stable_${VERSION%_*}-1_amd64.deb"
|
|
DISTFILE="${_baseUrl}/${_filename}"
|
|
BUILD_DIR="$(mktemp -d ${TMPDIR:-/tmp}/$PKGNAME.XXXXXX)"
|
|
case "$ACTION" in
|
|
post)
|
|
# Actions to execute before the package files are unpacked.
|
|
mkdir -p $BUILD_DIR
|
|
xbps-uhelper fetch "${DISTFILE}>$BUILD_DIR/$PKGNAME.deb"
|
|
# Things that have to happen no matter what
|
|
cd $BUILD_DIR
|
|
if [ "$(xbps-digest "$PKGNAME.deb")" != $checksum ]; then
|
|
echo "broken file: $_filename"
|
|
exit 1
|
|
fi
|
|
ar x $PKGNAME.deb
|
|
tar xf data.tar.xz --wildcards './opt/google/chrome/WidevineCdm/'
|
|
cd -
|
|
# Remove previous components
|
|
rm -fr /usr/lib/chromium/WidevineCdm /usr/lib/chromium/libwidevinecdm.so
|
|
# Move new components
|
|
mv $BUILD_DIR/opt/google/chrome/WidevineCdm /usr/lib/chromium/
|
|
ln -s /usr/lib/chromium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so /usr/lib/chromium/libwidevinecdm.so
|
|
[ ! -d /usr/lib/chromium-dev ] && mkdir /usr/lib/chromium-dev
|
|
ln -s /usr/lib/chromium/WidevineCdm /usr/lib/chromium-dev/WidevineCdm
|
|
# Cleanup
|
|
rm -r $BUILD_DIR
|
|
;;
|
|
esac
|