yoga: add package (#2788)

pull/2789/head
star9029 1 year ago committed by GitHub
parent fadf2bd884
commit 6b5d2928a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      packages/y/yoga/xmake.lua

@ -0,0 +1,25 @@
package("yoga")
set_homepage("https://yogalayout.com/")
set_description("Yoga is a cross-platform layout engine which implements Flexbox. Follow https://twitter.com/yogalayout for updates.")
set_license("MIT")
add_urls("https://github.com/facebook/yoga/archive/refs/tags/$(version).tar.gz",
"https://github.com/facebook/yoga.git")
add_versions("v2.0.1", "4c80663b557027cdaa6a836cc087d735bb149b8ff27cbe8442fc5e09cec5ed92")
add_configs("shared", {description = "Build shared binaries", default = false, type = "boolean", readonly = true})
add_deps("cmake")
on_install(function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true})
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("YGNodeNew", {includes = "yoga/Yoga.h"}))
end)
Loading…
Cancel
Save