add libepoxy, fribidi and lvgl (#618 )
* fix cuda env * improve corrade * improve xorgproto * add libepoxy * add fribidi * add lvgl * fix cmake errorpull/622/head
parent
1e6a2eb963
commit
b4cee6bcb2
6 changed files with 94 additions and 2 deletions
@ -0,0 +1,26 @@ |
||||
package("fribidi") |
||||
|
||||
set_homepage("https://github.com/fribidi/fribidi") |
||||
set_description("The Free Implementation of the Unicode Bidirectional Algorithm.") |
||||
set_license("LGPL-2.1") |
||||
|
||||
add_urls("https://github.com/fribidi/fribidi/releases/download/v$(version)/fribidi-$(version).tar.xz") |
||||
add_versions("1.0.10", "7f1c687c7831499bcacae5e8675945a39bacbad16ecaa945e9454a32df653c01") |
||||
|
||||
if is_plat("linux") then |
||||
add_extsources("apt::libfribidi-dev") |
||||
end |
||||
|
||||
on_install("macosx", "linux", function (package) |
||||
local configs = {} |
||||
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) |
||||
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) |
||||
if package:config("pic") ~= false then |
||||
table.insert(configs, "--with-pic") |
||||
end |
||||
import("package.tools.autoconf").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("fribidi_debug_status", {includes = "fribidi/fribidi-common.h"})) |
||||
end) |
@ -0,0 +1,26 @@ |
||||
package("libepoxy") |
||||
|
||||
set_homepage("https://download.gnome.org/sources/libepoxy/") |
||||
set_description("Epoxy is a library for handling OpenGL function pointer management for you.") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://download.gnome.org/sources/libepoxy/$(version).tar.xz", {version = function (version) |
||||
return format("%d.%d/libepoxy-%s", version:major(), version:minor(), version) |
||||
end}) |
||||
add_versions("1.5.9", "d168a19a6edfdd9977fef1308ccf516079856a4275cf876de688fb7927e365e4") |
||||
|
||||
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) |
||||
|
||||
if is_plat("linux") then |
||||
add_extsources("apt::libepoxy-dev") |
||||
add_deps("libx11", "pkg-config") |
||||
end |
||||
|
||||
add_deps("meson", "ninja") |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
import("package.tools.meson").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("epoxy_gl_version", {includes = "epoxy/gl.h"})) |
||||
end) |
@ -0,0 +1,31 @@ |
||||
package("lvgl") |
||||
|
||||
set_homepage("https://lvgl.io") |
||||
set_description("Light and Versatile Graphics Library") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/lvgl/lvgl/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/lvgl/lvgl.git") |
||||
add_versions("v8.0.2", "7136edd6c968b60f0554130c6903f16870fa26cda11a2290bc86d09d7138a6b4") |
||||
|
||||
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
||||
add_configs("color_depth", {description = "Set color depth.", default = "32", type = "string", values = {"1", "8", "16", "32"}}) |
||||
add_configs("use_log", {description = "Enable the log module.", default = false, type = "boolean"}) |
||||
|
||||
add_deps("cmake") |
||||
on_install(function (package) |
||||
os.mv("lv_conf_template.h", "src/lv_conf.h") |
||||
io.replace("src/lv_conf.h", "#if 0", "#if 1") |
||||
io.replace("src/lv_conf.h", "#define LV_BUILD_EXAMPLES -1", "#define LV_BUILD_EXAMPLES 0") |
||||
io.replace("src/lv_conf.h", "#define LV_COLOR_DEPTH -16", "#define LV_COLOR_DEPTH " .. package:config("color_depth")) |
||||
io.replace("src/lv_conf.h", "#define LV_USE_LOG -0", "#define LV_USE_LOG " .. (package:config("use_log") and "1" or "0")) |
||||
io.replace("CMakeLists.txt", "add_library(lvgl STATIC ${SOURCES})", "add_library(lvgl STATIC ${SOURCES})\ninstall(TARGETS lvgl)\ninstall(FILES lvgl.h DESTINATION include)\ninstall(DIRECTORY src DESTINATION include FILES_MATCHING PATTERN \"*.h\")", {plain = true}) |
||||
io.replace("CMakeLists.txt", "if(ESP_PLATFORM)", "cmake_minimum_required(VERSION 3.15)\nif(ESP_PLATFORM)", {plain = true}) |
||||
local configs = {} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("lv_version_info", {includes = "lvgl.h"})) |
||||
end) |
Loading…
Reference in new issue