libfreefare: add endian function patch

Closes #35820.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Steven Mirabito 2019-01-08 22:57:33 -05:00 committed by FX Coudert
parent 61f955cbba
commit a745bfb0e2

View file

@ -20,10 +20,29 @@ class Libfreefare < Formula
depends_on "libnfc"
depends_on "openssl"
# Upstream commit for endianness-related functions, fixes
# https://github.com/nfc-tools/libfreefare/issues/55
patch do
url "https://github.com/nfc-tools/libfreefare/commit/358df775.diff?full_index=1"
sha256 "54cace0b9f7be073ba96ba1ae04fba8882a5ce99100a7b707498b9d2bfb0a660"
end
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <freefare.h>
int main() {
mifare_desfire_aid_new(0);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lfreefare", "-o", "test"
system "./test"
end
end