homebrew-core/Formula/aws-sdk-cpp.rb
2018-02-07 05:48:35 -08:00

48 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.3.50.tar.gz"
sha256 "bab117392759ab829465e765630fd9332045fb940bea2233c700ae8ad97808ea"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "63bbeb495fefc89ef5eac3070c40606541b68bbb35ce9aea2c6100468308c947" => :high_sierra
sha256 "e2f0e419c9df4eac74946b002cc5e9ed989b0c11f8a401e9c41b2b86e3e799ae" => :sierra
sha256 "bd3881fe6ed4e25b392cdd064e69b8e25fbd080b5697ed21f1ce3c05be01b92a" => :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, "test.cpp", "-o", "test", "-L#{lib}", "-laws-cpp-sdk-core"
system "./test"
end
end