-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add update-template.fish script
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Template file for 'brave-bin' | ||
pkgname=brave-bin | ||
version=${VERSION} | ||
revision=1 | ||
only_for_archs="x86_64" | ||
short_desc="Secure, fast and private web browser with ad blocker" | ||
maintainer="Soanvig <[email protected]>" | ||
hostmakedepends="tar xz" # need gtk+3! | ||
license="Mozilla Public License Version 2.0" | ||
homepage="https://brave.com" | ||
distfiles="https://github.com/brave/brave-browser/releases/download/v${version}/brave-browser_${version}_amd64.deb" | ||
checksum=${CHECKSUM} | ||
nostrip=yes | ||
|
||
do_extract() { | ||
mkdir -p ${DESTDIR} | ||
ar x ${XBPS_SRCDISTDIR}/${pkgname}-${version}/brave-browser_${version}_amd64.deb | ||
} | ||
|
||
do_install() { | ||
tar xf data.tar.xz -C ${DESTDIR} | ||
|
||
# Install the icons | ||
for size in 24 32 48 64 128 256; do | ||
# Create the brave browser xdg directory | ||
mkdir -p ${DESTDIR}/usr/share/icons/hicolor/${size}x${size}/apps | ||
|
||
# Copy the brave browser icon | ||
mv ${DESTDIR}/opt/brave.com/brave/product_logo_${size}.png ${DESTDIR}/usr/share/icons/hicolor/${size}x${size}/apps/brave-browser.png | ||
done | ||
|
||
# Remove unused icons | ||
rm ${DESTDIR}/opt/brave.com/brave/*.xpm | ||
|
||
# Remove the Debian/Ubuntu crontab | ||
rm -rf ${DESTDIR}/etc | ||
rm -rf ${DESTDIR}/opt/brave.com/brave/cron | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/fish | ||
|
||
echo "Checking latest version" | ||
|
||
set LATEST_VERSION (gh api repos/brave/brave-browser/releases/latest | jq -r .tag_name | cut -c2-) | ||
|
||
echo "Latest version is: $LATEST_VERSION" | ||
|
||
set -x VERSION $LATEST_VERSION | ||
set -x DOWNLOAD_URL https://github.com/brave/brave-browser/releases/download/v{$VERSION}/brave-browser_{$VERSION}_amd64.deb | ||
|
||
echo "Downloading Brave to get checksum" | ||
|
||
http --print "" --download $DOWNLOAD_URL > /tmp/brave-bin.deb | ||
|
||
set -x CHECKSUM (sha256sum /tmp/brave-bin.deb | awk '{ print $1 }') | ||
|
||
echo "Checksum computed" | ||
|
||
envsubst '${VERSION} ${CHECKSUM}' < ./template.template > template | ||
|
||
echo "Template updated" |