-
Notifications
You must be signed in to change notification settings - Fork 3
/
vendor-nanoarrow.sh
executable file
·36 lines (28 loc) · 1.15 KB
/
vendor-nanoarrow.sh
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
main() {
local -r repo_url="https://github.com/apache/arrow-nanoarrow"
# Check releases page: https://github.com/apache/arrow-nanoarrow/releases/
local -r commit_sha=33d2c8b973d8f8f424e02ac92ddeaace2a92f8dd
echo "Fetching $commit_sha from $repo_url"
SCRATCH=$(mktemp -d)
trap 'rm -rf "$SCRATCH"' EXIT
local -r tarball="$SCRATCH/nanoarrow.tar.gz"
wget -O "$tarball" "$repo_url/archive/$commit_sha.tar.gz"
tar --strip-components 1 -C "$SCRATCH" -xf "$tarball"
# Build the bundle
python "${SCRATCH}/ci/scripts/bundle.py" \
--include-output-dir=src/geoarrow \
--source-output-dir=src/geoarrow \
--header-namespace=
rm src/geoarrow/nanoarrow.hpp
sed -i.bak \
-e 's|// #define NANOARROW_NAMESPACE YourNamespaceHere|// When testing we use nanoarrow.h, but geoarrow_config.h will not exist in bundled\
// mode. In the tests we just have to make sure geoarrow.h is always included first.\
#if !defined(GEOARROW_CONFIG_H_INCLUDED)\
#include "geoarrow_config.h"\
#endif|' \
src/geoarrow/nanoarrow.h
rm src/geoarrow/nanoarrow.h.bak
clang-format -i src/geoarrow/nanoarrow.h
clang-format -i src/geoarrow/nanoarrow.c
}
main