class Libpciaccess < Formula desc "Generic PCI access library" homepage "https://www.x.org/" url "https://www.x.org/pub/individual/lib/libpciaccess-0.18.1.tar.xz" sha256 "4af43444b38adb5545d0ed1c2ce46d9608cc47b31c2387fc5181656765a6fa76" license "MIT" revision 1 no_autobump! because: :requires_manual_review bottle do sha256 cellar: :any_skip_relocation, arm64_linux: "8dbbb641d72ca3d52c3e888e98ce1b4ebca20f5eca28a171b5ddc00b7a52bbf9" sha256 cellar: :any_skip_relocation, x86_64_linux: "a553839647c06387234321eb625545c4b1b3f757a9db3621127fff968a187a28" end depends_on "meson" => :build depends_on "ninja" => :build depends_on "pkgconf" => :build depends_on "util-macros" => :build depends_on :linux depends_on "zlib-ng-compat" def install # Work around Meson's automatic removal of RPATHs by explicitly passing in LDFLAGS ENV.append "LDFLAGS", "-Wl,-rpath,#{Formula["zlib-ng-compat"].opt_lib}" system "meson", "setup", "build", *std_meson_args system "meson", "compile", "-C", "build", "--verbose" system "meson", "install", "-C", "build" end test do (testpath/"test.c").write <<~C #include "pciaccess.h" int main(int argc, char* argv[]) { int pci_system_init(void); const struct pci_id_match *match; struct pci_device_iterator *iter; struct pci_device *dev; return 0; } C system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lpciaccess" end end