homebrew-core/Formula/libpciaccess.rb

44 lines
1.1 KiB
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"
bottle do
sha256 cellar: :any_skip_relocation, x86_64_linux: "40ad780e2eca51034f9203259b5970978932f5d437124f333717863a0b900e43"
end
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