add mxml, talloc and libdeflate (#687)
* add mxml * update blosc * add talloc * add libdeflatepull/689/head
parent
d1d9496b35
commit
46207e5905
4 changed files with 104 additions and 1 deletions
@ -0,0 +1,41 @@ |
||||
package("libdeflate") |
||||
|
||||
set_homepage("https://github.com/ebiggers/libdeflate") |
||||
set_description("libdeflate is a library for fast, whole-buffer DEFLATE-based compression and decompression.") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/ebiggers/libdeflate/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/ebiggers/libdeflate.git") |
||||
add_versions("v1.8", "50711ad4e9d3862f8dfb11b97eb53631a86ee3ce49c0e68ec2b6d059a9662f61") |
||||
|
||||
on_load("windows", function (package) |
||||
if package:config("shared") then |
||||
package:add("defines", "LIBDEFLATE_DLL") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "macosx", "linux", "android", "mingw", function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
target("deflate") |
||||
set_kind("$(kind)") |
||||
add_files("lib/*.c") |
||||
if is_arch("x86", "i386", "x86_64", "x64") then |
||||
add_files("lib/x86/*.c") |
||||
elseif is_arch("arm.+") then |
||||
add_files("lib/arm/*.c") |
||||
else |
||||
os.raise("unsupported architecture!") |
||||
end |
||||
add_includedirs(".") |
||||
add_headerfiles("libdeflate.h") |
||||
if is_plat("windows") and is_kind("shared") then |
||||
add_defines("LIBDEFLATE_DLL", "BUILDING_LIBDEFLATE") |
||||
end |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("libdeflate_alloc_compressor", {includes = "libdeflate.h"})) |
||||
end) |
@ -0,0 +1,44 @@ |
||||
package("mxml") |
||||
|
||||
set_homepage("https://www.msweet.org/mxml/") |
||||
set_description("Mini-XML is a tiny XML library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries.") |
||||
set_license("Apache-2.0") |
||||
|
||||
add_urls("https://github.com/michaelrsweet/mxml/releases/download/v3.3/mxml-3.3.zip") |
||||
add_versions("3.3", "fca59b0d7fae2b9165c223cdce68e45dbf41e21e5e53190d8b214218b8353380") |
||||
|
||||
if is_plat("macosx", "linux") then |
||||
add_syslinks("pthread") |
||||
end |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
io.gsub("config.h.in", "#undef (.-)\n", "${define %1}\n") |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
includes("check_cfuncs.lua") |
||||
includes("check_ctypes.lua") |
||||
if is_plat("macosx", "linux") then |
||||
set_configvar("HAVE_PTHREAD_H", 1) |
||||
end |
||||
configvar_check_ctypes("HAVE_LONG_LONG_INT", "long long int") |
||||
configvar_check_cfuncs("HAVE_SNPRINTF", "snprintf", {includes = "stdio.h"}) |
||||
configvar_check_cfuncs("HAVE_VASPRINTF", "vasprintf", {includes = "stdio.h", defines = "_GNU_SOURCE"}) |
||||
configvar_check_cfuncs("HAVE_VSNPRINTF", "vsnprintf", {includes = "stdio.h"}) |
||||
configvar_check_cfuncs("HAVE_STRDUP", "strdup", {includes = "string.h"}) |
||||
configvar_check_cfuncs("HAVE_STRLCAT", "strlcat", {includes = "string.h"}) |
||||
configvar_check_cfuncs("HAVE_STRLCPY", "strlcpy", {includes = "string.h"}) |
||||
target("mxml") |
||||
set_kind("$(kind)") |
||||
add_files("mxml-*.c") |
||||
add_configfiles("config.h.in") |
||||
add_includedirs("$(buildir)") |
||||
add_headerfiles("mxml.h") |
||||
if is_plat("macosx", "linux") then |
||||
add_syslinks("pthread") |
||||
end |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("mxmlLoadFile", {includes = "mxml.h"})) |
||||
end) |
@ -0,0 +1,18 @@ |
||||
package("talloc") |
||||
|
||||
set_homepage("https://talloc.samba.org/talloc/doc/html/index.html") |
||||
set_description("talloc is a hierarchical, reference counted memory pool system with destructors.") |
||||
|
||||
add_urls("https://www.samba.org/ftp/talloc/talloc-$(version).tar.gz") |
||||
add_versions("2.3.3", "6be95b2368bd0af1c4cd7a88146eb6ceea18e46c3ffc9330bf6262b40d1d8aaa") |
||||
|
||||
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) |
||||
|
||||
add_deps("python 3.x", {kind = "binary"}) |
||||
on_install("macosx", "linux", function (package) |
||||
import("package.tools.autoconf").install(package, {"--disable-python"}) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("talloc_init", {includes = "talloc.h"})) |
||||
end) |
Loading…
Reference in new issue