add libxkbcommon and libgcrypt (#184)

* update eigen

* add libxkbcommon

* add libgcrypt
pull/186/head
Hoildkv 4 years ago committed by GitHub
parent 19119cafb7
commit e934030a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/e/eigen/xmake.lua
  2. 26
      packages/l/libgcrypt/xmake.lua
  3. 24
      packages/l/libgpg-error/xmake.lua
  4. 42
      packages/l/libxkbcommon/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)

@ -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)

@ -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)

@ -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)
Loading…
Cancel
Save