homebrew-core/Formula/aws-sdk-cpp.rb
2017-06-16 05:14:02 -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.152.tar.gz"
sha256 "932b96f70b2313681c34b5316aa17b4c7e004ad60ec1a6a52e9d2de73a632422"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "83a4e50491503fa18e28f78cb3e84f001cb4d8e54b3cbab1cf397aeb3a767519" => :sierra
sha256 "9167ca9f815e0f89c7f3d37ca604881e516b34e6730dd396ee528ea0f6e85163" => :el_capitan
sha256 "889a218a74cf4933c2576ab3cfc4fe1689ccaede827ff54f46cc1b2f407994d1" => :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