initial commit

This commit is contained in:
askiiart 2025-02-25 12:56:51 -06:00
commit b23d395ffd
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
2 changed files with 57 additions and 0 deletions

19
README.md Normal file
View file

@ -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 |

38
compilation.sh Executable file
View file

@ -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"