From 599086d8b7a0eaf49d8a9c2033929ec6aa477d28 Mon Sep 17 00:00:00 2001 From: Seeker Date: Wed, 23 Dec 2020 01:50:50 -0800 Subject: [PATCH] libva (new formula) (#67385) --- .github/workflows/tests-linux.yml | 1 + Formula/libva.rb | 50 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Formula/libva.rb diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml index 66fa55e67492..d4f77a2a7ba1 100644 --- a/.github/workflows/tests-linux.yml +++ b/.github/workflows/tests-linux.yml @@ -19,6 +19,7 @@ on: - "Formula/libpciaccess.rb" - "Formula/libseccomp.rb" - "Formula/libtirpc.rb" + - "Formula/libva.rb" - "Formula/linux-headers.rb" - "Formula/strace.rb" - "Formula/valgrind.rb" diff --git a/Formula/libva.rb b/Formula/libva.rb new file mode 100644 index 000000000000..e2660bfbf971 --- /dev/null +++ b/Formula/libva.rb @@ -0,0 +1,50 @@ +class Libva < Formula + desc "Hardware accelerated video processing library" + homepage "https://github.com/intel/libva" + url "https://github.com/intel/libva/releases/download/2.6.1/libva-2.6.1.tar.bz2" + sha256 "6c57eb642d828af2411aa38f55dc10111e8c98976dbab8fd62e48629401eaea5" + license "MIT" + + livecheck do + url :stable + strategy :github_latest + end + + depends_on "pkg-config" => [:build, :test] + depends_on "libdrm" + depends_on "libx11" + depends_on "libxext" + depends_on "libxfixes" + depends_on :linux + depends_on "wayland" + + def install + system "./configure", "--prefix=#{prefix}", + "--sysconfdir=#{etc}", + "--localstatedir=#{var}", + "--disable-dependency-tracking", + "--disable-silent-rules", + "--enable-drm", + "--enable-x11", + "--disable-glx", + "--enable-wayland" + system "make" + system "make", "install" + end + + test do + %w[libva libva-drm libva-wayland libva-x11].each do |name| + assert_match "-I#{include}", shell_output("pkg-config --cflags #{name}") + end + (testpath/"test.c").write <<~EOS + #include + int main(int argc, char *argv[]) { + VADisplay display; + vaDisplayIsValid(display); + return 0; + } + EOS + system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lva" + system "./test" + end +end