homebrew-core/Formula/aws-sdk-cpp.rb
2016-12-09 15:09:22 +01: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.39.tar.gz"
sha256 "9b22aa0b6ec13418ac2f972fa936c2af343fc831807477ced5ed1ab6005cde51"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "6de337117d73b433a675f501449ecc09e5db9c2d79d475d227112b31ff99ca76" => :sierra
sha256 "75e7e344befdf7ded31ea2cf5caf5e830fad63a0473fd6e0436d71b4683a7b5e" => :el_capitan
sha256 "d72f99b1e379a6638f6a7ce69e4c92112a027667411cd46554dfca9bbad63b2c" => :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