homebrew-core/Formula/libdrm.rb

43 lines
1.1 KiB
Ruby

class Libdrm < Formula
desc "Library for accessing the direct rendering manager"
homepage "https://dri.freedesktop.org"
url "https://dri.freedesktop.org/libdrm/libdrm-2.4.107.tar.xz"
sha256 "c554cef03b033636a975543eab363cc19081cb464595d3da1ec129f87370f888"
license "MIT"
livecheck do
url "https://dri.freedesktop.org/libdrm/"
regex(/href=.*?libdrm[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 x86_64_linux: "df125614ad1312e7fc25d910396e0508ef6b1dbde961bead8d6120200ea93f63"
end
depends_on "docutils" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "libpciaccess"
depends_on :linux
def install
mkdir "build" do
system "meson", *std_meson_args, ".."
system "ninja"
system "ninja", "install"
end
end
test do
(testpath/"test.c").write <<~EOS
#include <libdrm/drm.h>
int main(int argc, char* argv[]) {
struct drm_gem_open open;
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-ldrm"
end
end