Skip to content

Commit

Permalink
libmnl (new formula)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMichka committed Sep 28, 2020
1 parent c187725 commit ad6968f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "Formula/alsa-lib.rb"
- "Formula/libaio.rb"
- "Formula/ladspa-sdk.rb"
- "Formula/libmnl.rb"
- "Formula/libnfnetlink.rb"
- "Formula/libseccomp.rb"
jobs:
Expand Down
37 changes: 37 additions & 0 deletions Formula/libmnl.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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

0 comments on commit ad6968f

Please sign in to comment.