55 lines
1.6 KiB
Ruby
55 lines
1.6 KiB
Ruby
class Libva < Formula
|
|
desc "Hardware accelerated video processing library"
|
|
homepage "https://github.com/intel/libva"
|
|
url "https://github.com/intel/libva/releases/download/2.15.0/libva-2.15.0.tar.bz2"
|
|
sha256 "258ed409458d3e7a000e1908bc852619615ee6a933359c745fcd93eb3e461eca"
|
|
license "MIT"
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "c1e24c5c8d5dd843392730f054a8c5af5473d32ff0e07df7a1b7b019f56526c7"
|
|
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 <va/va.h>
|
|
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
|