Skip to content

Commit cd74e1e

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

File tree

3 files changed

+48
-69
lines changed

3 files changed

+48
-69
lines changed

tur-pypi-311/python3.11-polars/build.sh

Lines changed: 37 additions & 58 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++, python3.11"
1010
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel"
@@ -56,79 +56,58 @@ termux_step_pre_configure() {
5656
: "${CARGO_HOME:=$HOME/.cargo}"
5757
export CARGO_HOME
5858

59-
60-
rm -rf $CARGO_HOME/registry/src/*/cmake-*
61-
rm -rf $CARGO_HOME/registry/src/*/jemalloc-sys-*
62-
rm -rf $CARGO_HOME/registry/src/*/arboard-*
6359
cargo fetch --target "${CARGO_TARGET_NAME}"
6460

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

10382
termux_step_make() {
104-
:
105-
}
106-
107-
termux_step_make_install() {
10883
export CARGO_BUILD_TARGET=${CARGO_TARGET_NAME}
10984
export PYO3_CROSS_LIB_DIR=$TERMUX_PREFIX/lib
11085
export PYTHONPATH=$TERMUX_PREFIX/lib/python${TERMUX_PYTHON_VERSION}/site-packages
11186

112-
build-python -m maturin build --release --skip-auditwheel --target $CARGO_BUILD_TARGET
87+
build-python -m maturin build \
88+
--target $CARGO_BUILD_TARGET \
89+
--release --skip-auditwheel \
90+
--interpreter python${TERMUX_PYTHON_VERSION}
11391

114-
pip install --no-deps ./target/wheels/*.whl --prefix $TERMUX_PREFIX
115-
116-
# Fix wheel name, although it it built with tag `cp38-abi3`, but it is linked against `python3.11.so`
92+
# Fix wheel name, although it it built with tag `cp38-abi3`, but it is linked against `python3.x.so`
11793
# so it will not work on other pythons.
94+
local _pyver="${TERMUX_PYTHON_VERSION/./}"
11895
mv ./target/wheels/polars-$TERMUX_PKG_VERSION-cp39-abi3-linux_$TERMUX_ARCH.whl \
119-
./target/wheels/polars-$TERMUX_PKG_VERSION-cp311-cp311-linux_$TERMUX_ARCH.whl
96+
./target/wheels/polars-$TERMUX_PKG_VERSION-cp$_pyver-cp$_pyver-linux_$TERMUX_ARCH.whl
12097
}
12198

122-
termux_step_post_make_install() {
123-
mv $TERMUX_PREFIX/lib/libz.so.1{.tmp,}
124-
mv $TERMUX_PREFIX/lib/libz.so{.tmp,}
99+
termux_step_make_install() {
100+
pip install --no-deps ./target/wheels/*.whl --prefix $TERMUX_PREFIX
101+
}
125102

103+
termux_step_post_make_install() {
104+
# This is not necessary, and may cause file conflict
126105
rm -f $PYTHONPATH/rust-toolchain.toml
106+
107+
# Remove the vendor sources to save space
108+
rm -rf "$TERMUX_PKG_SRCDIR"/vendor
127109
}
128110

129111
termux_step_post_massage() {
130-
rm -f lib/libz.so.1
131-
rm -f lib/libz.so
132-
133112
tur_build_wheel
134-
}
113+
}

tur-pypi-311/python3.11-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)