homebrew-core/Formula/aws-sdk-cpp.rb
2018-07-19 00:31:09 -07:00

49 lines
1.5 KiB
Ruby

class AwsSdkCpp < Formula
desc "AWS SDK for C++"
homepage "https://github.com/aws/aws-sdk-cpp"
# aws-sdk-cpp should only be updated every 10 releases on multiples of 10
url "https://github.com/aws/aws-sdk-cpp/archive/1.4.90.tar.gz"
sha256 "07b5a0f644bad0f8304c700f7be46b24a28fb39cdaeaab46f74eada5a0514b56"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "b95993c3cbad7e944c64d7cff0aefb4dd13d355d0fecb1f647837e58370e8e5f" => :high_sierra
sha256 "73372aa0202daa1e364bfd0242d89c4b71d329c5c5129baf12b5852c9ab1b820" => :sierra
sha256 "b0fea795059ef84890f5b8dbb0ab20990fc9b5860349c977431374179273e930" => :el_capitan
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
#include <aws/core/Version.h>
#include <iostream>
int main() {
std::cout << Aws::Version::GetVersionString() << std::endl;
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "test.cpp", "-L#{lib}", "-laws-cpp-sdk-core",
"-o", "test"
system "./test"
end
end