Skip to content

Commit

Permalink
google-chrome: don't manually extract deb
Browse files Browse the repository at this point in the history
also clean up the template a bit
  • Loading branch information
classabbyamp committed Nov 10, 2022
1 parent dfa4426 commit 85b53da
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions srcpkgs/google-chrome/template
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,34 @@ version=107.0.5304.110
revision=1
_channel=stable
archs="x86_64"
hostmakedepends="tar xz python3 python3-html2text python3-setuptools"
hostmakedepends="python3-html2text python3-setuptools"
depends="gtk+3"
short_desc="Attempt at creating a safer, faster, and more stable browser"
maintainer="Michael Aldridge <maldridge@voidlinux.org>"
license="custom:chrome"
homepage="https://www.google.com/chrome/"
nostrip=yes
restricted=yes
repository=nonfree
skiprdeps="/opt/google/chrome/libqt5_shim.so"

_baseUrl="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable"
_filename="google-chrome-${_channel}_${version}-1_amd64.deb"
_chromeUrl="${_baseUrl}/${_filename}"
_licenseUrl="https://www.google.com/intl/en/chrome/terms/"

distfiles="$_chromeUrl"
distfiles="https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-${_channel}_${version}-1_amd64.deb"
checksum=52e6d1be974c36cb40469f03b128cf21b36359a05fdadbb2e0379fbb17ef341b
_license_checksum=8023b18fb5118ef65d586363e53909861bd1a9676e5eb83c20fd3ac6e33ea0be

do_extract() {
mkdir -p ${DESTDIR}
ar x ${XBPS_SRCDISTDIR}/google-chrome-${version}/${_filename}
skiprdeps="/opt/google/chrome/libqt5_shim.so"
repository=nonfree
restricted=yes
nostrip=yes

post_extract() {
xbps-fetch 'https://www.google.com/intl/en/chrome/terms/' -o google-chrome-eula.html
html2text google-chrome-eula.html | sed -n '/^#/,/^SEE/p' > google-chrome-eula.md
filesum="$(xbps-digest google-chrome-eula.md)"
if [ "$filesum" != "$_license_checksum" ]; then
msg_error "SHA256 mismatch for EULA:\n$filesum\n"
fi
}

do_install() {
tar xf data.tar.xz -C ${DESTDIR}
vcopy etc /
vcopy opt /
vcopy usr /

# Install the icons
for size in 16 24 32 48 64 128 256; do
Expand All @@ -47,10 +49,6 @@ do_install() {
# Remove the Debian/Ubuntu crontab
rm -rf ${DESTDIR}/etc
rm -rf ${DESTDIR}/opt/google/chrome/cron
}

post_install() {
xbps-fetch ${_licenseUrl} -o google-chrome-eula.html
cat google-chrome-eula.html | html2text >> google-chrome-eula.md
vlicense google-chrome-eula.md
}

0 comments on commit 85b53da

Please sign in to comment.