homebrew-core/Formula/botan.rb
2018-01-13 07:53:09 -08:00

48 lines
1.4 KiB
Ruby

class Botan < Formula
desc "Cryptographic algorithms and formats library in C++"
homepage "https://botan.randombit.net/"
url "https://botan.randombit.net/releases/Botan-2.4.0.tgz"
sha256 "ed9464e2a5cfee4cd3d9bd7a8f80673b45c8a0718db2181a73f5465a606608a5"
head "https://github.com/randombit/botan.git"
bottle do
sha256 "6df2a98208e2495e3bdf95ac62f49e0686f0dc3421507fc0310246c8bbdb4279" => :high_sierra
sha256 "abcc8559813b0974792f4d9d2d314e7616f0a561896cf670b1ff11be03e894e6" => :sierra
sha256 "377172cd6cf1b00af94b2c82dd91dd26335060d11231a5b8cbae1951a9b8986f" => :el_capitan
end
option "with-debug", "Enable debug build of Botan"
deprecated_option "enable-debug" => "with-debug"
depends_on "pkg-config" => :build
depends_on "openssl"
needs :cxx11
def install
ENV.cxx11
args = %W[
--prefix=#{prefix}
--docdir=share/doc
--cpu=#{MacOS.preferred_arch}
--cc=#{ENV.compiler}
--os=darwin
--with-openssl
--with-zlib
--with-bzip2
]
args << "--enable-debug" if build.with? "debug"
system "./configure.py", *args
system "make", "install"
end
test do
(testpath/"test.txt").write "Homebrew"
(testpath/"testout.txt").write Utils.popen_read("#{bin}/botan base64_enc test.txt")
assert_match "Homebrew", shell_output("#{bin}/botan base64_dec testout.txt")
end
end