47 lines
1.4 KiB
Ruby
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.1.40.tar.gz"
|
|
sha256 "0ab84a7e059b59313dc98ce3bb667720e5a70813b7d5ba8a2e62094935d12c23"
|
|
head "https://github.com/aws/aws-sdk-cpp.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "3629db58306b202c6f8cbc93288ce077ffef89ff16473803b54304d81ea7f966" => :sierra
|
|
sha256 "ddfc855a911509b1de66ee2bfc4f5a016fc64e4a4f9264b681d777719ead9e9e" => :el_capitan
|
|
sha256 "1cdcfbac15db1b48e0fed588e64f6c21d94b42c721e93386cac2208bb039f2d9" => :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", "-L#{lib}", "-laws-cpp-sdk-core"
|
|
system "./test"
|
|
end
|
|
end
|