Skip to content

Commit d117bce

Browse files
committed
python3.12-polars: bump to 1.19.0
1 parent 9633d90 commit d117bce

File tree

3 files changed

+44
-66
lines changed

3 files changed

+44
-66
lines changed

tur-pypi-312/python3.12-polars/build.sh

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://github.com/pola-rs/polars
22
TERMUX_PKG_DESCRIPTION="Dataframes powered by a multithreaded, vectorized query engine, written in Rust"
33
TERMUX_PKG_LICENSE="MIT"
44
TERMUX_PKG_MAINTAINER="@termux-user-repository"
5-
TERMUX_PKG_VERSION="1.18.0"
5+
TERMUX_PKG_VERSION="1.19.0"
66
TERMUX_PKG_SRCURL=https://github.com/pola-rs/polars/releases/download/py-$TERMUX_PKG_VERSION/polars-$TERMUX_PKG_VERSION.tar.gz
7-
TERMUX_PKG_SHA256=5c2f119555ae8d822a5322509c6abd91601a8931115d2e4c3fff13fadf39e877
7+
TERMUX_PKG_SHA256=b52ada5c43fcdadf64f282522198c5549ee4e46ea57d236a4d7e572643070d9d
88
TERMUX_PKG_AUTO_UPDATE=true
99
TERMUX_PKG_DEPENDS="libc++, python"
1010
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel"
@@ -52,62 +52,38 @@ termux_step_pre_configure() {
5252
: "${CARGO_HOME:=$HOME/.cargo}"
5353
export CARGO_HOME
5454

55-
56-
rm -rf $CARGO_HOME/registry/src/*/cmake-*
57-
rm -rf $CARGO_HOME/registry/src/*/jemalloc-sys-*
58-
rm -rf $CARGO_HOME/registry/src/*/arboard-*
5955
cargo fetch --target "${CARGO_TARGET_NAME}"
6056

61-
local p="cmake-0.1.50-src-lib.rs.diff"
62-
local d
63-
for d in $CARGO_HOME/registry/src/*/cmake-*; do
64-
patch --silent -p1 -d ${d} \
65-
< "$TERMUX_PKG_BUILDER_DIR/${p}"
66-
done
67-
68-
p="jemalloc-sys-0.5.4+5.3.0-patched-src-lib.rs.diff"
69-
for d in $CARGO_HOME/registry/src/*/jemalloc-sys-*; do
70-
patch --silent -p1 -d ${d} < "$TERMUX_PKG_BUILDER_DIR/${p}"
71-
done
72-
73-
p="arboard-dummy-platform.diff"
74-
for d in $CARGO_HOME/registry/src/*/arboard-*; do
75-
patch --silent -p1 -d ${d} < "$TERMUX_PKG_BUILDER_DIR/${p}"
76-
done
77-
78-
local _CARGO_TARGET_LIBDIR="target/${CARGO_TARGET_NAME}/release/deps"
79-
mkdir -p $_CARGO_TARGET_LIBDIR
80-
81-
mv $TERMUX_PREFIX/lib/libz.so.1{,.tmp}
82-
mv $TERMUX_PREFIX/lib/libz.so{,.tmp}
83-
84-
ln -sfT $(readlink -f $TERMUX_PREFIX/lib/libz.so.1.tmp) \
85-
$_CARGO_TARGET_LIBDIR/libz.so.1
86-
ln -sfT $(readlink -f $TERMUX_PREFIX/lib/libz.so.tmp) \
87-
$_CARGO_TARGET_LIBDIR/libz.so
88-
89-
LDFLAGS+=" -Wl,--no-as-needed -lpython${TERMUX_PYTHON_VERSION}"
90-
91-
# XXX: Don't know why, this is needed for `cmake` in rust to work properly
92-
local _rtarget _renv
93-
for _rtarget in {aarch64,i686,x86_64}-linux-android armv7-linux-androideabi; do
94-
_renv="CFLAGS_${_rtarget//-/_}"
95-
export $_renv+=" --target=${CCTERMUX_HOST_PLATFORM}"
96-
done
57+
# Dummy CMake toolchain file to workaround build error:
58+
# CMake Error at /home/builder/.termux-build/_cache/cmake-3.30.3/share/cmake-3.30/Modules/Platform/Android-Determine.cmake:218 (message):
59+
# Android: Neither the NDK or a standalone toolchain was found.
60+
export TARGET_CMAKE_TOOLCHAIN_FILE="${TERMUX_PKG_BUILDDIR}/android.toolchain.cmake"
61+
touch "${TERMUX_PKG_BUILDDIR}/android.toolchain.cmake"
62+
63+
cargo vendor
64+
patch --silent -p1 \
65+
-d ./vendor/arboard/ \
66+
< "$TERMUX_PKG_BUILDER_DIR"/arboard-dummy-platform.diff
67+
patch --silent -p1 \
68+
-d ./vendor/jemalloc-sys/ \
69+
< "$TERMUX_PKG_BUILDER_DIR"/jemalloc-sys-0.5.4+5.3.0-patched-src-lib.rs.diff
70+
71+
patch --silent -p1 \
72+
-d "$TERMUX_PKG_SRCDIR" \
73+
< "$TERMUX_PKG_BUILDER_DIR"/patch-root-Cargo.diff
74+
75+
LDFLAGS+=" -Wl,--no-as-needed,-lpython${TERMUX_PYTHON_VERSION},--as-needed"
9776
}
9877

9978
termux_step_make() {
100-
:
101-
}
102-
103-
termux_step_make_install() {
10479
export CARGO_BUILD_TARGET=${CARGO_TARGET_NAME}
10580
export PYO3_CROSS_LIB_DIR=$TERMUX_PREFIX/lib
10681
export PYTHONPATH=$TERMUX_PREFIX/lib/python${TERMUX_PYTHON_VERSION}/site-packages
10782

108-
build-python -m maturin build --release --skip-auditwheel --target $CARGO_BUILD_TARGET
109-
110-
pip install --no-deps ./target/wheels/*.whl --prefix $TERMUX_PREFIX
83+
build-python -m maturin build \
84+
--target $CARGO_BUILD_TARGET \
85+
--release --skip-auditwheel \
86+
--interpreter python${TERMUX_PYTHON_VERSION}
11187

11288
# Fix wheel name, although it it built with tag `cp38-abi3`, but it is linked against `python3.x.so`
11389
# so it will not work on other pythons.
@@ -116,16 +92,18 @@ termux_step_make_install() {
11692
./target/wheels/polars-$TERMUX_PKG_VERSION-cp$_pyver-cp$_pyver-linux_$TERMUX_ARCH.whl
11793
}
11894

119-
termux_step_post_make_install() {
120-
mv $TERMUX_PREFIX/lib/libz.so.1{.tmp,}
121-
mv $TERMUX_PREFIX/lib/libz.so{.tmp,}
95+
termux_step_make_install() {
96+
pip install --no-deps ./target/wheels/*.whl --prefix $TERMUX_PREFIX
97+
}
12298

99+
termux_step_post_make_install() {
100+
# This is not necessary, and may cause file conflict
123101
rm -f $PYTHONPATH/rust-toolchain.toml
102+
103+
# Remove the vendor sources to save space
104+
rm -rf "$TERMUX_PKG_SRCDIR"/vendor
124105
}
125106

126107
termux_step_post_massage() {
127-
rm -f lib/libz.so.1
128-
rm -f lib/libz.so
129-
130108
tur_build_wheel
131109
}

tur-pypi-312/python3.12-polars/cmake-0.1.50-src-lib.rs.diff

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/Cargo.toml
2+
+++ b/Cargo.toml
3+
@@ -134,6 +134,8 @@
4+
# simd-json = { git = "https://github.com/ritchie46/simd-json", branch = "alignment" }
5+
pyo3 = { git = "https://github.com/bschoenmaeckers/pyo3.git", branch = "release-0.23" }
6+
pyo3-ffi = { git = "https://github.com/bschoenmaeckers/pyo3.git", branch = "release-0.23" }
7+
+arboard = { path = "./vendor/arboard" }
8+
+jemalloc-sys = { path = "./vendor/jemalloc-sys" }
9+
10+
[profile.mindebug-dev]
11+
inherits = "dev"

0 commit comments

Comments
 (0)