homebrew-core/Formula/aws-sdk-cpp.rb

48 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.7.tar.gz"
sha256 "27c2bbdb6e1b1b6eb99f3663c639e59961c818673440e006032c4aff8697a77a"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "4a0c0c1c4c77760efed507241f79d58eb255e71c6ba5d18ca68e3061f148a458" => :el_capitan
sha256 "db9893bf29a8968e3cd78a12f170e767e2e2848e767e457c53aa328040f740f5" => :yosemite
sha256 "48deb013abd4c556eda461a4bddaf8d21c1b68484eef5994f342e151cdaa22ca" => :mavericks
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