|
| 1 | +TERMUX_PKG_HOMEPAGE=https://scikit-learn.org |
| 2 | +TERMUX_PKG_DESCRIPTION="Python module for machine learning" |
| 3 | +TERMUX_PKG_LICENSE="BSD 3-Clause" |
| 4 | +TERMUX_PKG_MAINTAINER="@termux-user-repository" |
| 5 | +TERMUX_PKG_VERSION="1.5.2" |
| 6 | +TERMUX_PKG_SRCURL=git+https://github.com/scikit-learn/scikit-learn |
| 7 | +TERMUX_PKG_GIT_BRANCH="$TERMUX_PKG_VERSION" |
| 8 | +TERMUX_PKG_DEPENDS="libc++, python, python-numpy, python-scipy" |
| 9 | +TERMUX_PKG_PYTHON_COMMON_DEPS="wheel, 'Cython>=3.0.4', meson-python, build" |
| 10 | +TERMUX_PKG_AUTO_UPDATE=true |
| 11 | +TERMUX_PKG_UPDATE_TAG_TYPE="latest-release-tag" |
| 12 | + |
| 13 | +TERMUX_MESON_WHEEL_CROSSFILE="$TERMUX_PKG_TMPDIR/wheel-cross-file.txt" |
| 14 | +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" |
| 15 | +--cross-file $TERMUX_MESON_WHEEL_CROSSFILE |
| 16 | +" |
| 17 | + |
| 18 | +TERMUX_PYTHON_VERSION=3.12 |
| 19 | +TERMUX_PYTHON_HOME=$TERMUX_PREFIX/lib/python${TERMUX_PYTHON_VERSION} |
| 20 | +TERMUX_PYTHON_CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python${TERMUX_PYTHON_VERSION/./}-crossenv-prefix-$TERMUX_ARCH |
| 21 | +TUR_AUTO_AUDIT_WHEEL=true |
| 22 | +TUR_AUDIT_WHEEL_NO_LIBS=true |
| 23 | +TUR_AUTO_BUILD_WHEEL=false |
| 24 | +TUR_WHEEL_DIR="../src/dist" |
| 25 | + |
| 26 | +source $TERMUX_SCRIPTDIR/common-files/tur_build_wheel.sh |
| 27 | + |
| 28 | +termux_step_pre_configure() { |
| 29 | + LDFLAGS+=" -fopenmp -static-openmp" |
| 30 | +} |
| 31 | + |
| 32 | +termux_step_configure() { |
| 33 | + termux_setup_meson |
| 34 | + |
| 35 | + cp -f $TERMUX_MESON_CROSSFILE $TERMUX_MESON_WHEEL_CROSSFILE |
| 36 | + sed -i 's|^\(\[binaries\]\)$|\1\npython = '\'$(command -v python)\''|g' \ |
| 37 | + $TERMUX_MESON_WHEEL_CROSSFILE |
| 38 | + sed -i 's|^\(\[properties\]\)$|\1\nnumpy-include-dir = '\'$PYTHON_SITE_PKG/numpy/_core/include\''|g' \ |
| 39 | + $TERMUX_MESON_WHEEL_CROSSFILE |
| 40 | + |
| 41 | + termux_step_configure_meson |
| 42 | +} |
| 43 | + |
| 44 | +termux_step_make() { |
| 45 | + pushd $TERMUX_PKG_SRCDIR |
| 46 | + python -m build -w -n -x --config-setting builddir=$TERMUX_PKG_BUILDDIR . |
| 47 | + popd |
| 48 | +} |
| 49 | + |
| 50 | +termux_step_make_install() { |
| 51 | + local _pyv="${TERMUX_PYTHON_VERSION/./}" |
| 52 | + local _whl="scikit_learn-$TERMUX_PKG_VERSION-cp$_pyv-cp$_pyv-linux_$TERMUX_ARCH.whl" |
| 53 | + pip install --no-deps --prefix=$TERMUX_PREFIX --force-reinstall $TERMUX_PKG_SRCDIR/dist/$_whl |
| 54 | +} |
0 commit comments