homebrew-core/Formula/aws-sdk-cpp.rb
2017-03-22 23:20:05 -07:00

47 lines
1.4 KiB
Ruby

class AwsSdkCpp < Formula
desc "AWS SDK for C++"
homepage "https://github.com/aws/aws-sdk-cpp"
url "https://github.com/aws/aws-sdk-cpp/archive/1.0.86.tar.gz"
sha256 "a09f011c6d28cb4ff44d1da5bd4c07a51f5fd99cc42b7e2aa463bd51cdab56ef"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "4e0da403695b72f7812442ac538f67a39607548acbc66a40a520d8d5accc988d" => :sierra
sha256 "3ff84610745b4da6346592ed1a363a13acbcc817bb5a39148eca320dec5e7648" => :el_capitan
sha256 "b83ce44a3b10f6b2f5849379c35dbfa09afaf2fce8d9d8befc75466bb4c21cc2" => :yosemite
end
option "with-static", "Build with static linking"
option "without-http-client", "Don't include the libcurl HTTP client"
depends_on "cmake" => :build
def install
args = std_cmake_args
args << "-DSTATIC_LINKING=1" if build.with? "static"
args << "-DNO_HTTP_CLIENT=1" if build.without? "http-client"
mkdir "build" do
system "cmake", "..", *args
system "make"
system "make", "install"
end
lib.install Dir[lib/"mac/Release/*"].select { |f| File.file? f }
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <aws/core/Version.h>
#include <iostream>
int main() {
std::cout << Aws::Version::GetVersionString() << std::endl;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-laws-cpp-sdk-core"
system "./test"
end
end