homebrew-core/Formula/aws-sdk-cpp.rb
2017-05-19 06:24:18 -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.127.tar.gz"
sha256 "031c0e22274d946595deb989b8f440be3210ca98b3470848007125f3f1f40213"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "8bcf7f2deef65925f63e113c30d81c4c01fb5c92f4bb2724ebd7114383853895" => :sierra
sha256 "de1d75d658e2e9e217ae02c606f6c36768e7e5c06aaf8df9e41121ba91b9a97c" => :el_capitan
sha256 "5e440b41a653d1bcfcbc8b8bd8d44b2b91ff9c358e16cf143470073ea46c9b34" => :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