homebrew-core/Formula/aws-sdk-cpp.rb
2016-10-19 20:39:14 -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.19.tar.gz"
sha256 "788d5be5aa1c32d5c27bf52a514b7b9a3a986b53989bf24f77f527c6da820040"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "f0f091fe77f5d0af9d14d57205ce7713fbf26df64e8097ef913749606bc56ea4" => :sierra
sha256 "50cbd86e59b57d9b7562da4260d376f9b749a49192398696be51c25117bf789b" => :el_capitan
sha256 "2218f6a9c55ca0ef069a942ec3da59bd8ac84da8f0d1fcb9996001f853009e82" => :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