Files
termux-packages/packages/libarrow-cpp/build.sh
termux-pacman-bot 29e4386a8b bump(main/boost): 1.89.0
- Progress on https://github.com/termux/termux-packages/issues/23492

- Dependency of https://github.com/termux/termux-packages/pull/25826

- In order to rebuild all reverse dependencies successfully, also includes some fixes for builds of packages that currently fail to build with CMake 4, which are either the commonly-used `-DCMAKE_POLICY_VERSION_MINIMUM=3.5` argument, or are patches named to indicate their purpose

- All patches with attribution headers are cherry-picked from respective upstream PRs or commits

- All patches without attribution headers are written from scratch by me to solve errors that are either Termux-specific or are not yet fixed anywhere in upstream

Some notes about unique patches:

- Very big thanks to cho-m, who almost single-handedly brought boost 1.89 to `libc++`-based UNIX-like operating systems with their work on boost 1.89 for MacOS in https://github.com/Homebrew/homebrew-core/pull/233031. Many cherry-picked patches originated from them.
  - I chose to write my own patch for `ncmpcpp` for boost 1.89 rather then exactly copy the example of cho-m, even though my method involves more lines of code, because **I decided that I would like to be notified, through the patch failing to apply, when upstream `ncmpcpp` has added official support for boost 1.89**, indicating that the downstream change can then be removed without me having to remember it, which cho-m's example unfortunately wouldn't do.

- For some reason, building `openfoam` with boost 1.89 instead of boost 1.87 causes it to attempt to link to `libgmp.so` in a nonexistent folder `/data/data/com.termux/files/usr/lib64`, instead of `/data/data/com.termux/files/usr/lib`
  - It's unclear how exactly boost 1.89 draws out this error, but it can also be seen that the origin of the "lib64" instance is within openfoam, and Termux does not use any "lib64" folder, so it should be patched out from `openfoam` (which resolves the error)

```
    -L/data/data/com.termux/files/usr/lib64
    -L/home/builder/.termux-build/openfoam/src/ThirdParty/platforms/linuxARM64Clang/boost-system/lib
    -L/home/builder/.termux-build/openfoam/src/ThirdParty/platforms/linuxARM64Clang/boost-system/lib64
    -lmpfr -lgmp -lfileFormats -lsurfMesh -lmeshTools -ldecompose -ldynamicMesh -lsnappyHexMesh
    -o /home/builder/.termux-build/openfoam/src/platforms/linuxARM64ClangDPInt32Opt/lib/libconformalVoronoiMesh.so
ld.lld: error: unable to find library -lmpfr
```

- `ravencoin` and `mkvtoolnix` use `autoreconf -fi` during their `build.sh` files, but unfortunately, in the Ubuntu 24.04 cross-builder Docker image, there is a package installed in Ubuntu `autoconf-archive` version 20220903-3, which contains a file `/usr/share/aclocal/ax_boost_system.m4`, and this file is unfortunately propagated into the build systems of `ravencoin` and `mkvtoolnix` by `autoreconf -fi` and "pollutes" them with "awareness" that they would not otherwise have of the `Boost::System` shared library that no longer exists in boost 1.89, so temporary changes to `TERMUX_PKG_EXTRA_CONFIGURE_ARGS` are required, which should be removed the next time the Ubuntu cross-builder image is bumped, since after that happens, they will no longer be necessary.

- Copy and paste fix for building `abiword` with `libc++` 19+ (NDK r28c) from FreeBSD: e6daa211c6

- Fix prefix pollution `libjxl`->`telegram-desktop`
  - (i.e. the command `scripts/run-docker.sh ./build-package.sh -I -f libjxl telegram-desktop`)
  - For clarity, the edits to `packages/libjxl/fix-pkgconfig-file.patch` are primarily implementing this fix by removing the invalid path `/data/data/com.termux/files/usr//data/data/com.termux/files/usr/include` from the command `pkg-config --cflags libjxl`
2025-09-02 13:13:46 +00:00

84 lines
2.8 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://github.com/apache/arrow
TERMUX_PKG_DESCRIPTION="C++ libraries for Apache Arrow"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="21.0.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/apache/arrow/archive/refs/tags/apache-arrow-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=e92401790fdba33bfb4b8aa522626d800ea7fda4b6f036aaf39849927d2cf88d
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_VERSION_SED_REGEXP="s/apache-arrow-//"
TERMUX_PKG_DEPENDS="abseil-cpp, apache-orc, libandroid-execinfo, libc++, liblz4, libprotobuf, libre2, libsnappy, thrift, utf8proc, zlib, zstd"
TERMUX_PKG_BUILD_DEPENDS="boost, boost-headers, rapidjson"
TERMUX_PKG_PYTHON_COMMON_DEPS="build, Cython, numpy, setuptools, setuptools-scm, wheel"
TERMUX_PKG_BREAKS="libarrow-python (<< ${TERMUX_PKG_VERSION})"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DARROW_BUILD_STATIC=OFF
-DARROW_CSV=ON
-DARROW_DATASET=ON
-DARROW_HDFS=ON
-DARROW_JEMALLOC=OFF
-DARROW_JSON=ON
-DARROW_ORC=ON
-DARROW_PARQUET=ON
-DARROW_RUNTIME_SIMD_LEVEL=NONE
-DARROW_SIMD_LEVEL=NONE
-DLZ4_HOME=$TERMUX_PREFIX
-DSNAPPY_HOME=$TERMUX_PREFIX
-DZLIB_HOME=$TERMUX_PREFIX
-DZSTD_HOME=$TERMUX_PREFIX
"
termux_step_post_get_source() {
# Do not forget to bump revision of reverse dependencies and rebuild them
# after SOVERSION is changed.
local _EXPECTED_SOVERSION=2100
# From cpp/CMakeLists.txt: ARROW_SO_VERSION = "${ARROW_VERSION_MAJOR} * 100 + ${ARROW_VERSION_MINOR}"
local _ACTUAL_SOVERSION=$(echo "$TERMUX_PKG_VERSION" | awk -F'.' '{print $1 * 100 + $2}')
if [ ! "${_ACTUAL_SOVERSION}" ] || [ "${_EXPECTED_SOVERSION}" != "$(( "${_ACTUAL_SOVERSION}" ))" ]; then
termux_error_exit "SOVERSION changed: expected=$_EXPECTED_SOVERSION, actual=$_ACTUAL_SOVERSION"
fi
}
termux_step_pre_configure() {
termux_setup_protobuf
TERMUX_PKG_SRCDIR+="/cpp"
CPPFLAGS+=" -DPROTOBUF_USE_DLLS"
LDFLAGS+=" -landroid-execinfo"
# Fix linker script error for zlib 1.3
LDFLAGS+=" -Wl,--undefined-version"
}
termux_step_post_make_install() {
# termux_step_pre_configure
TERMUX_PKG_SRCDIR+="/../python"
TERMUX_PKG_BUILDDIR="$TERMUX_PKG_SRCDIR"
cd "$TERMUX_PKG_BUILDDIR"
export PYARROW_CMAKE_OPTIONS="
-DCMAKE_PREFIX_PATH=$TERMUX_PREFIX/lib/cmake
-DNUMPY_INCLUDE_DIRS=$TERMUX_PYTHON_HOME/site-packages/numpy/_core/include
"
export PYARROW_WITH_DATASET=1
export PYARROW_WITH_HDFS=1
export PYARROW_WITH_ORC=1
export PYARROW_WITH_PARQUET=1
# termux_step_configure
# cmake is not intended to be invoked directly.
termux_setup_cmake
termux_setup_ninja
# termux_step_make
PYTHONPATH='' python -m build -w -n -x "$TERMUX_PKG_SRCDIR"
# termux_step_make_install
local _pyver="${TERMUX_PYTHON_VERSION//./}"
local _wheel="pyarrow-${TERMUX_PKG_VERSION}-cp${_pyver}-cp${_pyver}-linux_${TERMUX_ARCH}.whl"
pip install --no-deps --prefix="$TERMUX_PREFIX" "$TERMUX_PKG_SRCDIR/dist/${_wheel}"
}