Skip to content

Commit

Permalink
libxcrypt: update 4.4.36 bottle.
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Sep 4, 2024
1 parent 8dfbf3b commit 0dc2c17
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Formula/lib/libxcrypt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
class Libxcrypt < Formula
desc "Extended crypt library for descrypt, md5crypt, bcrypt, and others"
homepage "https://github.com/besser82/libxcrypt"
url "https://github.com/besser82/libxcrypt/releases/download/v4.4.36/libxcrypt-4.4.36.tar.xz"
sha256 "e5e1f4caee0a01de2aee26e3138807d6d3ca2b8e67287966d1fefd65e1fd8943"
license "LGPL-2.1-or-later"

livecheck do
url :stable
strategy :github_latest
end

bottle do
root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/libxcrypt-4.4.36"
sha256 cellar: :any_skip_relocation, aarch64_linux: "555a7fa3314db9771803f4e46f1fc231fd48b9b180f10a503c12ec786d322378"
end

keg_only :provided_by_macos

link_overwrite "include/crypt.h"
link_overwrite "lib/libcrypt.so"

def install
system "./configure", *std_configure_args,
"--disable-static",
"--disable-obsolete-api",
"--disable-xcrypt-compat-files",
"--disable-failure-tokens",
"--disable-valgrind"
system "make", "install"
end

test do
(testpath/"test.c").write <<~EOS
#include <crypt.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
int main()
{
char *hash = crypt("abc", "$2b$05$abcdefghijklmnopqrstuu");
if (errno) {
fprintf(stderr, "Received error: %s", strerror(errno));
return errno;
}
if (hash == NULL) {
fprintf(stderr, "Hash is NULL");
return -1;
}
if (strcmp(hash, "$2b$05$abcdefghijklmnopqrstuuRWUgMyyCUnsDr8evYotXg5ZXVF/HhzS")) {
fprintf(stderr, "Unexpected hash output");
return -1;
}
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcrypt", "-o", "test"
system "./test"
end
end

0 comments on commit 0dc2c17

Please sign in to comment.