homebrew-core/Formula/aws-sdk-cpp.rb
2017-03-07 03:53:59 -08: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.78.tar.gz"
sha256 "053916536ea3581d8aa67be051a869394fa56435935e8e39e94f4c5c0553c7cf"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "3c5eb803f9ceff43468c393b17d6ef0d819e80fbdc4242216eedd6a27785b3ac" => :sierra
sha256 "4fcb4230e67032bbd965fc5902619aa3bcffde214ff1d5f9ab6b1383f3af35cf" => :el_capitan
sha256 "d2a841a9d20cae11b8fc7d878e6bbb07c56f350c5a6b68d509a022a889301aae" => :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