homebrew-core/Formula/libmnl.rb

38 lines
1.0 KiB
Ruby

class Libmnl < Formula
desc "Minimalistic user-space library oriented to Netlink developers"
homepage "https://www.netfilter.org/projects/libmnl"
url "https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2"
sha256 "171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81"
license "LGPL-2.1-or-later"
depends_on :linux
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <libmnl/libmnl.h>
#include <linux/netlink.h>
int main(int argc, char *argv[])
{
struct mnl_socket *nl;
char buf[MNL_SOCKET_BUFFER_SIZE];
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lmnl", "-o", "test"
end
end