|
1 | 1 | #!/bin/bash |
2 | 2 | set -euo pipefail |
3 | 3 |
|
| 4 | +apt install -y sudo lsb-release wget |
| 5 | + |
4 | 6 | here=$(dirname "${BASH_SOURCE[0]}") |
5 | 7 | here=$(readlink -f "$here") |
6 | | -prebuilt="$here"/build/linux/prebuilt |
7 | 8 | ubuntu="$(lsb_release -s -r)" |
8 | | -libs=(libarrow.a libboost_filesystem.a libboost_regex.a libboost_system.a libbrotlicommon.a libbrotlidec.a \ |
9 | | - libbrotlienc.a libicudata.a libicui18n.a libicuuc.a liblz4.a libparquet.a libsnappy.a libthrift.a libzstd.a) |
10 | | -lib_locs=() |
11 | 9 |
|
12 | 10 | setup_directories() { |
13 | 11 | cd "$here" |
14 | 12 | mkdir -p build/linux |
15 | | - mkdir -p "$prebuilt" |
16 | 13 | cp -f build/Makefile.linux build/linux/Makefile |
17 | 14 | cd build/linux |
18 | 15 | } |
19 | 16 |
|
20 | 17 | install_prerequisites() { |
| 18 | + # install Apache Arrow libs |
| 19 | + # NOTE: Pinned to Ubuntu Focal |
| 20 | + wget https://apache.bintray.com/arrow/ubuntu/apache-arrow-archive-keyring-latest-focal.deb |
| 21 | + sudo apt install -y -V ./apache-arrow-archive-keyring-latest-focal.deb |
| 22 | + sudo apt update -y |
| 23 | + sudo apt install -y -V libparquet-dev liblz4-dev libzstd-dev libthrift-dev \ |
| 24 | + libsnappy-dev libthrift-dev libbrotli-dev libz-dev |
| 25 | + |
21 | 26 | # Install prereqs based on https://github.com/apache/parquet-cpp#linux |
22 | | - sudo apt-get install libboost-dev g++ libboost-filesystem-dev \ |
| 27 | + sudo apt install -y libboost-dev g++ libboost-filesystem-dev \ |
23 | 28 | libboost-program-options-dev libboost-regex-dev \ |
24 | 29 | libboost-system-dev libboost-test-dev \ |
25 | 30 | libssl-dev libtool bison flex pkg-config libreadline-dev libncurses-dev |
26 | 31 |
|
27 | 32 | # Install prereqs based on https://github.com/apache/arrow/tree/master/cpp |
28 | | - sudo apt-get install cmake \ |
| 33 | + sudo apt install -y cmake \ |
29 | 34 | libboost-dev \ |
30 | 35 | libboost-filesystem-dev \ |
31 | 36 | libboost-system-dev |
@@ -59,47 +64,11 @@ set_icu_version() { |
59 | 64 | export ICU_VERSION_U=${ICU_VERSION//-/_} |
60 | 65 | } |
61 | 66 |
|
62 | | -add_prebuilt_lib() { |
63 | | - lib_locs+=("$1=$prebuilt/$2.a") |
64 | | -} |
65 | | - |
66 | | -fetch_prebuilt_libs() { |
67 | | - if [ ! -e "$prebuilt"/complete ]; then |
68 | | - ( |
69 | | - cd "$prebuilt" |
70 | | - curl "https://s3.amazonaws.com/cldellow/public/libparquet/$ubuntu/libs.tar.xz" > libs.tar.xz |
71 | | - tar xf libs.tar.xz --xform 's#.*/##' |
72 | | - touch "$prebuilt"/complete |
73 | | - ) |
74 | | - fi |
75 | | - |
76 | | - if [ ! -e "$here"/sqlite/sqlite3 ]; then |
77 | | - ln -s "$prebuilt"/sqlite3 "$here"/sqlite/sqlite3 |
78 | | - fi |
79 | | - |
80 | | - add_prebuilt_lib "PARQUET_CPP_LIB" libparquet |
81 | | - add_prebuilt_lib "LZ4_LIB" liblz4 |
82 | | - add_prebuilt_lib "ZSTD_LIB" libzstd |
83 | | - add_prebuilt_lib "THRIFT_LIB" libthrift |
84 | | - add_prebuilt_lib "SNAPPY_LIB" libsnappy |
85 | | - add_prebuilt_lib "ARROW_LIB" libarrow |
86 | | - add_prebuilt_lib "ICU_I18N_LIB" libicui18n |
87 | | - add_prebuilt_lib "ICU_UC_LIB" libicuuc |
88 | | - add_prebuilt_lib "ICU_DATA_LIB" libicudata |
89 | | - add_prebuilt_lib "BROTLI_ENC_LIB" libbrotlienc |
90 | | - add_prebuilt_lib "BROTLI_COMMON_LIB" libbrotlicommon |
91 | | - add_prebuilt_lib "BROTLI_DEC_LIB" libbrotlidec |
92 | | - add_prebuilt_lib "BOOST_REGEX_LIB" libboost_regex |
93 | | - add_prebuilt_lib "BOOST_SYSTEM_LIB" libboost_system |
94 | | - add_prebuilt_lib "BOOST_FILESYSTEM_LIB" libboost_filesystem |
95 | | - |
96 | | -} |
97 | | - |
98 | 67 | main() { |
| 68 | + set_icu_version |
99 | 69 | setup_directories |
100 | 70 | install_prerequisites |
101 | 71 | build_sqlite |
102 | | - set_icu_version |
103 | 72 |
|
104 | 73 | if [ -v PREBUILT ]; then |
105 | 74 | fetch_prebuilt_libs |
|
0 commit comments