homebrew-core/Formula/aws-sdk-cpp.rb
2016-11-22 17:39:42 -05: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.33.tar.gz"
sha256 "c1aa8ae56ab7c748658103fdebb4f296565630364850907a755449260707c8b7"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "f82ec46d4c73d8d79c3f32e766292a52cfbff1d22f8c75e01e6a37aaff63cd34" => :sierra
sha256 "499ddf20a7d75672ecd503488daf877a257f555a586e298ddc18273a94be5f5a" => :el_capitan
sha256 "6f0e54d9cac31c8a88fa7f8c350b363974c9da56acd2d14519532ef8754a69af" => :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