homebrew-core/Formula/azure-storage-cpp.rb
Matthias Schmieder 460daa708e azure-storage-cpp 5.1.1 (new formula)
Closes #32652.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
2018-11-02 17:14:07 +01:00

48 lines
1.8 KiB
Ruby

class AzureStorageCpp < Formula
desc "Microsoft Azure Storage Client Library for C++"
homepage "https://azure.github.io/azure-storage-cpp"
url "https://github.com/Azure/azure-storage-cpp/archive/v5.1.1.tar.gz"
sha256 "29b4b0c47784ae541b0ef1b3693acba54e0d06bac78d139105a379ab1fd20333"
depends_on "cmake" => :build
depends_on "boost"
depends_on "cpprestsdk"
depends_on "gettext"
depends_on "openssl"
depends_on "ossp-uuid"
def install
system "cmake", "Microsoft.WindowsAzure.Storage",
"-DBUILD_SAMPLES=OFF",
"-DBUILD_TESTS=OFF",
*std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <was/common.h>
#include <was/storage_account.h>
using namespace azure;
int main() {
utility::string_t storage_connection_string(_XPLATSTR("DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myaccountkey"));
try {
azure::storage::cloud_storage_account storage_account = azure::storage::cloud_storage_account::parse(storage_connection_string);
return 0;
}
catch(...){ return 1; }
}
EOS
flags = ["-stdlib=libc++", "-std=c++11", "-I#{include}",
"-I#{Formula["boost"].include}",
"-I#{Formula["openssl"].include}",
"-I#{Formula["cpprestsdk"].include}",
"-L#{Formula["boost"].lib}",
"-L#{Formula["cpprestsdk"].lib}",
"-L#{Formula["openssl"].lib}",
"-L#{lib}",
"-lcpprest", "-lboost_system-mt", "-lssl", "-lcrypto", "-lazurestorage"] + ENV.cflags.to_s.split
system ENV.cxx, "-o", "test_azurestoragecpp", "test.cpp", *flags
system "./test_azurestoragecpp"
end
end