parent
7c781a4402
commit
8c60bad764
@ -0,0 +1,57 @@ |
||||
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 |
@ -0,0 +1,57 @@ |
||||
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 |
Loading…
Reference in new issue