Skip to content

Add macvdmtool to Homebrew #16

Description

@n8felton

Summary

macvdmtool is eligible for homebrew/core except for one missing item: a versioned release tag. This issue asks for a tag. I will supply the supporting pull requests and the formula.

What the maintainer must do

Create one annotated tag and push it. That is the only blocker that requires maintainer access.

git tag -a v1.0.0 -m "v1.0.0"
git push origin v1.0.0

Homebrew then fetches https://github.com/AsahiLinux/macvdmtool/archive/refs/tags/v1.0.0.tar.gz and pins it by SHA-256. Every later tag becomes an automatic version bump through Homebrew's own CI. A GitHub Release is optional; the tag is sufficient.

The version number is your choice. I suggest v1.0.0 because the tool is stable and in use.

Why the tag is required

Acceptable Formulae states two rules that this repository does not meet today:

  • Stable releases: "Upstream must identify the packaged version as stable and provide an immutable tag or release." The repository has zero tags.
  • Versioned and verifiable sources: "An install step must not fetch code from a moving default branch or an unversioned, unchecksummed archive."

Criteria this repository already meets

Criterion Status
Notability: 30 forks, 30 watchers, or 75 stars Pass — 360 stars, 51 forks
Open-source license compatible with the DFSG Pass — Apache-2.0
Builds from source Pass — plain make, no dependencies
Builds with current Apple Clang Pass — verified on macOS 26
Command-line tool, not an .app bundle Pass
No vendored dependencies Pass
Public homepage that explains the project Pass — the README
Platform restriction to arm64 macOS Permitted; 18 formulae in homebrew/core already declare depends_on arch: :arm64

Pull requests I will open

Each one is small and independent. None changes tool behavior.

  1. Remove sudo from the install rule and honor DESTDIR. Homebrew forbids sudo during a build, and it installs into a staging directory before it links the file into the prefix. The current rule fails under both constraints. Proposed rule:

    PREFIX ?= /usr/local
    DESTDIR ?=
    
    .PHONY: install
    install: macvdmtool
    	$(INSTALL) -d "$(DESTDIR)$(PREFIX)/bin"
    	$(INSTALL) -m 755 "$<" "$(DESTDIR)$(PREFIX)/bin"

    This also fixes make install for packagers other than Homebrew. I verified it with make install DESTDIR=/tmp/stage PREFIX=/opt/test. The formula can also call bin.install "macvdmtool" and skip the rule, so this change is a convenience, not a blocker.

  2. Link with $(CXX) instead of cc, and add a clean rule. cc links a C++ object file only because -lc++ is passed by hand. $(CXX) is the correct driver and respects the compiler that Homebrew sets.

  3. Fix the two deprecation warnings. kIOMasterPortDefault has been deprecated since macOS 12. This is already open as Replace deprecated kIOMasterPortDefault with MACH_PORT_NULL #15.

  4. Add main.o to .gitignore. The build leaves an untracked object file in the working tree.

The formula

I will submit this to homebrew/core after the tag exists.

The desc field names DFU mode because that is the most common reason to reach for this tool. To revive or restore the firmware on an Apple Silicon Mac, an administrator must first put the target into DFU mode. Apple documents only a physical method for this step: hold a specific key or button combination on the target while you connect the cable. See How to revive or restore Mac firmware. The combination is different for each model, the timing is easy to get wrong, and a person must stand at the machine.

macvdmtool dfu replaces that step with one command on the host. No key combination, no timing, and no physical contact with the target. This makes the method usable over SSH and inside a script, which matters for a bench or a repair queue where an operator handles many machines. A brew install makes the command available on any host Mac, without a compiler and without Xcode.

class Macvdmtool < Formula
  desc "Serial console, remote reboot, and DFU mode for Apple Silicon over USB-C"
  homepage "https://github.com/AsahiLinux/macvdmtool"
  url "https://github.com/AsahiLinux/macvdmtool/archive/refs/tags/v1.0.0.tar.gz"
  sha256 "..."
  license "Apache-2.0"
  head "https://github.com/AsahiLinux/macvdmtool.git", branch: "main"

  depends_on arch: :arm64
  depends_on :macos

  def install
    system "make"
    bin.install "macvdmtool"
  end

  def caveats
    "macvdmtool must run as root, for example: sudo macvdmtool dfu"
  end

  test do
    assert_match "Usage:", shell_output("#{bin}/macvdmtool", 1)
  end
end

The test runs without root and without a second Mac attached. With no arguments the tool prints usage and exits 1, so the test passes in Homebrew CI.

Effect on the project

Homebrew's CI builds a bottle for each supported arm64 macOS version, so users get brew install macvdmtool with no compiler. Homebrew's livecheck watches your tags and opens the version-bump pull requests itself. The ongoing cost to you is one tag for each release.

Working with Homebrew as an Upstream Project describes what Homebrew asks of upstream maintainers.

Tell me if you prefer a third-party tap instead. In that case I will maintain it and close this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions