termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
12.63k stars 2.91k forks source link

python 3.12.0 request #18210

Open ken6488 opened 9 months ago

ken6488 commented 9 months ago

Why is it worth to add this package?

python 3.12.0 is essential for most functions now

Home page URL

python 3.12.0 is essential for most functions now

Source code URL

python 3.12.0 is essential for most functions now

Packaging policy acknowledgement

Additional information

python 3.12.0 is essential for most functions now

romanovj commented 9 months ago

pls no, 3.12 will break alot of things

TomJo2000 commented 9 months ago

pls no, 3.12 will break alot of things

3.11 will continue to be available on the TUR just as 3.7 through 3.10 already are.

ken6488 commented 9 months ago

pls no, 3.12 will break alot of things

We need 3.12

ken6488 commented 9 months ago

pls no, 3.12 will break alot of things

3.11 will continue to be available on the TUR just as 3.7 through 3.10 already are.

When should we expect 3.12

TomJo2000 commented 9 months ago

We need 3.12

The PR tracking progress for Python 3.12 is

It'll be merged when its ready and all packages directly depending on Python are correctly building with 3.12. If you want to check out Python 3.12 early you can grab the .deb file for your architecture from the CI run associated with the PR.

Don't be surprised if you run into some issues though.

yubrajbhoi commented 6 months ago

The PR seems pretty inactive, so here is my fork if anyone wants to build from source: https://github.com/yubrajbhoi/termux-python-12

MerluzaCuca commented 6 months ago

The PR seems pretty inactive, so here is my fork if anyone wants to build from source: https://github.com/yubrajbhoi/termux-python-12

How do I install it?

yubrajbhoi commented 6 months ago

@MerluzaCuca With a script like this:

TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_func_wcsftime=no"
# Avoid trying to include <sys/timeb.h> which does not exist on android-21:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_ftime=no"
# Avoid trying to use AT_EACCESS which is not defined:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_faccessat=no"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-system-ffi --with-system-expat --without-ensurepip"
# Hard links does not work on Android 6:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_linkat=no"
# Do not assume getaddrinfo is buggy when cross compiling:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_buggy_getaddrinfo=no"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-loadable-sqlite-extensions"
# Fix https://github.com/termux/termux-packages/issues/2236:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_little_endian_double=yes"
# Force enable posix semaphores.
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_posix_semaphores_enabled=yes"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_sem_open=yes"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_sem_timedwait=yes"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_sem_getvalue=yes"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_sem_unlink=yes"
# Force enable posix shared memory.
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_shm_open=yes"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_shm_unlink=yes"

export CC=clang
export CXX=clang++
export LDFLAGS='-landroid-posix-semaphore -landroid-support -Wl,--as-needed'
export LIBCRYPT_LIBS='-lcrypt'
export CPPFLAGS='-D__ANDROID_API__=24 -Wno-implicit-function-declaration'
export CFLAGS='-Wno-implicit-function-declaration -Wno-int-conversion'

./configure $TERMUX_PKG_EXTRA_CONFIGURE_ARGS
make -j4
make install

This will install to the Termux prefix, so you should remove the python-3.11 package before that. Also, you can't really uninstall it.

If you want to install both Python 3.11 and 3.12 first install this to a prefix and install that package with stow. That is what I did.

I should put this info in the repo's README.