package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.1 KiB

package("libgpiod")
set_homepage("https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/")
set_description("libgpiod - C library and tools for interacting with the linux GPIO character device (gpiod stands for GPIO device)")
add_urls("https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-$(version).tar.gz",
"https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
add_versions("v2.0.1", "cf0d4db1d94cc99281de142063d0e28f42760c4d918d6b8854e1b27811517c34")
add_versions("v2.0", "a0f835c4ca4a2a3ca021090b574235ba58bb9fd612d8a6051fb1350054e04fdd")
add_versions("v1.6.4", "9f920260c46b155f65cba8796dcf159e4ba56950b85742af357d75a1af709e68")
libgpiod: rework & fix C++ bindings (#2989) * libgpiod: update test code * libgpiod: create port file * libgpiod: fix add_headerfiles * libgpiod: add version defines * libgpiod: print version * libgpiod: fix version matching * libgpiod: separate tools & fix program_invocation_name & version * libgpiod: create on_load * libgpiod: use before_build * libgpiod: use add_defines * libgpiod: use target:add * libgpiod: add tools-common files * libgpiod: ignore tools-common on its own * libgpiod: add quotations around define program_invocation_name * libgpiod: add configvar_check_csnippets * libgpiod: make program_invocation_short_name same as program_invocation_name * libgpiod: add quotations around GPIOD_VERSION_STR * libgpiod: only get direct cxx files in bindings/cxx * libgpiod: separate c and cxx bindings * libgpiod: add options * libgpiod: on_test use config * libgpiod: test older version * libgpiod: make `%[` & `%]` optional * libgpiod: update test * libgpiod: fix cxx test * libgpiod: dont delete chip ptr * libgpiod: set kind * libgpiod: add patch for `v1.6.4` * libgpiod: fix patch hash * libgpiod: update patch * libgpiod: set_languages("c89") & move deps * libgpiod: use c99 * libgpiod: use C++11 * libgpiod: add io.replace * libgpiod: update patch * libgpiod: comment set_languages * libgpiod: move add_includedirs * libgpiod: set kind to shared if version under v1.6.4 * libgpiod: move includedirs * libgpiod: remove `delete` * libgpiod: add link * libgpiod: use same methods for other deps * libgpiod: remove libgpiod_cxx * libgpiod: use add_deps * libgpiod: add cxx17 * libgpiod: remove before_build * libgpiod: readd addenv PATH * libgpiod: test old version * libgpiod: undo * libgpiod: remove set config to shared for v1.6.4 static * libgpiod: add target gpiodcxx * libgpiod: remove duplicate before_build * libgpiod: readd versions * libgpiod: use c11 * libgpiod: use cxx11 * libgpiod: fix target name * libgpiod: fix add_deps * libgpiod: set target for tool's language to cxx11
12 months ago
add_configs("enable_bindings_cxx", {description = "Enable C++ bindings", default = true, type = "boolean"})
add_configs("enable_tools", {description = "Enable tools", default = true, type = "boolean"})
on_install("linux", function (package)
libgpiod: rework & fix C++ bindings (#2989) * libgpiod: update test code * libgpiod: create port file * libgpiod: fix add_headerfiles * libgpiod: add version defines * libgpiod: print version * libgpiod: fix version matching * libgpiod: separate tools & fix program_invocation_name & version * libgpiod: create on_load * libgpiod: use before_build * libgpiod: use add_defines * libgpiod: use target:add * libgpiod: add tools-common files * libgpiod: ignore tools-common on its own * libgpiod: add quotations around define program_invocation_name * libgpiod: add configvar_check_csnippets * libgpiod: make program_invocation_short_name same as program_invocation_name * libgpiod: add quotations around GPIOD_VERSION_STR * libgpiod: only get direct cxx files in bindings/cxx * libgpiod: separate c and cxx bindings * libgpiod: add options * libgpiod: on_test use config * libgpiod: test older version * libgpiod: make `%[` & `%]` optional * libgpiod: update test * libgpiod: fix cxx test * libgpiod: dont delete chip ptr * libgpiod: set kind * libgpiod: add patch for `v1.6.4` * libgpiod: fix patch hash * libgpiod: update patch * libgpiod: set_languages("c89") & move deps * libgpiod: use c99 * libgpiod: use C++11 * libgpiod: add io.replace * libgpiod: update patch * libgpiod: comment set_languages * libgpiod: move add_includedirs * libgpiod: set kind to shared if version under v1.6.4 * libgpiod: move includedirs * libgpiod: remove `delete` * libgpiod: add link * libgpiod: use same methods for other deps * libgpiod: remove libgpiod_cxx * libgpiod: use add_deps * libgpiod: add cxx17 * libgpiod: remove before_build * libgpiod: readd addenv PATH * libgpiod: test old version * libgpiod: undo * libgpiod: remove set config to shared for v1.6.4 static * libgpiod: add target gpiodcxx * libgpiod: remove duplicate before_build * libgpiod: readd versions * libgpiod: use c11 * libgpiod: use cxx11 * libgpiod: fix target name * libgpiod: fix add_deps * libgpiod: set target for tool's language to cxx11
12 months ago
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
local configs = {}
if package:config("enable_bindings_cxx") then
configs.enable_bindings_cxx = true
end
if package:config("enable_tools") then
configs.enable_tools = true
end
import("package.tools.xmake").install(package)
package:addenv("PATH", "bin")
end)
on_test(function (package)
libgpiod: rework & fix C++ bindings (#2989) * libgpiod: update test code * libgpiod: create port file * libgpiod: fix add_headerfiles * libgpiod: add version defines * libgpiod: print version * libgpiod: fix version matching * libgpiod: separate tools & fix program_invocation_name & version * libgpiod: create on_load * libgpiod: use before_build * libgpiod: use add_defines * libgpiod: use target:add * libgpiod: add tools-common files * libgpiod: ignore tools-common on its own * libgpiod: add quotations around define program_invocation_name * libgpiod: add configvar_check_csnippets * libgpiod: make program_invocation_short_name same as program_invocation_name * libgpiod: add quotations around GPIOD_VERSION_STR * libgpiod: only get direct cxx files in bindings/cxx * libgpiod: separate c and cxx bindings * libgpiod: add options * libgpiod: on_test use config * libgpiod: test older version * libgpiod: make `%[` & `%]` optional * libgpiod: update test * libgpiod: fix cxx test * libgpiod: dont delete chip ptr * libgpiod: set kind * libgpiod: add patch for `v1.6.4` * libgpiod: fix patch hash * libgpiod: update patch * libgpiod: set_languages("c89") & move deps * libgpiod: use c99 * libgpiod: use C++11 * libgpiod: add io.replace * libgpiod: update patch * libgpiod: comment set_languages * libgpiod: move add_includedirs * libgpiod: set kind to shared if version under v1.6.4 * libgpiod: move includedirs * libgpiod: remove `delete` * libgpiod: add link * libgpiod: use same methods for other deps * libgpiod: remove libgpiod_cxx * libgpiod: use add_deps * libgpiod: add cxx17 * libgpiod: remove before_build * libgpiod: readd addenv PATH * libgpiod: test old version * libgpiod: undo * libgpiod: remove set config to shared for v1.6.4 static * libgpiod: add target gpiodcxx * libgpiod: remove duplicate before_build * libgpiod: readd versions * libgpiod: use c11 * libgpiod: use cxx11 * libgpiod: fix target name * libgpiod: fix add_deps * libgpiod: set target for tool's language to cxx11
12 months ago
assert(package:check_cxxsnippets({test = [[
#include <gpiod.h>
void test() {
struct gpiod_chip *chip;
chip = gpiod_chip_open("/dev/null");
}
]]}, {configs = {languages = "c++11"}}))
if package:config("enable_bindings_cxx") then
assert(package:check_cxxsnippets({test = [[
#include <gpiod.hpp>
void test() {
gpiod::chip chip("/dev/null");
}
]]}, {configs = {languages = "c++17"}}))
end
if package:config("enable_tools") then
os.runv("gpiodetect")
end
end)