| 1 | # FreeBSD packaging for CodeWhale |
| 2 | |
| 3 | Resolves #1097 — FreeBSD install via `cargo` today, native `pkg` port planned. |
| 4 | |
| 5 | ## Current: cargo install (supported) |
| 6 | |
| 7 | FreeBSD has no prebuilt GitHub Release asset. The npm wrapper intentionally fails with |
| 8 | `Unsupported platform: freebsd` and points to the Cargo path. Build from source: |
| 9 | |
| 10 | ```bash |
| 11 | pkg install -y rust pkgconf git # or: pkg install -y lang/rust devel/pkgconf devel/git |
| 12 | cargo install codewhale-cli --locked # provides `codewhale` |
| 13 | codewhale --version |
| 14 | codewhale doctor |
| 15 | ``` |
| 16 | |
| 17 | Release installers (v0.9.5+) expose only `codewhale` + `codew`. Cargo installs |
| 18 | `codewhale`; users who want the optional short name can add a `codew` symlink. |
| 19 | There is no separate `codewhale-tui` binary to install. If you previously |
| 20 | installed `codewhale-tui` from ports or Cargo, run |
| 21 | `cargo uninstall codewhale-tui`, then rebuild `codewhale-cli`. |
| 22 | |
| 23 | Linux `libdbus-1` / `pkg-config` build deps are not needed on FreeBSD for the default |
| 24 | feature set; the `rquickjs` FreeBSD bindings are generated at build time via `bindgen` |
| 25 | (see `crates/tui/build.rs` and the `1582ba965`/`5eb0385e8` FreeBSD bindgen fix). |
| 26 | |
| 27 | ## Target validation |
| 28 | |
| 29 | - Rust tier-2 target `x86_64-unknown-freebsd` is validated in CI via `cargo check --target x86_64-unknown-freebsd -p codewhale-cli --locked` on the `release/0.9.5` branch. |
| 30 | - `aarch64-unknown-freebsd` cross-check is tracked for future hardware. |
| 31 | - The release matrix in `.github/workflows/release-artifacts.yml` remains 7×1 (Linux musl x64, Linux gnu arm64, Android arm64, macOS x64/arm64, Windows x64/arm64). FreeBSD is a source-build target — no prebuilt asset, no matrix bloat, but the row in `docs/INSTALL.md` is authoritative. |
| 32 | |
| 33 | ## Future: native pkg / port |
| 34 | |
| 35 | A proper FreeBSD port (`ports-mgmt` / `pkg install codewhale`) is the long-game follow-up to #1097. |
| 36 | Desired shape (not yet submitted): |
| 37 | |
| 38 | ``` |
| 39 | ports/sysutils/codewhale/ |
| 40 | Makefile # USES=cargo, CARGO_CRATES via `cargo make-port` or `cargo-crates` helper |
| 41 | distinfo |
| 42 | pkg-descr |
| 43 | pkg-plist # bin/codewhale, bin/codew |
| 44 | ``` |
| 45 | |
| 46 | The Makefile should `BUILD_DEPENDS` on `lang/rust` and `devel/pkgconf`, run `cargo build --locked --release -p codewhale-cli`, |
| 47 | and install only `codewhale` + `codew`. Tests can reuse `cargo test -p codewhale-cli --lib` if desired. |
| 48 | |
| 49 | If you can test on FreeBSD 14.x (amd64), please run the smoke from `docs/INSTALL.md#7-build-from-source` |
| 50 | and report the `codewhale doctor` JSON in #1097. |
| 51 | |
| 52 | ## Verification |
| 53 | |
| 54 | ```bash |
| 55 | # on a FreeBSD 14.1 amd64 host or VM |
| 56 | rustc --version # >= 1.88 |
| 57 | cargo install --path crates/cli --locked |
| 58 | codewhale --version |
| 59 | codewhale exec --auto "run pwd" |
| 60 | ``` |
| 61 |