Merge pull request #1105 from cyfdecyf/arrow

arrow: various improvements and fixes.
pull/1110/head
ruki 3 years ago committed by GitHub
commit 11505be43c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      packages/a/arrow/xmake.lua

@ -1,4 +1,6 @@
package("arrow")
-- For how to enable various features and build PyArrow python packages,
-- refer to this discussion https://github.com/xmake-io/xmake-repo/discussions/1106
set_homepage("https://arrow.apache.org/")
set_description("Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing")
@ -8,22 +10,26 @@ package("arrow")
"https://github.com/apache/arrow.git")
add_versions('7.0.0', '57e13c62f27b710e1de54fd30faed612aefa22aa41fa2c0c3bacd204dd18a8f3')
add_configs(csv, {description = "CSV reader module", default = true, type = "boolean"})
add_configs(json, {description = "JSON reader module", default = false, type = "boolean"})
add_configs(engine, {description = "Build the Arrow Execution Engine", default = true, type = "boolean"})
add_configs(dataset, {description = "Dataset API, implies the Filesystem API", default = true, type = "boolean"})
add_configs(orc, {description = "Arrow integration with Apache ORC", default = false, type = "boolean"})
add_configs(parquet, {description = "Apache Parquet libraries and Arrow integration", default = false, type = "boolean"})
add_configs(python, {description = "Enable Python C++ integration library. Requires python and numpy (not managed by xrepo).", default = false, type = "boolean"})
add_configs("csv", {description = "CSV reader module", default = true, type = "boolean"})
add_configs("json", {description = "JSON reader module", default = false, type = "boolean"})
add_configs("engine", {description = "Build the Arrow Execution Engine", default = true, type = "boolean"})
add_configs("dataset", {description = "Dataset API, implies the Filesystem API", default = true, type = "boolean"})
add_configs("orc", {description = "Arrow integration with Apache ORC", default = false, type = "boolean"})
add_configs("parquet", {description = "Apache Parquet libraries and Arrow integration", default = false, type = "boolean"})
add_configs("plasma", {description = "Plasma Shared Memory Object Store", default = false, type = "boolean"})
add_configs("python", {description = "Enable Python C++ integration library. Requires python and numpy (not managed by xmake/xrepo).", default = false, type = "boolean"})
-- Arrow uses vendored mimalloc and jemalloc. Do not add these two libraries to configdeps.
add_configs(mimalloc, {description = "Build the Arrow mimalloc-based allocator", default = true, type = "boolean"})
add_configs(jemalloc, {description = "Build the Arrow jemalloc-based allocator", default = false, type = "boolean"})
add_configs("mimalloc", {description = "Build the Arrow mimalloc-based allocator", default = true, type = "boolean"})
add_configs("jemalloc", {description = "Build the Arrow jemalloc-based allocator", default = false, type = "boolean"})
-- If true, arrow will look for shared libraries for third party dependency.
-- The pyarrow python package creates shared library that links in all necessary thirdparty static libraries.
add_configs("shared_dep", {description = "Use shared library for dependency", default = false, type = "boolean"})
-- Some libraries are required for build with our default config settings.
local configdeps = {
re2 = "re2", utf8proc = "utf8proc",
-- compression libraries
brotli = "brotli", bz2 = "bz2", snappy = "snappy", lz4 = "lz4", zlib = "zlib", zstd = "std",
brotli = "brotli", bz2 = "bzip2", snappy = "snappy", lz4 = "lz4", zlib = "zlib", zstd = "zstd",
}
for config, dep in pairs(configdeps) do
add_configs(config, {description = "Enable " .. dep .. " support.", default = false, type = "boolean"})
@ -38,6 +44,18 @@ package("arrow")
end
on_load(function (package)
if package:config("plasma") then
package:add("links", "plasma")
package:add("deps", "gflags")
end
if package:config("parquet") then
package:add("links", "parquet")
end
if package:config("dataset") then
package:add("links", "arrow_dataset")
end
package:add("links", "arrow", "arrow_bundled_dependencies")
for name, dep in pairs(configdeps) do
if package:config(name) then
package:add("deps", dep)
@ -58,15 +76,6 @@ package("arrow")
package:add("deps", "zstd")
end
if package:config("parquet") then
cprint([[
${yellow}In case of boost dependency conflicts, please use following code (order is important):
local boost_config = {configs = {system = true}} -- change this according to what your need
add_requires("thrift")
add_requireconfs("thrift.boost", boost_config)
add_requires("arrow", {configs = {parquet = true}})
add_requireconfs("arrow.boost", boost_config)
]])
package:add("deps", "thrift", configs)
end
end)
@ -82,7 +91,7 @@ ${yellow}In case of boost dependency conflicts, please use following code (order
local shared = package:config("shared")
table.insert(configs, "-DARROW_BUILD_STATIC=" .. (shared and "OFF" or "ON"))
table.insert(configs, "-DARROW_BUILD_SHARED=" .. (shared and "ON" or "OFF"))
table.insert(configs, "-DARROW_DEPENDENCY_USE_SHARED=" .. (shared and "ON" or "OFF"))
table.insert(configs, "-DARROW_DEPENDENCY_USE_SHARED=" .. (package:config("shared_dep") and "ON" or "OFF"))
for config, enabled in pairs(package:configs()) do
if not package:extraconf("configs", config, "builtin") and configdeps[config] == nil then

Loading…
Cancel
Save