File: conan_build.sh

package info (click to toggle)
apache-arrow 23.0.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 76,220 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,365; makefile: 669; javascript: 125; xml: 41
file content (84 lines) | stat: -rwxr-xr-x 3,252 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

set -eux

source_dir=${1}
shift
build_dir=${1}
shift

export ARROW_HOME=${source_dir}

conan_args=()
conan_args+=(--build=missing)
if [ -n "${ARROW_CONAN_PARQUET:-}" ]; then
  conan_args+=(--options "arrow/*:parquet=${ARROW_CONAN_PARQUET}")
  conan_args+=(--options "arrow/*:with_boost=${ARROW_CONAN_PARQUET}")
  conan_args+=(--options "arrow/*:with_json=${ARROW_CONAN_PARQUET}")
  conan_args+=(--options "arrow/*:with_thrift=${ARROW_CONAN_PARQUET}")
else
  conan_args+=(--options "arrow/*:parquet=False")
fi
if [ -n "${ARROW_CONAN_WITH_BROTLI:-}" ]; then
  conan_args+=(--options "arrow/*:with_brotli=${ARROW_CONAN_WITH_BROTLI}")
fi
if [ -n "${ARROW_CONAN_WITH_BZ2:-}" ]; then
  conan_args+=(--options "arrow/*:with_bz2=${ARROW_CONAN_WITH_BZ2}")
fi
if [ -n "${ARROW_CONAN_WITH_FLIGHT_RPC:-}" ]; then
  conan_args+=(--options "arrow/*:with_flight_rpc=${ARROW_CONAN_WITH_FLIGHT_RPC}")
  conan_args+=(--options "arrow/*:with_grpc=${ARROW_CONAN_WITH_FLIGHT_RPC}")
  conan_args+=(--options "arrow/*:with_protobuf=${ARROW_CONAN_WITH_FLIGHT_RPC}")
  conan_args+=(--options "arrow/*:with_re2=${ARROW_CONAN_WITH_FLIGHT_RPC}")
fi
if [ -n "${ARROW_CONAN_WITH_GLOG:-}" ]; then
  conan_args+=(--options "arrow/*:with_glog=${ARROW_CONAN_WITH_GLOG}")
fi
if [ -n "${ARROW_CONAN_WITH_JEMALLOC:-}" ]; then
  conan_args+=(--options "arrow/*:with_jemalloc=${ARROW_CONAN_WITH_JEMALLOC}")
fi
if [ -n "${ARROW_CONAN_WITH_JSON:-}" ]; then
  conan_args+=(--options "arrow/*:with_json=${ARROW_CONAN_WITH_JSON}")
fi
if [ -n "${ARROW_CONAN_WITH_LZ4:-}" ]; then
  conan_args+=(--options "arrow/*:with_lz4=${ARROW_CONAN_WITH_LZ4}")
fi
if [ -n "${ARROW_CONAN_WITH_SNAPPY:-}" ]; then
  conan_args+=(--options "arrow/*:with_snappy=${ARROW_CONAN_WITH_SNAPPY}")
fi
if [ -n "${ARROW_CONAN_WITH_ZSTD:-}" ]; then
  conan_args+=(--options "arrow/*:with_zstd=${ARROW_CONAN_WITH_ZSTD}")
fi

version=$(grep '^set(ARROW_VERSION ' "${ARROW_HOME}/cpp/CMakeLists.txt" | \
            grep -E -o '([0-9.]*)')
conan_args+=(--version "${version}")

rm -rf ~/.conan/data/arrow/
rm -rf "${build_dir}/conan" || sudo rm -rf "${build_dir}/conan"
mkdir -p "${build_dir}/conan" || sudo mkdir -p "${build_dir}/conan"
if [ -w "${build_dir}" ]; then
  cp -a "${source_dir}"/ci/conan/* "${build_dir}/conan/"
else
  sudo cp -a "${source_dir}"/ci/conan/* "${build_dir}/conan/"
  sudo chown -R "$(id -u):$(id -g)" "${build_dir}/conan/"
fi
cd "${build_dir}/conan/all"
conan create . "${conan_args[@]}" "$@"