48 lines
1.7 KiB
Bash
Executable file
48 lines
1.7 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
program_name="fjord-launcher-unlocked"
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
|
|
# prep
|
|
workdir=$(mktemp -d)
|
|
built_dir=${COMPILED_DIR:-/compiled}/$program_name
|
|
mkdir -p $built_dir
|
|
apt update && apt install curl jq -y
|
|
|
|
# check whether it's up-to-date
|
|
version_file=$built_dir/version
|
|
touch $version_file
|
|
# also available via gitlab.com/librewolf-community/browser/source/-/raw/main/{version,release}
|
|
version=$(curl 'https://api.github.com/repos/hero-persson/FjordLauncherUnlocked/releases/latest' | jq '.tag_name' -r)
|
|
if grep -q $version $version_file; then
|
|
echo "already up to date, exiting"
|
|
exit
|
|
fi
|
|
|
|
# install deps
|
|
apt install qt6-base-dev qtchooser qt6-base-dev-tools libqt6core6 libqt6core5compat6-dev libqt6network6 qt6-networkauth-dev cmake ninja-build g++ extra-cmake-modules zlib1g-dev openjdk-17-jdk libgl1-mesa-dev scdoc -y
|
|
|
|
# get source and build
|
|
cd $workdir
|
|
curl -LO $(curl 'https://api.github.com/repos/hero-persson/FjordLauncherUnlocked/releases/latest' | jq '.assets' | jq '.[0].browser_download_url' -r) # .assets.[0].browser_download_url doesn't work on debian's old version of jq
|
|
tar -xzf FjordLauncher-$version.tar.gz
|
|
cd FjordLauncher-$version
|
|
cmake -S . -B build -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
|
-DENABLE_LTO=ON
|
|
# -DLauncher_QT_VERSION_MAJOR="5" # if you want to use Qt 5
|
|
cmake --build build
|
|
|
|
# package into archive
|
|
mkdir -p $workdir/result/
|
|
DESTDIR=$workdir/result/ cmake --install build
|
|
cd $workdir/result/
|
|
#rm -rf librewolf-allow-dark/
|
|
#mv result/ librewolf-allow-dark/
|
|
apt install zstd -y
|
|
tar --zstd -cf $built_dir/$program_name.tar.zst .
|
|
echo $version >$version_file
|
|
|
|
echo "$program_name updated to $version"
|