commit b23d395ffd9b960922eac088f684f922008b6f61 Author: askiiart <dev@askiiart.net> Date: Tue Feb 25 12:56:51 2025 -0600 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..29a2640 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Polycat build + +- Builds polycat and places it in `$COMPILED_DIR/polycat/polycat.tar.zst` +- Version file at `$COMPILED_DIR/polycat/version` + +## Archive details + +``` +. +├── polycat +└── polycat.ttf +``` + +Recommended: + +| File | Location | Permissions | +| --------------- | -------------------------------------- | ----------- | +| `./polycat` | `/usr/bin/polycat` | 755 | +| `./polycat.ttf` | `/usr/share/fonts/polycat/polycat.ttf` | 644 | diff --git a/compilation.sh b/compilation.sh new file mode 100755 index 0000000..f5cc296 --- /dev/null +++ b/compilation.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -euo pipefail + +# prep +dnf install git cmake g++ -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 --recursive https://github.com/2IMT/polycat.git --depth 1 --shallow-submodules +cd ./polycat/ +# check version +version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)") +if grep -q $version $version_file; then + echo "already up to date, exiting" + exit +fi + +# compilation +cd $workdir/polycat/ +cmake -DCMAKE_BUILD_TYPE=RELEASE . +cmake --build . + +# build .tar.zst archive +cd $workdir +mkdir ./polycat-built +mv ./polycat/polycat ./polycat-built/ +mv ./polycat/res/polycat.ttf ./polycat-built/ +mkdir -p ${COMPILED_DIR:-/compiled}/polycat/ +cd $workdir/polycat-built/ +tar --zstd -cf $built_dir/polycat.tar.zst . +echo $version >$version_file + +echo "polycat updated to $version"