Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
255 lines (227 loc) · 11.7 KB
/
Copy pathJustfile
File metadata and controls
255 lines (227 loc) · 11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# fts-fx: the effects. `just` lists the recipes.
default:
@just --list
# cargo check of every crate and target
check:
cargo check --workspace --all-targets --locked
# Every test (nextest does not run doctests; `cargo test --doc` does)
test:
cargo nextest run --workspace --locked
# What Studio's web builds reach, checked for the browser: the effect
# engines and their painted UI (no plugin shell, no native windowing).
wasm_dsp_features := "align comp comp-profiles comp-ui comp-viz delay delay-profiles delay-ui delay-viz eq eq-analyzer eq-analyzer-ui eq-graph eq-graph-paint eq-profiles eq-ui level modulation modulation-profiles modulation-ui modulation-viz multiband pitch reverb reverb-profiles reverb-ui reverb-viz saturate saturate-analysis saturate-profiles saturate-ui saturate-viz stack stretch tune"
wasm-check:
cargo check --locked -p dsp-core --target wasm32-unknown-unknown --features "audio loudness modulation"
cargo check --locked -p fts-audio-ui --target wasm32-unknown-unknown --features shader
cargo check --locked -p dsp --target wasm32-unknown-unknown --features "{{wasm_dsp_features}}"
# architect-ui is a git dependency with no stable path on disk: link the
# resolved checkout where the FX editors' tailwind.css files import it.
_architect-ui-link:
#!/usr/bin/env bash
set -euo pipefail
ui=$(cargo metadata --locked --format-version 1 2>/dev/null \
| python3 -c 'import json,sys,os; print(next(os.path.dirname(p["manifest_path"]) for p in json.load(sys.stdin)["packages"] if p["name"]=="architect-ui"))')
ln -sfn "$ui" features/ui/.architect-ui
# The FX editors' embedded Tailwind sheets (the editor include_str!s
# assets/tailwind.css). Rebuild after class changes in the editor or in
# architect-ui.
tailwind-eq: _architect-ui-link
tailwindcss -i features/dsp/eq/tailwind.css -o features/dsp/eq/assets/tailwind.css --minify
tailwind-comp: _architect-ui-link
tailwindcss -i features/dsp/comp/tailwind.css -o features/dsp/comp/assets/tailwind.css --minify
tailwind-limiter: _architect-ui-link
tailwindcss -i features/dsp/comp/ui_limiter-tailwind.css -o features/dsp/comp/ui_limiter-assets/tailwind.css --minify
tailwind-trigger: _architect-ui-link
tailwindcss -i features/dsp/trigger/tailwind.css -o features/dsp/trigger/assets/tailwind.css --minify
tailwind-eq-standalone: _architect-ui-link
tailwindcss -i apps/plugins/eq-standalone/tailwind.css -o apps/plugins/eq-standalone/assets/tailwind.css --minify
# THE plugin suite — the one list every plugin recipe iterates. A name here
# is `<name>-plugin` as a cargo package and "FTS <Name>" as a bundle (see
# bundler.toml); adding a plugin means touching this line and that file.
fts_plugins := "eq comp reverb delay tune modulation level saturate gate limiter trigger meter pitch unison"
# Bundle every FTS plugin as .clap + .vst3 (target/bundled/, names from
# bundler.toml). Pass a subset to bundle only those:
# just plugins-bundle "eq comp"
# Debug of a single plugin: cargo run -p fts-plugin-xtask -- bundle -p eq-plugin
#
# On macOS this uses nice-plug-xtask's `bundle-universal` instead of
# `bundle`: it builds both aarch64-apple-darwin and x86_64-apple-darwin and
# lipo's them into one universal .clap/.vst3 per plugin — no custom lipo
# scripting needed. Requires the x86_64-apple-darwin rustc target
# (`rustup target add x86_64-apple-darwin`).
plugins-bundle plugins=fts_plugins:
#!/usr/bin/env bash
set -euo pipefail
cmd=bundle
[ "$(uname)" = "Darwin" ] && cmd=bundle-universal
for p in {{plugins}}; do
# `export` (the CLAP/VST3 entry points) is a feature of each plugin.
feat=(); grep -q '^export *=' "apps/plugins/$p/Cargo.toml" && feat=(--features export)
cargo run -q -p fts-plugin-xtask -- "$cmd" -p "$p-plugin" --release "${feat[@]}"
done
ls target/bundled/
# Symlink the built bundles into this machine's user plugin dirs, so a rebuild
# is live in REAPER (and anything else that scans them) without reinstalling.
#
# Points at `target/bundled` rather than copying it. The bundler rewrites each bundle in place at a stable path, so the link stays
# valid across rebuilds — `just plugins-bundle eq` and the next plugin scan
# sees the new binary.
#
# just plugins-link # every bundle currently in target/bundled
# just plugins-bundle eq && ... # rebuild one; the link already points at it
#
# Idempotent, and deliberately conservative: it replaces its own symlinks but
# refuses to delete a REAL directory of the same name, which would be a copy
# installed by hand or by a release. Remove those yourself first —
# a plugin folder is not somewhere to be clever with rm -rf.
plugins-link:
#!/usr/bin/env bash
set -euo pipefail
src="$(pwd)/target/bundled"
[ -d "$src" ] || { echo "no target/bundled — run 'just plugins-bundle' first" >&2; exit 1; }
case "$(uname)" in
Darwin) clap_dir="$HOME/Library/Audio/Plug-Ins/CLAP"; vst3_dir="$HOME/Library/Audio/Plug-Ins/VST3";;
*) clap_dir="$HOME/.clap"; vst3_dir="$HOME/.vst3";;
esac
mkdir -p "$clap_dir" "$vst3_dir"
linked=0; skipped=0
for bundle in "$src"/*.clap "$src"/*.vst3; do
[ -e "$bundle" ] || continue
name="$(basename "$bundle")"
case "$name" in *.clap) dest_dir="$clap_dir";; *) dest_dir="$vst3_dir";; esac
dest="$dest_dir/$name"
if [ -e "$dest" ] && [ ! -L "$dest" ]; then
printf " SKIP %-22s (a real copy is installed at %s)\n" "$name" "$dest_dir"
skipped=$((skipped+1))
continue
fi
rm -f "$dest"
ln -s "$bundle" "$dest"
printf " link %-22s -> %s\n" "$name" "$dest_dir"
linked=$((linked+1))
done
echo "linked $linked bundle(s), skipped $skipped"
# Remove the symlinks `plugins-link` made, leaving any real installs alone.
plugins-unlink:
#!/usr/bin/env bash
set -euo pipefail
src="$(pwd)/target/bundled"
case "$(uname)" in
Darwin) dirs=("$HOME/Library/Audio/Plug-Ins/CLAP" "$HOME/Library/Audio/Plug-Ins/VST3");;
*) dirs=("$HOME/.clap" "$HOME/.vst3");;
esac
for dir in "${dirs[@]}"; do
[ -d "$dir" ] || continue
for link in "$dir"/*.clap "$dir"/*.vst3; do
[ -L "$link" ] || continue
target="$(readlink "$link")"
case "$target" in "$src"/*) rm -f "$link"; echo " unlink $(basename "$link")";; esac
done
done
# Prove every bundle in target/bundled actually LOADS — dlopen it, run its
# entry point, and walk its factory (apps/plugins/verify/). A plugin that
# compiles, links, and exports the right symbol can still fail in a host: a
# missing dependency or a panicking init only shows up at load time, and
# `nm` cannot see either.
#
# Works on both platforms, including their different bundle shapes (Linux
# .clap is a bare shared object, macOS .clap is a directory) and different
# VST3 entry-point names (ModuleEntry vs bundleEntry). On macOS, pass an
# arch to run the universal binaries in one personality:
# just plugins-verify # native
# just plugins-verify x86_64 # the Intel half, under Rosetta
plugins-verify arch="":
#!/usr/bin/env bash
set -euo pipefail
[ -d target/bundled ] || { echo "no target/bundled — run 'just plugins-bundle' first" >&2; exit 1; }
out="target/plugin-verify"; mkdir -p "$out"
archflag=""
[ -n "{{arch}}" ] && archflag="-arch {{arch}}"
cc $archflag -o "$out/clap_load" apps/plugins/verify/clap_load.c -ldl
cc $archflag -o "$out/vst3_load" apps/plugins/verify/vst3_load.c -ldl
# The loadable binary inside a bundle, whatever shape the bundle is.
binary_in() {
if [ -d "$1" ]; then find "$1/Contents" -type f -perm -u+x ! -name "*.txt" ! -name "PkgInfo" | head -1
else echo "$1"; fi
}
fail=0
for b in target/bundled/*.clap target/bundled/*.vst3; do
[ -e "$b" ] || continue
case "$b" in *.clap) loader="$out/clap_load";; *) loader="$out/vst3_load";; esac
bin="$(binary_in "$b")"
if [ -z "$bin" ]; then printf "%-24s FAIL no binary in bundle\n" "$(basename "$b")"; fail=1; continue; fi
result="$("$loader" "$bin" 2>&1 | tail -1)"
printf "%-24s %s\n" "$(basename "$b")" "$result"
case "$result" in OK*) ;; *) fail=1;; esac
done
[ "$fail" = 0 ] || { echo "FAILURES — some bundles do not load" >&2; exit 1; }
echo "all bundles load"
# The models are the private FastTrackStudios/mic-models repository, read from
# $FTS_MIC_MODELS, else ~/.local/share/fts/mic-models. The default mic (LD-47K)
# is built into the plugin, so this is only needed for the other thirty-nine.
# Install or update the FTS Mic models for the plugin
mic-models-install:
#!/usr/bin/env bash
set -euo pipefail
dest="${FTS_MIC_MODELS:-${XDG_DATA_HOME:-$HOME/.local/share}/fts/mic-models}"
if [ -d "$dest/.git" ]; then
git -C "$dest" pull --ff-only
elif [ -e "$dest" ]; then
echo "$dest exists and is not a mic-models checkout; leaving it alone" >&2
exit 1
else
mkdir -p "$(dirname "$dest")"
git clone git@github.com:FastTrackStudios/mic-models.git "$dest"
fi
# Install the built plugins for the current user, replacing older copies
# (scripts/install.sh): macOS ~/Library/Audio/Plug-Ins/{CLAP,VST3}, Linux
# ~/.clap and ~/.vst3. Copies, unlike plugins-link; run `just plugins-bundle`
# first. Pass a subset as for plugins-bundle, or flags to install.sh:
# just install # the suite
# just install "eq comp"
# just install "eq comp" --dry-run
install plugins=fts_plugins *flags:
#!/usr/bin/env bash
set -euo pipefail
names=(); while IFS= read -r n; do names+=("$n"); done < <(bash scripts/bundles.sh {{plugins}})
bash scripts/install.sh --from target/bundled {{flags}} "${names[@]}"
# The macOS installer: dist/FTS-Plugins-<version>-macos.pkg, the suite's
# universal bundles Developer-ID-signed, the pkg signed with the Developer
# ID Installer identity (scripts/macos/pkg.sh). Not notarized unless
# NOTARIZE=1. Local structure test without the identities: PKG_UNSIGNED=1.
plugins-pkg: plugins-bundle
bash scripts/macos/pkg.sh {{fts_plugins}}
# The Linux / Windows release archive: dist/fts-plugins-<version>-<platform>
# .tar.gz or .zip with the suite's bundles and install.sh / install.ps1
# (scripts/package.sh), plus its dist/SHA256SUMS line.
plugins-package: plugins-bundle
bash scripts/package.sh {{fts_plugins}}
# ── Releases (scripts/release.sh; the fleet release flow, as patchbay's) ──
# A release PR bumps the CalVer version and writes CHANGELOG.md from
# .changes/; the tag on its merge commit starts release.yml, which builds
# the installers and publishes the GitHub Release with them.
# What a release would ship now: the next version, the draft notes. Reads only.
release-plan *REF:
bash scripts/release.sh plan {{REF}}
# Cut `release/pending` from origin/main: version + CHANGELOG.md section from
# .changes/ (deleting them), one commit `chore(release): v<next>`.
release-prepare *ARGS:
bash scripts/release.sh prepare {{ARGS}}
# On release/pending: push it and open its PR.
release-pr:
bash scripts/release.sh pr
# Re-run the release guard against the current base, then squash-merge the
# release PR.
release-merge:
bash scripts/release.sh merge
# After the release PR merged: tag v<version> on its merge commit. THE TAG
# SHIPS (release.yml). Push as a person or the fts-forge App, not a workflow
# token (that starts no workflow).
release-tag *ARGS:
bash scripts/release.sh tag {{ARGS}}
# Hotfix while main can't ship (see scripts/release.sh).
release-hotfix +COMMITS:
bash scripts/release.sh hotfix {{COMMITS}}
# One version's section of CHANGELOG.md (default: the current version).
release-notes *ARGS:
@bash scripts/release.sh notes {{ARGS}}