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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

[{script/*,*.rb,*.yml}]
[{script/*,*.{rb,yml}}]
indent_size = 2
20 changes: 12 additions & 8 deletions Homebrew/mas-tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ class Mas < Formula
desc "Mac App Store command-line interface"
homepage "https://github.com/mas-cli/mas"
url "https://github.com/mas-cli/mas.git",
:tag => "v1.7.0",
:revision => "35575ff962687cfd9a12f859668cf61d5ea819c2"
tag: "v1.7.1",
revision: "b8dcb4ce4b1d78ada7556565dd5c73e9913758d8"
license "MIT"
head "https://github.com/mas-cli/mas.git"

bottle do
root_url "https://dl.bintray.com/phatblat/mas-bottles"
cellar :any
sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :catalina
sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :mojave
sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :high_sierra
sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :sierra
sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :el_capitan
sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :catalina
sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :mojave
sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :high_sierra
sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :sierra
sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :el_capitan
end

depends_on "carthage" => :build
depends_on :xcode => ["10.2", :build]
depends_on xcode: ["10.2", :build]

def install
# Working around build issues in dependencies
# - Prevent warnings from causing build failures
# - Prevent linker errors by telling all lib builds to use max size install names
# - Ensure dependencies build for the current CPU; otherwise Commandant will
# build for x86_64 when running arm64
xcconfig = buildpath/"Overrides.xcconfig"
xcconfig.write <<~EOS
GCC_TREAT_WARNINGS_AS_ERRORS = NO
OTHER_LDFLAGS = -headerpad_max_install_names
VALID_ARCHS = #{Hardware::CPU.arch}
EOS
ENV["XCODE_XCCONFIG_FILE"] = xcconfig

Expand Down
16 changes: 10 additions & 6 deletions Homebrew/mas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ class Mas < Formula
desc "Mac App Store command-line interface"
homepage "https://github.com/mas-cli/mas"
url "https://github.com/mas-cli/mas.git",
:tag => "v1.7.0",
:revision => "35575ff962687cfd9a12f859668cf61d5ea819c2
tag: "v1.7.1",
revision: "b8dcb4ce4b1d78ada7556565dd5c73e9913758d8"
license "MIT"
head "https://github.com/mas-cli/mas.git"

bottle do
cellar :any
sha256 "b985d100947063ee94961f7f1290f232786634b869d20d56bd553197cf91188b" => :catalina
sha256 "c7005c34a3cf38d23f98e9cc238a0deae61f50ea5dfbcf51a34cc689a9db315e" => :mojave
sha256 "e6de2f98ebd21885a9827664fe1b7eea5516a7fd75d5b7383e3a9b088591a27f" => :catalina
sha256 "8b6dc4e261ebdc8e2f93afe87da3db4d482eb3d8a0358ab19a0485d434550e77" => :mojave
end

depends_on "carthage" => :build
depends_on :xcode => ["10.2", :build]
depends_on xcode: ["10.2", :build]

def install
# Working around build issues in dependencies
# - Prevent warnings from causing build failures
# - Prevent linker errors by telling all lib builds to use max size install names
# - Ensure dependencies build for the current CPU; otherwise Commandant will
# build for x86_64 when running arm64
xcconfig = buildpath/"Overrides.xcconfig"
xcconfig.write <<~EOS
GCC_TREAT_WARNINGS_AS_ERRORS = NO
OTHER_LDFLAGS = -headerpad_max_install_names
VALID_ARCHS = #{Hardware::CPU.arch}
EOS
ENV["XCODE_XCCONFIG_FILE"] = xcconfig

# Only build necessary dependencies (Commandant, Result)
# Only build necessary dependencies
system "carthage", "bootstrap", "--platform", "macOS", "Commandant"
system "script/install", prefix

Expand Down
7 changes: 6 additions & 1 deletion script/bottle
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ fi

# Uninstall if still found on path
if command -v mas > /dev/null; then
script/uninstall
script/uninstall || true # ignore failure
fi

# Purge the Carthage cache to avoid this error from Homebrew sandboxing:
# A shell task (/usr/bin/env git checkout --quiet --force 0.15.0 (launched in /Users/ben/Library/Caches/org.carthage.CarthageKit/dependencies/Commandant)) failed with exit code 128:
# fatal: Unable to create '/Users/ben/Library/Caches/org.carthage.CarthageKit/dependencies/Commandant/./index.lock': Operation not permitted
rm -rf ~/Library/Caches/org.carthage.CarthageKit

# Uninstall carthage via Mint
if command -v mint > /dev/null; then
mint uninstall carthage
fi

# Build the formula
brew install --build-bottle mas

Expand Down
4 changes: 2 additions & 2 deletions script/brew_formula_update
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
#
# script/brew_formula_update
# mas
Expand Down Expand Up @@ -29,7 +29,7 @@ fi
if test -n "$2"; then
REVISION="$2"
else
REVISION=$(git rev-parse HEAD)
REVISION=$(git rev-parse "$VERSION")
fi

echo "Checking to see if this update can be a simple bump."
Expand Down
14 changes: 14 additions & 0 deletions script/brew_update
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -e
#
# script/build_artifacts
# mas
#
# Runs all related scripts for generating all artifacts.
#

VERSION=$(script/version)

echo "Updating mas $VERSION Homebrew formula"

script/brew_formula_update
script/bottle
17 changes: 17 additions & 0 deletions script/build_artifacts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e
#
# script/build_artifacts
# mas
#
# Runs all related scripts for generating all artifacts.
#

VERSION=$(script/version)

echo "Building mas $VERSION artifacts"

script/clean
script/build
script/archive
script/install
script/package