Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for libinotify #135

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Formula/libinotify-kqueue.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class LibinotifyKqueue < Formula
desc "BSD port of Linux's inotify"
homepage "https://github.com/libinotify-kqueue/libinotify-kqueue"
url "https://github.com/libinotify-kqueue/libinotify-kqueue.git",
tag: "20211018",
revision: "ea7835fcafc3cee2a0d6c0e3c8034962c48f6afe"
license "MIT"
head "https://github.com/libinotify-kqueue/libinotify-kqueue.git",
branch: "master"

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gcc" => :build
depends_on "libtool" => :build

def install
# Autoconf
system "autoreconf", "-fiv"
# Configure
system "./configure"
# Build
system "make"
# Copy
system "make", "install", "DESTDIR=#{buildpath}"
# Move
lib.install Dir["#{buildpath}/usr/local/lib/*"]
include.install Dir["#{buildpath}/usr/local/include/*"]
man.install Dir["#{buildpath}/usr/local/share/man/*"]
end

test do
# Check if the library is installed
(testpath/"test.cpp").write <<~EOS
#include <sys/inotify.h>
int main() {
inotify_init();
return 0;
}
EOS
system ENV.cc, "test.cpp", "-L#{lib}", "-linotify", "-o", "test"
system "./test"
end
end
Loading