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.
57 lines
1.6 KiB
57 lines
1.6 KiB
class LibepoxyAT202111031 < 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: "2b69a68ae3f6a3f63fe6166677fa8e8b15471c1b"
|
|
version "20211103.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
|
|
|