Homebrew bottle builder and tap manager for OCaml monorepos
OCaml 95.2%
Dune 1.3%
Other 3.5%
49 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-homebrew https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-homebrew
git@git.recoil.org:gazagnaire.org/ocaml-homebrew git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-homebrew

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

homebrew#

Homebrew bottle builder and tap manager for OCaml monorepos.

Overview#

Build, upload, and release Homebrew bottles from dune monorepos. Generates Ruby formulas with platform-specific SHA256 checksums, uploads bottles to S3-compatible storage, and manages tap repositories.

Features#

  • YAML configuration for binary definitions and storage settings
  • Platform-aware bottle building (macOS ARM64/Intel, Linux x86_64/ARM64)
  • S3-compatible storage upload via rclone (dated + rolling "latest" releases)
  • Automatic Ruby formula generation with head-build support
  • SHA256 checksum computation and formula updating
  • Full release workflow: build, upload, update tap, commit and push

Installation#

opam install homebrew

Configuration#

Create a homebrew.yml file:

handle: gazagnaire.org

storage:
  bucket: homebrew-bottles
  region: fr-par
  profile: homebrew-monopam

tap:
  clone_url: https://tangled.org/gazagnaire.org/homebrew-monopam.git
  push_url: git@git.recoil.org:gazagnaire.org/homebrew-monopam

binaries:
  - name: prune
    package: prune
    description: "Dead code remover for OCaml .mli files"
    homepage: https://tangled.org/gazagnaire.org/prune

  - name: merlint
    package: merlint
    description: "Opinionated OCaml linter powered by Merlin"

  - name: agent
    package: ocaml-agent
    description: "Claude Code container orchestrator"
    exe_name: main
    head_deps:
      - name: docker
        type: recommended

Optional fields#

Field Default
mono_url https://tangled.org/{handle}/mono.git
license ISC
build_dir _homebrew_build
storage.endpoint https://s3.{region}.scw.cloud
storage.rclone_remote scaleway
tap.local_path ../homebrew-monopam
binary.homepage https://tangled.org/{handle}/{package}
binary.exe_name Same as binary name
binary.head_deps []

Usage#

# Show parsed configuration
bottler config -c homebrew.yml

# Build bottles for current platform
bottler build -c homebrew.yml

# Build specific binaries only
bottler build -c homebrew.yml prune merlint

# Upload bottles to S3
bottler upload -c homebrew.yml

# Generate formula files
bottler formula -c homebrew.yml

# Full release: build + upload + update tap
bottler release -c homebrew.yml

API#

  • Homebrew.load_config - Load YAML configuration
  • Homebrew.detect_platform - Detect current build platform
  • Homebrew.build - Build bottles
  • Homebrew.upload - Upload to S3 storage
  • Homebrew.generate_formula - Generate Ruby formula
  • Homebrew.sha256_file - Compute SHA256 digest
  • Homebrew.release - Full release workflow
  • homebrew-core - The official Homebrew formula repository
  • goreleaser - Go binary release automation (similar concept for Go)
  • cargo-dist - Rust binary distribution tool

Licence#

ISC License. See LICENSE.md for details.