Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ build-cli: build-ffi
build-cli-release: build-ffi-release
cd cli && zig build -Doptimize=ReleaseSafe

# Build the gossamer-launcher (wasmtime host) + cli.wasm. Replaces the
# legacy Zig CLI once Phase 14b body-port (#42) lands. The launcher build
# invokes ephapax to compile cli/src/Main.eph → cli.wasm in the same
# `zig build` step, so EPHAPAX must point at a working compiler.
build-launcher: build-ffi
cd cli/launcher && EPHAPAX="{{ephapax}}" zig build

# Release-mode launcher + cli.wasm (used by packaging recipes).
build-launcher-release: build-ffi-release
cd cli/launcher && EPHAPAX="{{ephapax}}" zig build -Doptimize=ReleaseSafe

# Build everything (FFI + CLI + check)
build: build-ffi build-cli check

Expand Down Expand Up @@ -250,11 +261,17 @@ clean:
# Development
# ═══════════════════════════════════════════════════════════════

# Install the gossamer CLI to ~/.local/bin
install: build-cli
mkdir -p ~/.local/bin
cp cli/zig-out/bin/gossamer ~/.local/bin/gossamer
@echo " ✓ Installed gossamer to ~/.local/bin/gossamer"
# Install the gossamer CLI to ~/.local/bin (launcher + cli.wasm)
#
# Lays the artefacts out so the launcher's install-prefix-relative
# discovery (<exe_dir>/../share/gossamer/cli.wasm) finds the wasm at
# runtime — see cli/launcher/src/main.zig:266.
install: build-launcher
mkdir -p ~/.local/bin ~/.local/share/gossamer
cp cli/launcher/zig-out/bin/gossamer-launcher ~/.local/bin/gossamer
cp cli/launcher/zig-out/share/gossamer/cli.wasm ~/.local/share/gossamer/cli.wasm
@echo " ✓ Installed gossamer (launcher) to ~/.local/bin/gossamer"
@echo " ✓ Installed cli.wasm to ~/.local/share/gossamer/cli.wasm"

# Show exported FFI symbols
symbols:
Expand Down Expand Up @@ -411,11 +428,11 @@ tour:
# ═══════════════════════════════════════════════════════════════

# Build .deb package for Debian/Ubuntu
package-deb: build-ffi-release build-cli-release
package-deb: build-ffi-release build-launcher-release
dpkg-buildpackage -b --no-sign --build-dir=packaging/debian

# Build .rpm package for Fedora/RHEL
package-rpm: build-ffi-release build-cli-release
package-rpm: build-ffi-release build-launcher-release
rpmbuild -bb packaging/rpm/gossamer.spec

# Build Flatpak bundle
Expand Down
3 changes: 2 additions & 1 deletion packaging/debian/gossamer.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# Format: <source path> <destination directory (relative to package root)>

src/interface/ffi/zig-out/lib/libgossamer.so usr/lib/
cli/zig-out/bin/gossamer usr/bin/
cli/launcher/zig-out/bin/gossamer-launcher usr/bin/
cli/launcher/zig-out/share/gossamer/cli.wasm usr/share/gossamer/
generated/abi/gossamer.h usr/include/gossamer/
12 changes: 9 additions & 3 deletions packaging/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# the default dh_auto_build heuristic (which does not know about Zig).
override_dh_auto_build:
just build-ffi-release
just build-cli-release
just build-launcher-release

# Override the install step to place files into the package staging tree.
# dh_auto_install would look for a Makefile install target; we do it manually.
Expand All @@ -22,10 +22,16 @@ override_dh_auto_install:
install -Dm755 src/interface/ffi/zig-out/lib/libgossamer.so \
debian/gossamer/usr/lib/libgossamer.so

# CLI binary — goes to /usr/bin/
install -Dm755 cli/zig-out/bin/gossamer \
# CLI launcher (wasmtime host) — installed as `gossamer` so existing
# UX is preserved. Renames gossamer-launcher → gossamer.
install -Dm755 cli/launcher/zig-out/bin/gossamer-launcher \
debian/gossamer/usr/bin/gossamer

# Precompiled cli.wasm — discovered by the launcher at
# <exe_dir>/../share/gossamer/cli.wasm at runtime.
install -Dm644 cli/launcher/zig-out/share/gossamer/cli.wasm \
debian/gossamer/usr/share/gossamer/cli.wasm

# Public C header — goes to /usr/include/gossamer/
install -Dm644 generated/abi/gossamer.h \
debian/gossamer/usr/include/gossamer/gossamer.h
Expand Down
22 changes: 18 additions & 4 deletions packaging/rpm/gossamer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ BuildRequires: webkit2gtk4-devel >= 2.40
BuildRequires: gtk3-devel >= 3.22
BuildRequires: just
BuildRequires: pkg-config
# wasmtime C API >= v44.0.1 — packaged out-of-tree for now; install
# from https://github.com/bytecodealliance/wasmtime/releases under
# /usr/local before building (see cli/launcher/build.zig).
# ephapax — compiles cli/src/Main.eph → cli.wasm during the launcher
# build. Set EPHAPAX=/path/to/ephapax if not on PATH.

Requires: webkit2gtk4 >= 2.40
Requires: gtk3 >= 3.22
# wasmtime is dlopened by the launcher binary; same out-of-tree note
# applies — /usr/local/lib/libwasmtime.so must be present at runtime.

%description
Gossamer is a webview shell framework that uses linear types to guarantee
Expand Down Expand Up @@ -55,8 +62,8 @@ building applications that embed the Gossamer webview shell framework.
# Build the Zig FFI shared library in release mode.
just build-ffi-release

# Build the Gossamer CLI in release mode.
just build-cli-release
# Build the wasmtime-host launcher + cli.wasm in release mode.
just build-launcher-release

%install
# Clear any stale install root.
Expand All @@ -70,10 +77,16 @@ install -Dm755 src/interface/ffi/zig-out/lib/libgossamer.so \
install -Dm644 src/interface/ffi/zig-out/lib/libgossamer.a \
%{buildroot}%{_libdir}/libgossamer.a

# Install the CLI binary.
install -Dm755 cli/zig-out/bin/gossamer \
# Install the launcher binary as `gossamer` (preserving the existing
# UX). The launcher discovers cli.wasm via the install-prefix-relative
# path <exe_dir>/../share/gossamer/cli.wasm at runtime.
install -Dm755 cli/launcher/zig-out/bin/gossamer-launcher \
%{buildroot}%{_bindir}/gossamer

# Install the precompiled cli.wasm into the share/gossamer prefix.
install -Dm644 cli/launcher/zig-out/share/gossamer/cli.wasm \
%{buildroot}%{_datadir}/gossamer/cli.wasm

# Install the public C header.
install -Dm644 generated/abi/gossamer.h \
%{buildroot}%{_includedir}/gossamer/gossamer.h
Expand All @@ -83,6 +96,7 @@ install -Dm644 generated/abi/gossamer.h \
%doc README.adoc
%{_libdir}/libgossamer.so
%{_bindir}/gossamer
%{_datadir}/gossamer/cli.wasm

%files devel
%{_libdir}/libgossamer.a
Expand Down
Loading