-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
class Libssh2 < Formula | ||
desc "C library implementing the SSH2 protocol" | ||
homepage "https://libssh2.org/" | ||
url "https://libssh2.org/download/libssh2-1.11.0.tar.gz" | ||
mirror "https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.gz" | ||
mirror "http://download.openpkg.org/components/cache/libssh2/libssh2-1.11.0.tar.gz" | ||
sha256 "3736161e41e2693324deb38c26cfdc3efe6209d634ba4258db1cecff6a5ad461" | ||
license "BSD-3-Clause" | ||
revision 1 | ||
|
||
livecheck do | ||
url "https://libssh2.org/download/" | ||
regex(/href=.*?libssh2[._-]v?(\d+(?:\.\d+)+)\./i) | ||
end | ||
|
||
bottle do | ||
root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/libssh2-1.11.0" | ||
sha256 cellar: :any_skip_relocation, aarch64_linux: "581e945c9bff2de61fb7bb1ffcfd72a4a57e1c957170dae093dd5deb246a8446" | ||
end | ||
|
||
head do | ||
url "https://github.com/libssh2/libssh2.git", branch: "master" | ||
|
||
depends_on "autoconf" => :build | ||
depends_on "automake" => :build | ||
depends_on "libtool" => :build | ||
end | ||
|
||
depends_on "openssl@3" | ||
|
||
uses_from_macos "zlib" | ||
|
||
def install | ||
args = %W[ | ||
--disable-silent-rules | ||
--disable-examples-build | ||
--with-openssl | ||
--with-libz | ||
--with-libssl-prefix=#{Formula["openssl@3"].opt_prefix} | ||
] | ||
|
||
system "./buildconf" if build.head? | ||
system "./configure", *std_configure_args, *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 |