Skip to content

Commit

Permalink
Merge pull request #10 from glensc/vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 25, 2020
2 parents ceb95d2 + 9f93bcd commit 70afa99
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Formula/vcpkg.rb
@@ -0,0 +1,28 @@
class Vcpkg < Formula
desc "C++ Library Manager for Windows, Linux, and MacOS"
homepage "https://docs.microsoft.com/en-us/cpp/vcpkg"

url "https://github.com/microsoft/vcpkg/archive/2019.10.tar.gz"
sha256 "1a3e81b50702522ede10806f38d929d9aa4c7ffb5c2595eeee07a04cafacc77c"
head "https://github.com/microsoft/vcpkg.git"

depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "gcc" if MacOS.version <= :mojave

def install
if MacOS.version <= :mojave
ENV["CC"] = Formula["gcc"].opt_bin/"gcc-#{Formula["gcc"].version_suffix}"
ENV["CXX"] = Formula["gcc"].opt_bin/"g++-#{Formula["gcc"].version_suffix}"
end
args = %w[-useSystemBinaries]
args += %w[-allowAppleClang] if MacOS.version > :mojave
system "./bootstrap-vcpkg.sh", *args
libexec.install ["ports", "scripts", "triplets", "vcpkg", ".vcpkg-root"]
bin.install_symlink libexec/"vcpkg"
end

test do
assert_match "zlib", pipe_output("#{bin}/vcpkg search zlib")
end
end

0 comments on commit 70afa99

Please sign in to comment.