Repository navigation
Expand file tree
/
Copy pathPKGBUILD
More file actions
163 lines (147 loc) · 5.84 KB
/
Copy pathPKGBUILD
File metadata and controls
163 lines (147 loc) · 5.84 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# 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.
_realname=arrow
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=26.0.1.9000
pkgrel=8000
pkgdesc="Apache Arrow is a cross-language development platform for in-memory data (mingw-w64)"
arch=("any")
url="https://arrow.apache.org/"
license=("Apache-2.0")
depends=("${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-curl" # for google-cloud-cpp bundled build
"${MINGW_PACKAGE_PREFIX}-libutf8proc"
"${MINGW_PACKAGE_PREFIX}-re2"
"${MINGW_PACKAGE_PREFIX}-snappy"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-lz4"
"${MINGW_PACKAGE_PREFIX}-zstd")
makedepends=("${MINGW_PACKAGE_PREFIX}-ccache"
"${MINGW_PACKAGE_PREFIX}-gcc")
options=("staticlibs" "strip" "!buildflags")
# For installing from a local checkout, set source_dir to . and don't include
# a "source" param below
source_dir="$ARROW_HOME"
# else
# source_dir=apache-${_realname}-${pkgver}
# For released version:
#source=("https://archive.apache.org/dist/arrow/arrow-${pkgver}/apache-arrow-${pkgver}.tar.gz")
#sha256sums=("ac2a77dd9168e9892e432c474611e86ded0be6dfe15f689c948751d37f81391a")
# For github dev version:
# Append `#commit=54b1b2f688e5e84b4c664b1e12a95f93b94ab2f3` to the URL to select a revision
# source=("${source_dir}"::"git+https://github.com/apache/arrow")
# sha256sums=("SKIP")
cpp_build_dir=build-${CARCH}-cpp
pkgver() {
# The only purpose of this here is to cause the job to error if the
# version in pkgver is different from what is in r/DESCRIPTION
grep Version "${source_dir}/r/DESCRIPTION" | cut -d " " -f 2
}
build() {
ARROW_CPP_DIR="${source_dir}/cpp"
[[ -d ${cpp_build_dir} ]] && rm -rf ${cpp_build_dir}
mkdir -p ${cpp_build_dir}
pushd ${cpp_build_dir}
# We use static cURL in google-cloud-cpp. If we can use cURL's CMake
# package, we don't need to specify CURL_STATICLIB explicitly. But
# we don't have cURL's CMake package. We need to use CXXFLAGS
# instead of ARROW_CXXFLAGS because ARROW_CXXFLAGS aren't passed to
# ExternProjects.
export CXXFLAGS="${CXXFLAGS} -DCURL_STATICLIB"
# The Rtools libutf8proc is a static lib, but Findutf8proc.cmake doesn't
# set the appropriate compiler definition.
export CPPFLAGS="-DUTF8PROC_STATIC"
# CMAKE_UNITY_BUILD is set to OFF as otherwise some compute functionality
# segfaults in tests
# We use the bundled AWS SDK instead of the MINGW one because the upstream
# one on rtools packages is unmaintained, uses an old version (1.7.365)
# and does not work with newer versions of CMake. See comments:
# https://github.com/apache/arrow/pull/44989/files#r1901428998
# We use the bundled Apache Thrift instead of the MINGW one because
# the upstream one on rtools packages is unmaintained. Apache Thrift
# still have the following problem:
#
# https://github.com/apache/thrift/pull/2725
#
# The original MSYS2 package has another fix:
#
# https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-thrift/002-fix-pkgconfig-paths.patch
#
# But one on rtools packages doesn't have the fix. So we can't use
# the MINGW one.
# We use the bundled Brotli instead of the MINGW one because the one
# on rtools packages is unmaintained and stuck at 1.0.9.
# MSYS2_ARG_CONV_EXCL is needed to prevent autoconverting CMAKE_INSTALL_PREFIX
# to Windows paths. See https://www.msys2.org/docs/filesystem-paths/#process-arguments
# We require the full path to the CMake executable in order to build Arrow
# which is in the Program Files directory: "/c/Program Files/CMake/bin/cmake"
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
"${PROGRAMFILES}\CMake\bin\cmake.exe" \
${ARROW_CPP_DIR} \
-G "MSYS Makefiles" \
-DARROW_ACERO=ON \
-DARROW_BUILD_SHARED=OFF \
-DARROW_BUILD_STATIC=ON \
-DARROW_BUILD_UTILITIES=OFF \
-DARROW_COMPUTE=ON \
-DARROW_CSV=ON \
-DARROW_DATASET=ON \
-DARROW_FILESYSTEM=ON \
-DARROW_GCS=ON \
-DARROW_HDFS=OFF \
-DARROW_JEMALLOC=OFF \
-DARROW_JSON=ON \
-DARROW_LZ4_USE_SHARED=OFF \
-DARROW_MIMALLOC=ON \
-DARROW_PACKAGE_PREFIX="${MINGW_PREFIX}" \
-DARROW_PARQUET=ON \
-DARROW_S3=ON \
-DARROW_AZURE=OFF \
-DARROW_SNAPPY_USE_SHARED=OFF \
-DARROW_USE_GLOG=OFF \
-DARROW_UTF8PROC_USE_SHARED=OFF \
-DARROW_VERBOSE_THIRDPARTY_BUILD=ON \
-DARROW_WITH_LZ4=ON \
-DARROW_WITH_RE2=ON \
-DARROW_WITH_SNAPPY=ON \
-DARROW_WITH_ZLIB=ON \
-DARROW_WITH_ZSTD=ON \
-DARROW_WITH_BROTLI=ON \
-DARROW_WITH_BZ2=ON \
-DARROW_ZSTD_USE_SHARED=OFF \
-DARROW_CXXFLAGS="${CPPFLAGS}" \
-DAWSSDK_SOURCE=BUNDLED \
-DBrotli_SOURCE=BUNDLED \
-DCMAKE_BUILD_TYPE="release" \
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DCMAKE_UNITY_BUILD=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DThrift_SOURCE=BUNDLED
make -j3
popd
}
package() {
make -C ${cpp_build_dir} DESTDIR="${pkgdir}" install
local PREFIX_DEPS=$(cygpath -am ${MINGW_PREFIX})
pushd "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig"
for pc in *.pc; do
sed -s "s|${PREFIX_DEPS}|${MINGW_PREFIX}|g" -i $pc
done
popd
}