/
liburing.rb
36 lines (32 loc) 路 1.21 KB
/
liburing.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class Liburing < Formula
desc "Helpers to setup and teardown io_uring instances"
homepage "https://github.com/axboe/liburing"
# not need to check github releases, as tags are sufficient, see https://github.com/axboe/liburing/issues/1008
url "https://github.com/axboe/liburing/archive/refs/tags/liburing-2.6.tar.gz"
sha256 "682f06733e6db6402c1f904cbbe12b94942a49effc872c9e01db3d7b180917cc"
license any_of: ["MIT", "LGPL-2.1-only"]
head "https://github.com/axboe/liburing.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, x86_64_linux: "a369928abdce516f5cbaedc983900a24b3e22d345f5942e0d62f464578095fbc"
end
depends_on :linux
def install
# not autotools based configure, so std_configure_args is not suitable
system "./configure", "--prefix=#{prefix}", "--libdir=#{lib}", "--mandir=#{man}"
system "make"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <assert.h>
#include <liburing.h>
int main() {
struct io_uring ring;
assert(io_uring_queue_init(1, &ring, 0) == 0);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{opt_lib}", "-luring", "-o", "test"
system "./test"
end
end