#!/bin/sh

set -e
set -x

# Build dependencies
export ARROW_HOME=$PREFIX
export PARQUET_HOME=$PREFIX
export PYARROW_BUNDLE_ARROW_CPP_HEADERS=0
export SETUPTOOLS_SCM_PRETEND_VERSION=$PKG_VERSION
export PYARROW_WITH_COMPUTE=1
export PYARROW_WITH_CSV=1
export PYARROW_BUILD_TYPE=release
export PYARROW_WITH_DATASET=1
export PYARROW_WITH_FILESYSTEM=1
export PYARROW_WITH_FLIGHT=1
export PYARROW_WITH_HDFS=1
export PYARROW_WITH_JSON=1
export PYARROW_WITH_ORC=1
export PYARROW_WITH_PARQUET=1
export PYARROW_WITH_PARQUET_ENCRYPTION=1
export PYARROW_WITH_PLASMA=1
export PYARROW_WITH_S3=1
export PYARROW_WITH_GANDIVA=0
export PYARROW_WITH_CUDA=0

cd python

$PYTHON setup.py \
        build_ext \
        install --single-version-externally-managed \
                --record=record.txt

#cp ${SRC_DIR}/python/build/dist/lib/*${SHLIB_EXT} ${PREFIX}/lib
cp -r ${SRC_DIR}/python/build/dist/lib/* ${PREFIX}/lib
cp -r ${SRC_DIR}/python/build/dist/include/* ${PREFIX}/include

rm -r ${SP_DIR}/pyarrow/tests

