homebrew-core/Formula/libssh2.rb
2019-06-20 15:24:12 +02:00

55 lines
1.4 KiB
Ruby

class Libssh2 < Formula
desc "C library implementing the SSH2 protocol"
homepage "https://libssh2.org/"
url "https://libssh2.org/download/libssh2-1.9.0.tar.gz"
sha256 "d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd"
bottle do
cellar :any
sha256 "0226917e00c2f5c003c441c11d06852d582cd6ddcb42042bf1f82515623528d5" => :mojave
sha256 "14fd7b3358ef6766754997059cb9126ec95e7c44d17cffdca39e986278a2220a" => :high_sierra
sha256 "53824fb7b5aa32db07cd99799cbfe0efb362a66ffcb84aba405755ca0eaa9f0b" => :sierra
end
head do
url "https://github.com/libssh2/libssh2.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "openssl"
def install
args = %W[
--prefix=#{prefix}
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--disable-examples-build
--with-openssl
--with-libz
--with-libssl-prefix=#{Formula["openssl"].opt_prefix}
]
system "./buildconf" if build.head?
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <libssh2.h>
int main(void)
{
libssh2_exit();
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lssh2", "-o", "test"
system "./test"
end
end