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.109.tar.xz"
sha256 "629352e08c1fe84862ca046598d8a08ce14d26ab25ee1f4704f993d074cb7f26"
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: "cd3cced73506bd48998f50edf174694bcfe18138d16309ada80b87edb83e83c0"
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