From e934030a0bc530f992b15b0827e47ea4095bbda2 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Wed, 2 Dec 2020 12:03:37 +0800 Subject: [PATCH] add libxkbcommon and libgcrypt (#184) * update eigen * add libxkbcommon * add libgcrypt --- packages/e/eigen/xmake.lua | 1 + packages/l/libgcrypt/xmake.lua | 26 +++++++++++++++++++ packages/l/libgpg-error/xmake.lua | 24 ++++++++++++++++++ packages/l/libxkbcommon/xmake.lua | 42 +++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 packages/l/libgcrypt/xmake.lua create mode 100644 packages/l/libgpg-error/xmake.lua create mode 100644 packages/l/libxkbcommon/xmake.lua diff --git a/packages/e/eigen/xmake.lua b/packages/e/eigen/xmake.lua index f5cebcff0..040a517d0 100644 --- a/packages/e/eigen/xmake.lua +++ b/packages/e/eigen/xmake.lua @@ -9,6 +9,7 @@ package("eigen") add_versions("3.3.7", "685adf14bd8e9c015b78097c1dc22f2f01343756f196acdc76a678e1ae352e11") add_deps("cmake") + add_includedirs("include") add_includedirs("include/eigen3") on_install("macosx", "linux", "windows", function (package) diff --git a/packages/l/libgcrypt/xmake.lua b/packages/l/libgcrypt/xmake.lua new file mode 100644 index 000000000..d791b146c --- /dev/null +++ b/packages/l/libgcrypt/xmake.lua @@ -0,0 +1,26 @@ +package("libgcrypt") + + set_homepage("https://www.gnupg.org/related_software/libgcrypt/") + set_description("Libgcrypt is a general purpose cryptographic library originally based on code from GnuPG.") + set_license("GPL-2.0") + + add_urls("https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-$(version).tar.gz") + add_versions("1.8.7", "55d98db5e5c7e7bb1efabe1299040d501e5d55272e10f60b68de9f9118b53102") + + add_deps("libgpg-error", "libxml2") + on_install("linux", function (package) + local configs = {"--disable-doc", "--with-pic"} + if package:config("shared") then + table.insert(configs, "--enable-shared=yes") + table.insert(configs, "--enable-static=no") + else + table.insert(configs, "--enable-static=yes") + table.insert(configs, "--enable-shared=no") + end + table.insert(configs, "--with-libgpg-error-prefix=" .. package:dep("libgpg-error"):installdir()) + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("gcry_check_version", {includes = "gcrypt.h"})) + end) diff --git a/packages/l/libgpg-error/xmake.lua b/packages/l/libgpg-error/xmake.lua new file mode 100644 index 000000000..91705d280 --- /dev/null +++ b/packages/l/libgpg-error/xmake.lua @@ -0,0 +1,24 @@ +package("libgpg-error") + + set_homepage("https://www.gnupg.org/related_software/libgpg-error/") + set_description("Libgpg-error is a small library that originally defined common error values for all GnuPG components.") + set_license("GPL-2.0") + + add_urls("https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$(version).tar.gz") + add_versions("1.39", "3d4dc56588d62ff01067af192e2d3de38ef4c060857ed8da77327365477569ca") + + on_install("linux", function (package) + local configs = {"--disable-doc", "--disable-tests", "--with-pic"} + if package:config("shared") then + table.insert(configs, "--enable-shared=yes") + table.insert(configs, "--enable-static=no") + else + table.insert(configs, "--enable-static=yes") + table.insert(configs, "--enable-shared=no") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("gpgrt_strdup", {includes = "gpgrt.h"})) + end) diff --git a/packages/l/libxkbcommon/xmake.lua b/packages/l/libxkbcommon/xmake.lua new file mode 100644 index 000000000..49054399b --- /dev/null +++ b/packages/l/libxkbcommon/xmake.lua @@ -0,0 +1,42 @@ +package("libxkbcommon") + + set_homepage("https://xkbcommon.org/") + set_description("keymap handling library for toolkits and window systems") + set_license("MIT") + + add_urls("https://github.com/xkbcommon/libxkbcommon/archive/xkbcommon-$(version).tar.gz", + "https://github.com/xkbcommon.git") + add_versions("1.0.3", "5d10a57ab65daad7d975926166770eca1d2c899131ab96c23845df1c42da5c31") + + add_configs("x11", {description = "Switch backend to X11 (default is wayland).", default = false, type = "boolean"}) + on_load("linux", function (package) + if package:config("x11") then + package:add("deps", "libxcb", "xcb-proto", "libxml2") + else + package:add("deps", "wayland") + end + end) + + add_deps("meson") + on_install("linux", function (package) + package:addenv("PATH", "bin") + + -- add links + local arch = package:is_arch("x86_64", "x64") and "x86_64" or "x86" + package:add("linkdirs", path.join("lib", arch .. "-linux-gnu")) + package:add("links", "xkbregistry", "xkbcommon") + os.mv(package:installdir("lib", arch .. "-linux-gnu", "pkgconfig"), package:installdir("lib")) + + -- build + local configs = {"-Denable-docs=false", "-Dc_link_args=-lm"} + if package:config("x11") then + table.join2(configs, {"-Denable-wayland=false", "-Dxkb-config-root=/usr/share/X11/xkb", "-Dx-locale-root=/usr/share/X11/locale"}) + else + table.join2(configs, {"-Denable-x11=false", "-Dxkb-config-root=/usr/share/X11/xkb", "-Dx-locale-root=/usr/share/X11/locale"}) + end + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("xkb_context_new", {includes = "xkbcommon/xkbcommon.h"})) + end)