add opengl, glu and glut (#533)
parent
3e0b10e5e5
commit
d1c3a87994
7 changed files with 80 additions and 4 deletions
@ -0,0 +1,17 @@ |
||||
package("glu") |
||||
|
||||
set_homepage("https://gitlab.freedesktop.org/mesa/glu") |
||||
set_description("OpenGL utility library") |
||||
|
||||
on_fetch(function (package, opt) |
||||
if package:is_plat("macosx") then |
||||
return {frameworks = "OpenGL", defines = "GL_SILENCE_DEPRECATION"} |
||||
elseif package:is_plat("windows", "mingw") then |
||||
return {links = "glu32"} |
||||
end |
||||
if opt.system then |
||||
if package:is_plat("linux") and package.find_package then |
||||
return package:find_package("glu", opt) or package:find_package("libglu", opt) |
||||
end |
||||
end |
||||
end) |
@ -0,0 +1,21 @@ |
||||
package("glut") |
||||
|
||||
set_homepage("https://www.opengl.org/resources/libraries/glut/") |
||||
set_description("OpenGL utility toolkit") |
||||
|
||||
if not is_plat("macosx") then |
||||
add_deps("freeglut") |
||||
end |
||||
|
||||
on_fetch(function (package, opt) |
||||
if opt.system then |
||||
if package:is_plat("macosx") then |
||||
return {frameworks = {"GLUT", "OpenGL"}, defines = "GL_SILENCE_DEPRECATION"} |
||||
end |
||||
else |
||||
local freeglut = package:dep("freeglut") |
||||
if freeglut then |
||||
return freeglut:fetch(opt) |
||||
end |
||||
end |
||||
end) |
@ -0,0 +1,12 @@ |
||||
package("glx") |
||||
|
||||
set_homepage("https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXIntro.xml") |
||||
set_description("an extension to the X Window System core protocol providing an interface between OpenGL and the X Window System") |
||||
|
||||
on_fetch(function (package, opt) |
||||
if opt.system then |
||||
if package:is_plat("linux") and package.find_package then |
||||
return package:find_package("glx", opt) or package:find_package("libglx", opt) |
||||
end |
||||
end |
||||
end) |
@ -0,0 +1,18 @@ |
||||
package("opengl") |
||||
|
||||
set_homepage("https://opengl.org/") |
||||
set_description("OpenGL - The Industry Standard for High Performance Graphics") |
||||
|
||||
on_fetch(function (package, opt) |
||||
-- we always get it from compiler toolchain |
||||
if package:is_plat("macosx") then |
||||
return {frameworks = "OpenGL", defines = "GL_SILENCE_DEPRECATION"} |
||||
elseif package:is_plat("windows", "mingw") then |
||||
return {links = "opengl32"} |
||||
end |
||||
if opt.system then |
||||
if package:is_plat("linux") and package.find_package then |
||||
return package:find_package("opengl", opt) or package:find_package("libgl", opt) |
||||
end |
||||
end |
||||
end) |
Loading…
Reference in new issue