11package (" arrow" )
2+ -- For how to enable various features and build PyArrow python packages,
3+ -- refer to this discussion https://github.com/xmake-io/xmake-repo/discussions/1106
24
35 set_homepage (" https://arrow.apache.org/" )
46 set_description (" Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing" )
@@ -8,22 +10,26 @@ package("arrow")
810 " https://github.com/apache/arrow.git" )
911 add_versions (' 7.0.0' , ' 57e13c62f27b710e1de54fd30faed612aefa22aa41fa2c0c3bacd204dd18a8f3' )
1012
11- add_configs (csv , {description = " CSV reader module" , default = true , type = " boolean" })
12- add_configs (json , {description = " JSON reader module" , default = false , type = " boolean" })
13- add_configs (engine , {description = " Build the Arrow Execution Engine" , default = true , type = " boolean" })
14- add_configs (dataset , {description = " Dataset API, implies the Filesystem API" , default = true , type = " boolean" })
15- add_configs (orc , {description = " Arrow integration with Apache ORC" , default = false , type = " boolean" })
16- add_configs (parquet , {description = " Apache Parquet libraries and Arrow integration" , default = false , type = " boolean" })
17- add_configs (python , {description = " Enable Python C++ integration library. Requires python and numpy (not managed by xrepo)." , default = false , type = " boolean" })
13+ add_configs (" csv" , {description = " CSV reader module" , default = true , type = " boolean" })
14+ add_configs (" json" , {description = " JSON reader module" , default = false , type = " boolean" })
15+ add_configs (" engine" , {description = " Build the Arrow Execution Engine" , default = true , type = " boolean" })
16+ add_configs (" dataset" , {description = " Dataset API, implies the Filesystem API" , default = true , type = " boolean" })
17+ add_configs (" orc" , {description = " Arrow integration with Apache ORC" , default = false , type = " boolean" })
18+ add_configs (" parquet" , {description = " Apache Parquet libraries and Arrow integration" , default = false , type = " boolean" })
19+ add_configs (" plasma" , {description = " Plasma Shared Memory Object Store" , default = false , type = " boolean" })
20+ add_configs (" python" , {description = " Enable Python C++ integration library. Requires python and numpy (not managed by xmake/xrepo)." , default = false , type = " boolean" })
1821 -- Arrow uses vendored mimalloc and jemalloc. Do not add these two libraries to configdeps.
19- add_configs (mimalloc , {description = " Build the Arrow mimalloc-based allocator" , default = true , type = " boolean" })
20- add_configs (jemalloc , {description = " Build the Arrow jemalloc-based allocator" , default = false , type = " boolean" })
22+ add_configs (" mimalloc" , {description = " Build the Arrow mimalloc-based allocator" , default = true , type = " boolean" })
23+ add_configs (" jemalloc" , {description = " Build the Arrow jemalloc-based allocator" , default = false , type = " boolean" })
24+ -- If true, arrow will look for shared libraries for third party dependency.
25+ -- The pyarrow python package creates shared library that links in all necessary thirdparty static libraries.
26+ add_configs (" shared_dep" , {description = " Use shared library for dependency" , default = false , type = " boolean" })
2127
2228 -- Some libraries are required for build with our default config settings.
2329 local configdeps = {
2430 re2 = " re2" , utf8proc = " utf8proc" ,
2531 -- compression libraries
26- brotli = " brotli" , bz2 = " bz2 " , snappy = " snappy" , lz4 = " lz4" , zlib = " zlib" , zstd = " std " ,
32+ brotli = " brotli" , bz2 = " bzip2 " , snappy = " snappy" , lz4 = " lz4" , zlib = " zlib" , zstd = " zstd " ,
2733 }
2834 for config , dep in pairs (configdeps ) do
2935 add_configs (config , {description = " Enable " .. dep .. " support." , default = false , type = " boolean" })
@@ -38,6 +44,18 @@ package("arrow")
3844 end
3945
4046 on_load (function (package )
47+ if package :config (" plasma" ) then
48+ package :add (" links" , " plasma" )
49+ package :add (" deps" , " gflags" )
50+ end
51+ if package :config (" parquet" ) then
52+ package :add (" links" , " parquet" )
53+ end
54+ if package :config (" dataset" ) then
55+ package :add (" links" , " arrow_dataset" )
56+ end
57+ package :add (" links" , " arrow" , " arrow_bundled_dependencies" )
58+
4159 for name , dep in pairs (configdeps ) do
4260 if package :config (name ) then
4361 package :add (" deps" , dep )
@@ -58,15 +76,6 @@ package("arrow")
5876 package :add (" deps" , " zstd" )
5977 end
6078 if package :config (" parquet" ) then
61- cprint ([[
62- ${yellow}In case of boost dependency conflicts, please use following code (order is important):
63-
64- local boost_config = {configs = {system = true}} -- change this according to what your need
65- add_requires("thrift")
66- add_requireconfs("thrift.boost", boost_config)
67- add_requires("arrow", {configs = {parquet = true}})
68- add_requireconfs("arrow.boost", boost_config)
69- ]] )
7079 package :add (" deps" , " thrift" , configs )
7180 end
7281 end )
@@ -82,7 +91,7 @@ ${yellow}In case of boost dependency conflicts, please use following code (order
8291 local shared = package :config (" shared" )
8392 table.insert (configs , " -DARROW_BUILD_STATIC=" .. (shared and " OFF" or " ON" ))
8493 table.insert (configs , " -DARROW_BUILD_SHARED=" .. (shared and " ON" or " OFF" ))
85- table.insert (configs , " -DARROW_DEPENDENCY_USE_SHARED=" .. (shared and " ON" or " OFF" ))
94+ table.insert (configs , " -DARROW_DEPENDENCY_USE_SHARED=" .. (package : config ( " shared_dep " ) and " ON" or " OFF" ))
8695
8796 for config , enabled in pairs (package :configs ()) do
8897 if not package :extraconf (" configs" , config , " builtin" ) and configdeps [config ] == nil then
0 commit comments