41 lines
1.0 KiB
Ruby
41 lines
1.0 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.104.tar.xz"
|
|
sha256 "d66ad8b5c2441015ac1333e40137bb803c3bde3612ff040286fcc12158ea1bcb"
|
|
license "MIT"
|
|
|
|
livecheck do
|
|
url "https://dri.freedesktop.org/libdrm/"
|
|
regex(/href=.*?libdrm[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
depends_on "docbook" => :build
|
|
depends_on "docbook-xsl" => :build
|
|
depends_on "libxslt" => :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
|