Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homebrew/Casks/focusrite-volume-control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

url "https://github.com/enum-dot-dev/focusrite-volume-control/releases/download/v#{version}/VolumeControl.dmg"
name "Volume Control"
desc "Control Focusrite Scarlett 4th gen volume with media keys via Focusrite Control 2"
desc "Control Scarlett 4th gen volume with media keys via Focusrite Control 2"
homepage "https://enum.dev/focusrite-volume-control/"

conflicts_with cask: "focusrite-volume-control@beta"
depends_on macos: ">= :sonoma"
depends_on macos: :sonoma

app "Volume Control.app"

Expand Down
12 changes: 7 additions & 5 deletions scripts/render_cask.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
"""Render a Homebrew cask for a release from homebrew/Casks/focusrite-volume-control.rb.

The release workflow copies the rendered casks into the tap repository, so this repo's
cask stays the single source of truth. Unsigned builds get a postflight that clears
the quarantine attribute, since Gatekeeper blocks un-notarized apps downloaded by brew.
cask stays the single source of truth. Unsigned builds get a postflight_steps stanza that
clears the quarantine attribute, since Gatekeeper blocks un-notarized apps downloaded by
brew. Homebrew deprecated Ruby flight blocks (`postflight do ... system_command ...`), so
the stanza uses the declarative steps DSL with an install-time {{appdir}} token.

--beta renders focusrite-volume-control@beta instead. Both casks install the same app,
so each one conflicts with the other. Only the beta cask accepts prerelease versions
Expand All @@ -25,9 +27,9 @@

QUARANTINE_POSTFLIGHT = '''
# Unsigned build: clear quarantine so Gatekeeper doesn't block the app
postflight do
system_command "/usr/bin/xattr",
args: ["-cr", "#{appdir}/Volume Control.app"]
postflight_steps do
run "/usr/bin/xattr",
args: ["-cr", "{{appdir}}/Volume Control.app"]
end
'''

Expand Down
6 changes: 6 additions & 0 deletions scripts/test_render_cask.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_stable(self):
self.assertIn(f' sha256 "{SHA}"', cask)
self.assertIn(f' conflicts_with cask: "{BETA_TOKEN}"', cask)
self.assertNotIn("postflight do", cask)
self.assertNotIn("postflight_steps", cask)
self.assertNotIn("auto_updates", cask)

def test_beta_swaps_token_and_conflict(self):
Expand Down Expand Up @@ -53,6 +54,11 @@ def test_unsigned_adds_quarantine_postflight_after_app(self):
cask = render(template(), "1.6.0", SHA, unsigned=True, auto_updates=False)
self.assertIn(' app "Volume Control.app"\n\n # Unsigned build', cask)
self.assertIn('"/usr/bin/xattr"', cask)
# Homebrew deprecated Ruby flight blocks; the steps DSL takes {{...}} tokens, not #{...}
self.assertIn(" postflight_steps do\n", cask)
self.assertNotIn("postflight do", cask)
self.assertNotIn("system_command", cask)
self.assertIn('"{{appdir}}/Volume Control.app"', cask)

def test_auto_updates_goes_before_conflicts_with(self):
for beta in (False, True):
Expand Down
Loading