add glad and yaml-cpp as well as update some packages (#182)

* update fmt and glfw

* add yaml-cpp

* add glad
pull/183/head
Hoildkv 4 years ago committed by GitHub
parent 4095212d76
commit f2fbb7d49e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/f/fmt/xmake.lua
  2. 25
      packages/g/glad/xmake.lua
  3. 10
      packages/g/glfw/xmake.lua
  4. 2
      packages/p/python/xmake.lua
  5. 23
      packages/y/yaml-cpp/xmake.lua

@ -4,6 +4,7 @@ package("fmt")
set_description("fmt is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams.")
set_urls("https://github.com/fmtlib/fmt/releases/download/$(version)/fmt-$(version).zip")
add_versions("7.1.3", "5d98c504d0205f912e22449ecdea776b78ce0bb096927334f80781e720084c9f")
add_versions("6.2.0", "a4468d528682143dcef2f16068104e03ef50467b0170b6125c9caf777d27bf10")
add_versions("6.0.0", "b4a16b38fa171f15dbfb958b02da9bbef2c482debadf64ac81ec61b5ac422440")
add_versions("5.3.0", "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c")

@ -0,0 +1,25 @@
package("glad")
set_homepage("https://glad.dav1d.de/")
set_description("Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.")
set_license("MIT")
add_urls("https://github.com/Dav1dde/glad/archive/$(version).tar.gz",
"https://github.com/Dav1dde/glad.git")
add_versions("v0.1.34", "4be2900ff76ac71a2aab7a8be301eb4c0338491c7e205693435b09aad4969ecd")
add_deps("cmake", "python 3.x", {kind = "binary"})
if is_plat("linux") then
add_syslinks("dl")
end
on_install("windows", "linux", "macosx", function (package)
local configs = {"-DGLAD_INSTALL=ON", "-DGLAD_REPRODUCIBLE=ON"}
if package:is_plat("windows") then
table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON"))
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("gladLoadGL", {includes = "glad/glad.h"}))
end)

@ -31,8 +31,8 @@ package("glfw")
on_install("macosx", "windows", "linux", "mingw", function (package)
local configs = {"-DGLFW_BUILD_DOCS=OFF", "-DGLFW_BUILD_TESTS=OFF", "-DGLFW_BUILD_EXAMPLES=OFF"}
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") and vs_runtime and vs_runtime:startswith("MD") then
table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL")
if package:is_plat("windows") then
table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON"))
elseif package:is_plat("linux") then
-- patch missing libxrender/includes
local cflags = {}
@ -46,11 +46,7 @@ package("glfw")
table.insert(configs, "-DCMAKE_C_FLAGS=" .. table.concat(cflags, " "))
end
end
import("package.tools.cmake").install(package, configs, {buildir = "build"})
if package:is_plat("windows", "mingw") and package:config("shared") then
os.trycp("build/install/bin", package:installdir())
package:addenv("PATH", "bin")
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)

@ -91,7 +91,7 @@ package("python")
on_install("@macosx", "@linux", function (package)
-- init configs
local configs = {"--enable-ipv6", "--with-ensurepip"}
local configs = {"--enable-ipv6", "--with-ensurepip", "--enable-optimizations"}
table.insert(configs, "--datadir=" .. package:installdir("share"))
table.insert(configs, "--datarootdir=" .. package:installdir("share"))

@ -0,0 +1,23 @@
package("yaml-cpp")
set_homepage("https://github.com/jbeder/yaml-cpp/")
set_description("A YAML parser and emitter in C++")
set_license("MIT")
add_urls("https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-$(version).tar.gz")
add_versions("0.6.3", "77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed")
add_deps("cmake")
on_install("windows", "linux", "macosx", function (package)
local configs = {"-DYAML_CPP_BUILD_TESTS=OFF"}
table.insert(configs, "-DYAML_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DYAML_MSVC_SHARED_RT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end
import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir"})
package:addenv("PATH", "bin")
end)
on_test(function (package)
assert(package:has_cxxtypes("YAML::Parser", {configs = {languages = "c++11"}, includes = "yaml-cpp/yaml.h"}))
end)
Loading…
Cancel
Save