Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

Release fixes: CLI --version, ALSA on Linux, web build via xtask

Brandon Thomas3b6ef97010a6
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ec50ab54d..0cfad532a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -171,7 +171,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
- libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev \
+ libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libasound2-dev \
desktop-file-utils appstream python3-yaml
curl -fsSL -o "$RUNNER_TEMP/nfpm.deb" \
"https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_${{ matrix.deb }}.deb"
@@ -209,7 +209,7 @@ jobs:
env:
FILMCRAFT_VERSION: ${{ needs.version.outputs.version }}
FILMCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
- TRUNK_VERSION: 0.21.14
+ WASM_BINDGEN_VERSION: 0.2.129
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
@@ -218,11 +218,12 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: release-web
- - name: Install trunk
+ - name: Install wasm-bindgen CLI
run: |
- curl -fsSL "https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" \
- | tar -xz -C "$HOME/.cargo/bin" trunk
- trunk --version
+ # Must match the wasm-bindgen crate version exactly (WASM_BINDGEN in xtask/src/main.rs).
+ command -v wasm-bindgen >/dev/null && wasm-bindgen --version | grep -q "$WASM_BINDGEN_VERSION" \
+ || cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION" --locked
+ wasm-bindgen --version
- name: Apply version override
if: inputs.version != ''
run: cargo xtask version set "$FILMCRAFT_VERSION"
diff --git a/apps/filmcraft-cli/src/main.rs b/apps/filmcraft-cli/src/main.rs
index 2ab7c24b9..df8b76c5a 100644
--- a/apps/filmcraft-cli/src/main.rs
+++ b/apps/filmcraft-cli/src/main.rs
@@ -30,6 +30,7 @@ SUBCOMMANDS
bench-decode <media> [--frames N]
mcp MCP server on stdio (headless, or --bridge to the live app)
help this text
+ --version print the version
OPTIONS
--project <p.fcproj> open this project first (headless)
@@ -130,10 +131,15 @@ fn format_for(path: &str) -> Option<&'static str> {
#[tokio::main]
async fn main() {
+ if matches!(std::env::args().nth(1).as_deref(), Some("--version" | "-V")) {
+ println!("filmcraft-cli {}", env!("CARGO_PKG_VERSION"));
+ return;
+ }
let a = Args::parse(std::env::args().skip(1));
let Some(cmd) = a.pos(0) else { usage("missing subcommand") };
match cmd {
"help" | "--help" | "-h" => print!("{HELP}"),
+ "version" => println!("filmcraft-cli {}", env!("CARGO_PKG_VERSION")),
"probe" => {
let path = a.pos(1).unwrap_or_else(|| usage("probe <media>"));
let bytes = std::fs::read(path).unwrap_or_else(|e| fail(format!("{path}: {e}")));
diff --git a/packaging/linux/flatpak/ai.storyteller.filmcraft.yml b/packaging/linux/flatpak/ai.storyteller.filmcraft.yml
index 1c54d17db..9c4f8b958 100644
--- a/packaging/linux/flatpak/ai.storyteller.filmcraft.yml
+++ b/packaging/linux/flatpak/ai.storyteller.filmcraft.yml
@@ -19,6 +19,7 @@ finish-args:
- --share=ipc
- --socket=wayland
- --socket=fallback-x11
+ - --socket=pulseaudio
- --device=dri
# Open/Save dialogs use the file-chooser portal (rfd), and drag-and-drop uses the document
# portal, so broad filesystem access isn't needed. Pictures is granted for opening files by
diff --git a/packaging/linux/nfpm.yaml b/packaging/linux/nfpm.yaml
index 9ed31d810..26e7996fc 100644
--- a/packaging/linux/nfpm.yaml
+++ b/packaging/linux/nfpm.yaml
@@ -32,6 +32,7 @@ overrides:
- libgcc-s1
- libxkbcommon0
- libvulkan1 | libegl1
+ - libasound2 | libasound2t64
recommends:
- libwayland-client0
- libx11-6
@@ -45,6 +46,7 @@ overrides:
depends:
- libxkbcommon
- (vulkan-loader or libglvnd-egl)
+ - alsa-lib
recommends:
- libwayland-client
- libX11
diff --git a/packaging/web/package.sh b/packaging/web/package.sh
index fbc927af4..7f7d3c23e 100755
--- a/packaging/web/package.sh
+++ b/packaging/web/package.sh
@@ -3,8 +3,8 @@
#
# Usage: packaging/web/package.sh [--skip-build]
#
-# Needs: trunk (brew install trunk / cargo install trunk --locked) and the wasm32-unknown-unknown
-# target. The zip holds a self-contained static site in filmcraft-web-<version>/ that works
+# Needs: the wasm32-unknown-unknown target and the wasm-bindgen CLI at the crate's exact version
+# (cargo install wasm-bindgen-cli --version <see xtask WASM_BINDGEN> --locked); `cargo xtask web` builds it. The zip holds a self-contained static site in filmcraft-web-<version>/ that works
# from any URL path and inside an <iframe>. Hosting notes: packaging/web/README.md.
set -euo pipefail
# shellcheck source=../env.sh
@@ -12,13 +12,12 @@ set -euo pipefail
HERE="$ROOT/packaging/web"
if [ "${1:-}" != "--skip-build" ]; then
- command -v trunk >/dev/null || { echo "error: trunk not found (cargo install trunk --locked)" >&2; exit 1; }
- (cd "$ROOT/apps/filmcraft-web" && trunk build --release)
+ (cd "$ROOT" && cargo xtask web)
fi
-SITE="$ROOT/dist/web"
+SITE="$CARGO_TARGET_DIR/web/dist"
[ -f "$SITE/index.html" ] || { echo "error: $SITE/index.html missing; run without --skip-build" >&2; exit 1; }
-# Paths must be relative so the site works under any prefix (public_url = "./" in Trunk.toml).
+# Paths must be relative so the site works under any prefix.
if grep -Eq '(src|href)="/[^/]' "$SITE/index.html"; then
echo "error: $SITE/index.html has root-absolute URLs; it would break when served from a sub-path" >&2
exit 1