diff --git a/PKGBUILD b/PKGBUILD index 2a2e93a..569bbe5 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -37,49 +37,41 @@ prepare() { build() { cd apache-${_pkg}-${pkgver}/python - ARROW_HOME=/usr \ - PARQUET_HOME=/usr \ - PYARROW_BUNDLE_ARROW_CPP_HEADERS=0 \ - PYARROW_BUNDLE_PLASMA_EXECUTABLE=0 \ - PYARROW_WITH_HDFS=1 \ - PYARROW_WITH_FLIGHT=1 \ + # https://github.com/apache/arrow/blob/main/docs/source/developers/python.rst#relevant-components-and-environment-variables PYARROW_WITH_DATASET=1 \ + PYARROW_WITH_FLIGHT=1 \ + PYARROW_WITH_HDFS=1 \ + PYARROW_WITH_ORC=1 \ PYARROW_WITH_PARQUET=1 \ - PYARROW_WITH_PLASMA=1 \ + PYARROW_WITH_PARQUET_ENCRYPTION=1 \ + PYARROW_WITH_SUBSTRAIT=1 \ PYARROW_WITH_TENSORFLOW=1 \ PYARROW_WITH_ORC=1 \ python -m build --wheel --no-isolation } check() { - cd apache-${_pkg}-${pkgver}/python - local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))') - # rename source to avoid name clash - mv pyarrow _nopyarrow - PYTHONPATH="${PWD}/build/lib.linux-${CARCH}-cpython-${python_version/./}" \ + # local install for testing + mkdir -p fakeinstall + bsdtar -C fakeinstall -xf apache-${_pkg}-${pkgver}/python/dist/*.whl + PYTHONPATH="${srcdir}/fakeinstall" \ ARROW_TEST_DATA="${srcdir}"/arrow-testing/data \ ARROW_HOME=/usr \ PARQUET_HOME=/usr \ - pytest -vv --color=yes -k 'not test_cython_api and not test_visit_strings and not test_env_var and not test_get_include and not test_pyarrow_include' - mv _nopyarrow pyarrow + pytest -vv --color=yes -k 'not test_cython_api and not test_visit_strings and not test_env_var and not test_get_include' --pyargs pyarrow } package(){ cd apache-${_pkg}-${pkgver}/python - ARROW_HOME=/usr \ - PARQUET_HOME=/usr \ - PYARROW_BUNDLE_ARROW_CPP_HEADERS=0 \ - PYARROW_BUNDLE_PLASMA_EXECUTABLE=0 \ - PYARROW_WITH_HDFS=1 \ - PYARROW_WITH_FLIGHT=1 \ - PYARROW_WITH_DATASET=1 \ - PYARROW_WITH_PARQUET=1 \ - PYARROW_WITH_PLASMA=1 \ - PYARROW_WITH_TENSORFLOW=1 \ - PYARROW_WITH_ORC=1 \ python -m installer --destdir="${pkgdir}" dist/*.whl # drop tests from install local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") rm -rf "${pkgdir}${site_packages}"/${_pkgname}/{conftest.py,tests} + + # move python include files + install -d "${pkgdir}"/usr/include/arrow/ + mv "${pkgdir}${site_packages}"/${_pkgname}/include/arrow/python/ "${pkgdir}"/usr/include/arrow/ + rm -rf "${pkgdir}${site_packages}"/${_pkgname}/include/ + ln -sT /usr/include/arrow/ "${pkgdir}${site_packages}"/${_pkgname}/include }