| 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 with |
| 9 | Rust 1.89 or newer (the workspace `rust-version`): |
| 10 | |
| 11 | ```bash |
| 12 | pkg install -y rust pkgconf git # or: pkg install -y lang/rust devel/pkgconf devel/git |
| 13 | cargo install codewhale-cli --locked # provides `codewhale` |
| 14 | codewhale --version |
| 15 | codewhale doctor |
| 16 | ``` |
| 17 | |
| 18 | Release installers (v0.9.5+) expose only `codewhale` + `codew`. Cargo installs |
| 19 | `codewhale`; users who want the optional short name can add a `codew` symlink. |
| 20 | There is no separate `codewhale-tui` binary to install. If you previously |
| 21 | installed `codewhale-tui` from ports or Cargo, run |
| 22 | `cargo uninstall codewhale-tui`, then rebuild `codewhale-cli`. |
| 23 | |
| 24 | Linux `libdbus-1` / `pkg-config` build deps are not needed on FreeBSD for the default |
| 25 | feature set; the `rquickjs` FreeBSD bindings are generated at build time via `bindgen` |
| 26 | (see the `target_os = "freebsd"` dependency in `crates/workflow-js/Cargo.toml`, added by |
| 27 | `1582ba965`/`5eb0385e8`). |
| 28 | |
| 29 | ## Target validation |
| 30 | |
| 31 | - No CI job builds or checks the Rust tier-2 target `x86_64-unknown-freebsd`, so FreeBSD source builds are not verified before a release. To check one, run `cargo check --target x86_64-unknown-freebsd -p codewhale-cli --locked` on a FreeBSD host. |
| 32 | - `aarch64-unknown-freebsd` cross-check is tracked for future hardware. |
| 33 | - The release matrix in `.github/workflows/release-artifacts.yml` remains 7×1 (Linux musl x64, Linux musl 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. |
| 34 | |
| 35 | ## Future: native pkg / port |
| 36 | |
| 37 | A proper FreeBSD port (`ports-mgmt` / `pkg install codewhale`) is the long-game follow-up to #1097. |
| 38 | Desired shape (not yet submitted): |
| 39 | |
| 40 | ``` |
| 41 | ports/sysutils/codewhale/ |
| 42 | Makefile # USES=cargo, CARGO_CRATES via `cargo make-port` or `cargo-crates` helper |
| 43 | distinfo |
| 44 | pkg-descr |
| 45 | pkg-plist # bin/codewhale, bin/codew |
| 46 | ``` |
| 47 | |
| 48 | The Makefile should `BUILD_DEPENDS` on `lang/rust` and `devel/pkgconf`, run `cargo build --locked --release -p codewhale-cli`, |
| 49 | and install only `codewhale` + `codew`. Tests can reuse `cargo test -p codewhale-cli --lib` if desired. |
| 50 | |
| 51 | If you can test on FreeBSD 14.x (amd64), please run the smoke from `docs/INSTALL.md#7-build-from-source` |
| 52 | and report the `codewhale doctor` JSON in #1097. |
| 53 | |
| 54 | ## Verification |
| 55 | |
| 56 | ```bash |
| 57 | # on a FreeBSD 14.1 amd64 host or VM |
| 58 | rustc --version # >= 1.89 |
| 59 | cargo install --path crates/cli --locked |
| 60 | codewhale --version |
| 61 | codewhale exec --auto "run pwd" |
| 62 | ``` |
| 63 |