homebrew-core/Formula/cryptopp.rb
ilovezfs 333be97e2a cryptopp 5.6.4
patch is no longer needed

Closes #4738.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-09-12 07:26:07 -07:00

39 lines
1.1 KiB
Ruby

class Cryptopp < Formula
desc "Free C++ class library of cryptographic schemes"
homepage "https://www.cryptopp.com/"
url "https://downloads.sourceforge.net/project/cryptopp/cryptopp/5.6.4/cryptopp564.zip"
version "5.6.4"
sha256 "be430377b05c15971d5ccb6e44b4d95470f561024ed6d701fe3da3a188c84ad7"
# https://cryptopp.com/wiki/Config.h#Options_and_Defines
bottle :disable, "Library and clients must be built on the same microarchitecture"
option :cxx11
def install
ENV.cxx11 if build.cxx11?
system "make", "shared", "all", "CXX=#{ENV.cxx}"
system "./cryptest.exe", "v"
system "make", "install", "PREFIX=#{prefix}"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <cryptopp/sha.h>
#include <string>
using namespace CryptoPP;
using namespace std;
int main()
{
byte digest[SHA::DIGESTSIZE];
string data = "Hello World!";
SHA().CalculateDigest(digest, (byte*) data.c_str(), data.length());
return 0;
}
EOS
ENV.cxx11 if build.cxx11?
system ENV.cxx, "test.cpp", "-L#{lib}", "-lcryptopp", "-o", "test"
system "./test"
end
end