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.161.tar.gz"
sha256 "6d9689a1a202096b88dfe7122387fddbfd5322ff16e898b59d14a811cb659f32"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "c84cd395ff587f2f778887954d29b61063bd23b044e771b7352f117df09f6cf1" => :sierra
sha256 "c079e81651959ee10a095e521d05a5f5946dc05abdbe4934f6d534d90ea191f6" => :el_capitan
sha256 "62935179aa78be92161a8ec96175b41a92de5c1107706b0184849065e6cdfbba" => :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