41 lines
1.2 KiB
Ruby
41 lines
1.2 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.113.tar.xz"
|
|
sha256 "7fd7eb2967f63beb4606f22d50e277d993480d05ef75dd88a9bd8e677323e5e1"
|
|
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: "d4f9c979e3a78430d1679c592cf2641ce96851596fb119c36b3fe268d9812bb8"
|
|
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
|
|
system "meson", "setup", "build", "-Dcairo-tests=disabled", "-Dvalgrind=disabled", *std_meson_args
|
|
system "meson", "compile", "-C", "build", "--verbose"
|
|
system "meson", "install", "-C", "build"
|
|
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
|