homebrew-core/Formula/libpciaccess.rb

40 lines
1005 B
Ruby

class Libpciaccess < Formula
desc "Generic PCI access library"
homepage "https://www.x.org/"
url "https://www.x.org/pub/individual/lib/libpciaccess-0.16.tar.bz2"
sha256 "214c9d0d884fdd7375ec8da8dcb91a8d3169f263294c9a90c575bf1938b9f489"
license "MIT"
depends_on "pkg-config" => :build
depends_on "util-macros" => :build
depends_on :linux
def install
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--disable-dependency-tracking
--disable-silent-rules
]
system "./configure", *args
system "make"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#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;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lpciaccess"
end
end