Add formula for chromium depot tools

main
Nikita Tokarchuk 3 years ago
parent 413af6c888
commit d9856462a6
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 36
      Formula/depot-tools.rb

@ -0,0 +1,36 @@
class DepotTools < Formula
desc "Tools for working with Chromium development"
homepage "http://dev.chromium.org/developers/how-tos/install-depot-tools"
url "https://chromium.googlesource.com/chromium/tools/depot_tools.git", using: :git, revision: "a657331e90e23e289e85a92af49b64829151f403"
version "20220120.a657331e9"
license "BSD-3-Clause"
#
# Credit to https://github.com/Homebrew/homebrew/pull/17675/files
#
depends_on "python@3.9"
depends_on "repo"
def install
dst = prefix/'tools'
dst.mkpath unless dst.directory?
mv Dir.glob('*'), dst
%w[gclient gn gcl git-cl hammer drover cpplint.py presubmit_support.py
trychange.py git-try wtf weekly git-gs zsh-goodies].each do |tool|
(bin/tool).write <<~EOS
#!/bin/bash
TOOL=#{prefix}/tools/#{tool}
export DEPOT_TOOLS_UPDATE=0
export PATH="$PATH:#{prefix}/tools"
exec "$TOOL" "$@"
EOS
end
end
test do
%w[gclient presubmit_support.py trychange.py].each do |tool|
system "#{bin}/#{tool} --version"
end
end
end
Loading…
Cancel
Save