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 #include #include #include 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