@@ -8,22 +8,34 @@ package("arrow")
88 " https://github.com/apache/arrow.git" )
99 add_versions (' 7.0.0' , ' 57e13c62f27b710e1de54fd30faed612aefa22aa41fa2c0c3bacd204dd18a8f3' )
1010
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" })
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 (" plasma" , {description = " Plasma Shared Memory Object Store" , default = false , type = " boolean" })
18+ -- After install with python enabled, the pyarrow package can be built by following command:
19+ -- cd <arrow-src>/arrow/python
20+ -- export CMAKE_PREFIX_PATH=<xrepo arrow install dir>
21+ -- # export options that's enabled for the c++ install, e.g.
22+ -- export PYARROW_WITH_PARQUET=1
23+ -- export PYARROW_WITH_LZ4=1
24+ -- python setup.py -- build_ext --build-type=release --bundle-arrow-cpp bdist_wheel
25+ -- Refer to https://arrow.apache.org/docs/developers/python.html#python-development
26+ add_configs (" python" , {description = " Enable Python C++ integration library. Requires python and numpy (not managed by xmake/xrepo)." , default = false , type = " boolean" })
1827 -- 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" })
28+ add_configs (" mimalloc" , {description = " Build the Arrow mimalloc-based allocator" , default = true , type = " boolean" })
29+ add_configs (" jemalloc" , {description = " Build the Arrow jemalloc-based allocator" , default = false , type = " boolean" })
30+ -- If true, arrow will look for shared libraries for third party dependency.
31+ -- The pyarrow python package creates shared library that links in all necessary thirdparty static libraries.
32+ add_configs (" shared_dep" , {description = " Use shared library for dependency" , default = false , type = " boolean" })
2133
2234 -- Some libraries are required for build with our default config settings.
2335 local configdeps = {
2436 re2 = " re2" , utf8proc = " utf8proc" ,
2537 -- compression libraries
26- brotli = " brotli" , bz2 = " bz2 " , snappy = " snappy" , lz4 = " lz4" , zlib = " zlib" , zstd = " std " ,
38+ brotli = " brotli" , bz2 = " bzip2 " , snappy = " snappy" , lz4 = " lz4" , zlib = " zlib" , zstd = " zstd " ,
2739 }
2840 for config , dep in pairs (configdeps ) do
2941 add_configs (config , {description = " Enable " .. dep .. " support." , default = false , type = " boolean" })
@@ -38,6 +50,21 @@ package("arrow")
3850 end
3951
4052 on_load (function (package )
53+ local links = {}
54+ if package :config (" plasma" ) then
55+ table.insert (links , " plasma" )
56+ package :add (" deps" , " gflags" )
57+ end
58+ if package :config (" parquet" ) then
59+ table.insert (links , " parquet" )
60+ end
61+ if package :config (" dataset" ) then
62+ table.insert (links , " arrow_dataset" )
63+ end
64+ table.insert (links , " arrow" )
65+ table.insert (links , " arrow_bundled_dependencies" )
66+ package :add (" links" , links )
67+
4168 for name , dep in pairs (configdeps ) do
4269 if package :config (name ) then
4370 package :add (" deps" , dep )
@@ -82,7 +109,7 @@ ${yellow}In case of boost dependency conflicts, please use following code (order
82109 local shared = package :config (" shared" )
83110 table.insert (configs , " -DARROW_BUILD_STATIC=" .. (shared and " OFF" or " ON" ))
84111 table.insert (configs , " -DARROW_BUILD_SHARED=" .. (shared and " ON" or " OFF" ))
85- table.insert (configs , " -DARROW_DEPENDENCY_USE_SHARED=" .. (shared and " ON" or " OFF" ))
112+ table.insert (configs , " -DARROW_DEPENDENCY_USE_SHARED=" .. (package : config ( " shared_dep " ) and " ON" or " OFF" ))
86113
87114 for config , enabled in pairs (package :configs ()) do
88115 if not package :extraconf (" configs" , config , " builtin" ) and configdeps [config ] == nil then
@@ -97,6 +124,15 @@ ${yellow}In case of boost dependency conflicts, please use following code (order
97124 -- To fix arrow src/arrow/CMakeLists.txt:538, when CMAKE_SYSTEM_NAME set but CMAKE_SYSTEM_PROCESSOR is not causing error.
98125 table.insert (configs , " -DCMAKE_SYSTEM_PROCESSOR=" .. (package :is_arch (" x86_64" ) and " x86_64" or " x86" ))
99126
127+ -- For install without internet access, uncommend following code and
128+ -- change the url to internal accessible one.
129+ --[[
130+ if package:version():eq("7.0.0") then
131+ -- Use environment variables to define vendored package url.
132+ os.setenv("ARROW_MIMALLOC_URL", "https://github.com/microsoft/mimalloc/archive/v1.7.3.tar.gz")
133+ os.setenv("ARROW_XSIMD_URL", "https://github.com/xtensor-stack/xsimd/archive/aeec9c872c8b475dedd7781336710f2dd2666cb2.tar.gz")
134+ end
135+ --]]
100136 os .cd (" cpp" )
101137 import (" package.tools.cmake" ).install (package , configs )
102138 end )
0 commit comments