From 42f49fe1af2b7d02ca248e74f928d3ecb2469a8c Mon Sep 17 00:00:00 2001 From: askiiart Date: Mon, 26 May 2025 18:14:48 -0500 Subject: [PATCH] * use actual releases * update for 2.0 * add note for why it's built with fedora instead of debian --- README.md | 13 +++++++++---- compilation.sh | 28 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 29a2640..fdc92b1 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,12 @@ Recommended: -| File | Location | Permissions | -| --------------- | -------------------------------------- | ----------- | -| `./polycat` | `/usr/bin/polycat` | 755 | -| `./polycat.ttf` | `/usr/share/fonts/polycat/polycat.ttf` | 644 | +| File | Location | Permissions | +| ------------------ | ----------------------------------------- | ----------- | +| `./polycat` | `/usr/bin/polycat` | 755 | +| `./polycat.ttf` | `/usr/share/fonts/polycat/polycat.ttf` | 644 | +| `./polycat-config` | `/usr/local/share/polycat/polycat-config` | 644 | + +--- + +Note: Builds with Fedora because Debian's gcc is out of date. diff --git a/compilation.sh b/compilation.sh index 26fabcf..4461913 100755 --- a/compilation.sh +++ b/compilation.sh @@ -2,39 +2,39 @@ set -euo pipefail # prep -dnf install git -y +dnf install jq -y workdir=$(mktemp -d) built_dir=${COMPILED_DIR:-/compiled}/polycat mkdir -p $built_dir version_file=$built_dir/version touch $version_file -# clone and check whether it's up-to-date -cd $workdir -git clone https://github.com/2IMT/polycat.git -cd ./polycat/ +# check whether it's up-to-date # check version -version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)") +version=$(curl 'https://api.github.com/repos/2IMT/polycat/releases/latest' | jq '.tag_name' -r | tr -d 'v') if grep -q $version $version_file; then echo "already up to date, exiting" exit fi -# get build deps -dnf install cmake g++ -y -# get submodules -git submodule update --init --depth 1 +# get build deps +dnf install make g++ -y +# get source +cd $workdir +curl -LO $(curl 'https://api.github.com/repos/2IMT/polycat/releases/latest' | jq '.assets' | jq '.[0].browser_download_url' -r) +tar -xzf polycat-$version.tar.gz +mv ./polycat-$version ./polycat # compilation -cd $workdir/polycat/ -cmake -DCMAKE_BUILD_TYPE=RELEASE . -cmake --build . +cd $workdir/polycat +make # build .tar.zst archive cd $workdir mkdir ./polycat-built -mv ./polycat/polycat ./polycat-built/ +mv ./polycat/build/polycat ./polycat-built/ mv ./polycat/res/polycat.ttf ./polycat-built/ +mv ./polycat/res/polycat-config ./polycat-built/ mkdir -p ${COMPILED_DIR:-/compiled}/polycat/ cd $workdir/polycat-built/ tar --zstd -cf $built_dir/polycat.tar.zst .