homebrew-core/Formula/libfuse.rb

47 lines
1.4 KiB
Ruby

class Libfuse < Formula
desc "Reference implementation of the Linux FUSE interface"
homepage "https://github.com/libfuse/libfuse"
url "https://github.com/libfuse/libfuse/releases/download/fuse-3.12.0/fuse-3.12.0.tar.xz"
sha256 "33b8a92d6f7a88e6a889f0009206933482f48f3eb85d88cf09ef551313ac7373"
license any_of: ["LGPL-2.1-only", "GPL-2.0-only"]
head "https://github.com/libfuse/libfuse.git", branch: "master"
bottle do
sha256 x86_64_linux: "cbeb14c2e6c0ef51d4d2574a591e2a2de0e676d9b9491d35549bbf0afd807148"
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on :linux
def install
args = std_meson_args + %W[
--sysconfdir=#{etc}
-Dinitscriptdir=#{etc}/init.d
-Dudevrulesdir=#{etc}/udev/rules.d
-Duseroot=false
]
mkdir "build" do
system "meson", *args, ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
(pkgshare/"doc").install "doc/kernel.txt"
end
test do
(testpath/"fuse-test.c").write <<~EOS
#define FUSE_USE_VERSION 31
#include <fuse3/fuse.h>
#include <stdio.h>
int main() {
printf("%d%d\\n", FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION);
printf("%d\\n", fuse_version());
return 0;
}
EOS
system ENV.cc, "fuse-test.c", "-L#{lib}", "-I#{include}", "-D_FILE_OFFSET_BITS=64", "-lfuse3", "-o", "fuse-test"
system "./fuse-test"
end
end