From 9fc2e9d446ffe21e23b1927398ca8281ae899703 Mon Sep 17 00:00:00 2001 From: Tim Van Wassenhove Date: Sat, 22 Nov 2025 14:00:38 +0100 Subject: [PATCH 1/2] feat: install bose from prebuilt archive --- Formula/bose.rb | 10 +++--- docs/bottling-bose.md | 75 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 docs/bottling-bose.md diff --git a/Formula/bose.rb b/Formula/bose.rb index 4f1320e..2d95496 100644 --- a/Formula/bose.rb +++ b/Formula/bose.rb @@ -1,14 +1,14 @@ class Bose < Formula desc "CLI to control Bose SoundTouch speakers" homepage "https://github.com/timvw/bose" - url "https://github.com/timvw/bose/archive/refs/tags/v0.2.0.tar.gz" - sha256 "b23bc1cd037a662a4cc4503ab920ede2ede0090337c3395a9a8504f9157b9a1a" + url "https://github.com/timvw/bose/releases/download/v0.2.0/bose-0.2.0-macos-universal.tar.gz" + sha256 "d0616decd3aca56e0b8642d6b26fd955288c6c86f70d5847fcaac59f25f6c3f4" license "Apache-2.0" - depends_on "rust" => :build - def install - system "cargo", "install", *std_cargo_args + bin.install "bose-universal-macos" => "bose" + doc.install "README.md" + (share/"licenses"/name).install "LICENSE" end test do diff --git a/docs/bottling-bose.md b/docs/bottling-bose.md new file mode 100644 index 0000000..5b7f0d6 --- /dev/null +++ b/docs/bottling-bose.md @@ -0,0 +1,75 @@ +# Bose Formula Bottling + +These are the steps I followed to produce the universal (arm64 + x86_64) binary +for `bose` v0.2.0 and update the Homebrew formula to use it. Future releases +can reuse the same flow. + +## 1. Build release binaries + +```bash +cd ~/src/github/bose +rustup target add x86_64-apple-darwin # one-time setup +cargo build --release # arm64 build on Apple Silicon +cargo build --release --target x86_64-apple-darwin +``` + +## 2. Create a universal binary + +```bash +mkdir -p dist +install -m 755 target/release/bose dist/bose-aarch64-apple-darwin +install -m 755 target/x86_64-apple-darwin/release/bose dist/bose-x86_64-apple-darwin +strip -S -x dist/bose-aarch64-apple-darwin dist/bose-x86_64-apple-darwin +lipo -create -output dist/bose-universal-macos \ + dist/bose-aarch64-apple-darwin dist/bose-x86_64-apple-darwin +strip -S -x dist/bose-universal-macos +cp LICENSE dist/ +cat > dist/README.md <<'EOF' +# Bose CLI Binary + +This archive contains the prebuilt `bose` CLI for macOS (universal arm64/x86_64). +EOF +``` + +## 3. Package and upload + +```bash +VERSION=0.2.0 +ARCHIVE="dist/bose-${VERSION}-macos-universal.tar.gz" +tar -czf "$ARCHIVE" -C dist bose-universal-macos README.md LICENSE +shasum -a 256 "$ARCHIVE" +gh release upload "v${VERSION}" "$ARCHIVE" --clobber +``` + +## 4. Update the formula + +In `homebrew-tap/Formula/bose.rb`: + +- Set `url` to the GitHub release asset. +- Replace the `sha256` with the checksum from the previous step. +- Remove the `depends_on "rust" => :build` line (no build needed). +- Install the binary directly inside `def install`: + +```ruby +bin.install "bose-universal-macos" => "bose" +doc.install "README.md" +(share/"licenses"/name).install "LICENSE" +``` + +## 5. Test locally + +```bash +cd ~/src/github/homebrew-tap +brew uninstall --force bose || true +brew install --formula ./Formula/bose.rb +bose --help +brew test ./Formula/bose.rb +brew audit --strict ./Formula/bose.rb +``` + +## 6. Open a PR + +Commit the formula/doc changes, push a branch, and open a PR. The +`brew test-bot` GitHub Action (see `.github/workflows/tests.yml`) will build and +verify the formula, and `publish.yml` will run `brew pr-pull` once the PR is +labelled appropriately. From 89576f0538e5a220ef41ec2ff7a8bf3b8d50464b Mon Sep 17 00:00:00 2001 From: Tim Van Wassenhove Date: Sat, 22 Nov 2025 14:09:52 +0100 Subject: [PATCH 2/2] chore: limit bose formula to macos --- Formula/bose.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Formula/bose.rb b/Formula/bose.rb index 2d95496..d5f49a5 100644 --- a/Formula/bose.rb +++ b/Formula/bose.rb @@ -4,6 +4,7 @@ class Bose < Formula url "https://github.com/timvw/bose/releases/download/v0.2.0/bose-0.2.0-macos-universal.tar.gz" sha256 "d0616decd3aca56e0b8642d6b26fd955288c6c86f70d5847fcaac59f25f6c3f4" license "Apache-2.0" + depends_on :macos def install bin.install "bose-universal-macos" => "bose"