Homebrew tap for QEmu augmented with a power of VirGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
homebrew-qemu-virgl/Formula/libepoxy@20220315.1.rb

57 lines
1.6 KiB

class LibepoxyAT202203151 < Formula
desc "Library for handling OpenGL function pointer management"
homepage "https://github.com/anholt/libepoxy"
url "https://code.tokarch.uk/third_party/libepoxy.git", using: :git, revision: "001a36c01a66c0171758ef1a3709019d03391158"
version "20220315.1"
license "MIT"
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python@3.9" => :build
depends_on "libangle"
keg_only :versioned_formula
def install
mkdir "build" do
system "meson", *std_meson_args,
"-Dc_args=-I#{Formula["libangle"].opt_prefix}/include",
"-Dc_link_args=-L#{Formula["libangle"].opt_prefix}/lib",
"-Degl=yes", "-Dx11=false",
".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
test do
(testpath/"test.c").write <<~EOS
#include <epoxy/gl.h>
#include <OpenGL/CGLContext.h>
#include <OpenGL/CGLTypes.h>
#include <OpenGL/OpenGL.h>
int main()
{
CGLPixelFormatAttribute attribs[] = {0};
CGLPixelFormatObj pix;
int npix;
CGLContextObj ctx;
CGLChoosePixelFormat( attribs, &pix, &npix );
CGLCreateContext(pix, (void*)0, &ctx);
glClear(GL_COLOR_BUFFER_BIT);
CGLReleasePixelFormat(pix);
CGLReleaseContext(pix);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lepoxy", "-framework", "OpenGL", "-o", "test"
system "ls", "-lh", "test"
system "file", "test"
system "./test"
end
end