2023-11-06 15:03:40 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-11-07 18:07:32 +00:00
|
|
|
export FS_DIR_CACHE_ROOT="/data/.cache/fs-dir-cache" # directory to hold all cache (sub)directories
|
2023-11-07 17:41:48 +00:00
|
|
|
export FS_DIR_CACHE_LOCK_ID="pid-$$-rnd-$RANDOM" # acquire lock based on the current pid and something random (just in case pid gets reused)
|
|
|
|
export FS_DIR_CACHE_KEY_NAME="build-project-x" # the base name of our key
|
|
|
|
export FS_DIR_CACHE_LOCK_TIMEOUT_SECS="3600" # unlock after timeout (1h) in case our job fails misereably
|
2024-04-03 13:51:47 +00:00
|
|
|
export RUST_BACKTRACE=1
|
2023-11-08 10:49:05 +00:00
|
|
|
#cargo install fs-dir-cache
|
2023-11-07 17:16:11 +00:00
|
|
|
|
2023-11-06 15:03:40 +00:00
|
|
|
mkdir -p app
|
|
|
|
|
|
|
|
for i in $(seq 0 $(expr $(jq '. | length' < apps.json) - 1)); do
|
|
|
|
jq ".[$i]" < apps.json > app/data.json
|
|
|
|
cd app
|
|
|
|
#rm -rf *
|
|
|
|
mkdir -p src
|
|
|
|
for t in ../template/src/*; do
|
|
|
|
$HOME/bin/gotempl --data-json data.json< $t > src/$(basename $t)
|
|
|
|
done
|
|
|
|
cp -r ../template/src-tauri .
|
|
|
|
$HOME/bin/gotempl --data-json data.json< ../template/src-tauri/Cargo.toml > src-tauri/Cargo.toml
|
|
|
|
$HOME/bin/gotempl --data-json data.json< ../template/src-tauri/tauri.conf.json > src-tauri/tauri.conf.json
|
2023-11-07 17:41:48 +00:00
|
|
|
cd src-tauri/icons
|
|
|
|
wget $(jq -r .icon < ../../data.json) -O icon.svg
|
|
|
|
inkscape icon.svg --export-filename=icon.png --export-width=1024
|
|
|
|
convert -background none icon.png -gravity center -extent 1024x1024 icon-square.png
|
|
|
|
cd ..
|
2023-11-07 18:46:46 +00:00
|
|
|
#this is completely unusable with tauri at the moment
|
|
|
|
#fs-dir-cache gc unused --seconds "$((7 * 24 * 60 * 60))" # delete caches not used in more than a week
|
|
|
|
#cache_dir=$(fs-dir-cache lock --key-file Cargo.toml)
|
|
|
|
#trap "fs-dir-cache unlock --dir ${cache_dir}" EXIT
|
2023-11-08 10:49:05 +00:00
|
|
|
echo "==================="
|
|
|
|
echo "Building linux"
|
|
|
|
echo "> cargo tauri build"
|
|
|
|
echo "==================="
|
|
|
|
cargo tauri build
|
|
|
|
echo "==================================================="
|
|
|
|
echo "Building windows"
|
|
|
|
echo "> cargo tauri build --target x86_64-pc-windows-msvc"
|
|
|
|
echo "==================================================="
|
2024-04-03 13:30:53 +00:00
|
|
|
#note: only works on debianish
|
|
|
|
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
|
2023-11-07 18:46:46 +00:00
|
|
|
cargo tauri build --target x86_64-pc-windows-msvc
|
2023-11-08 10:49:05 +00:00
|
|
|
echo "================================================"
|
|
|
|
echo "Building apple"
|
|
|
|
echo "> cargo tauri build --target x86_64-apple-darwin"
|
|
|
|
echo "================================================"
|
2023-11-07 18:46:46 +00:00
|
|
|
cargo tauri build --target x86_64-apple-darwin
|
2023-11-06 15:03:40 +00:00
|
|
|
cd ..
|
|
|
|
cd ..
|
|
|
|
done
|