From 5ccf28cf8cd1f280ef521e0f7c52e594e54cf32f Mon Sep 17 00:00:00 2001 From: Tom Yan Date: Fri, 18 May 2018 04:40:42 +0800 Subject: [PATCH] python(2): fix bin/ and share/man/ Justification for the changes: $ dpkg -S smtpd.py python: /data/data/com.termux/files/usr/lib/python3.6/smtpd.py python2: /data/data/com.termux/files/usr/lib/python2.7/smtpd.py python2: /data/data/com.termux/files/usr/bin/smtpd.py $ ls -l $PREFIX/bin/python-config lrwxrwxrwx 1 u0_a312 u0_a312 14 May 18 01:09 /data/data/com.termux/files/usr/bin/python-config -> python2-config $ ls -l $PREFIX/share/man/man1/python2.1 lrwxrwxrwx 1 u0_a312 u0_a312 9 May 18 01:09 /data/data/com.termux/files/usr/share/man/man1/python2.1 -> python2.1 $ dpkg -S bin/2to3 python: /data/data/com.termux/files/usr/bin/2to3 python: /data/data/com.termux/files/usr/bin/2to3-3.6 $ dpkg -S bin/pydoc python2: /data/data/com.termux/files/usr/bin/pydoc python: /data/data/com.termux/files/usr/bin/pydoc3.6 python: /data/data/com.termux/files/usr/bin/pydoc3 --- packages/python/build.sh | 4 +++- packages/python2/build.sh | 15 ++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/python/build.sh b/packages/python/build.sh index 31d9205b1..73b1ad659 100644 --- a/packages/python/build.sh +++ b/packages/python/build.sh @@ -52,7 +52,9 @@ termux_step_pre_configure() { termux_step_post_make_install () { (cd $TERMUX_PREFIX/bin ln -sf python${_MAJOR_VERSION}m python${_MAJOR_VERSION} - ln -sf python3 python) + ln -sf python3 python + ln -sf python3-config python-config + ln -sf pydoc3 pydoc) (cd $TERMUX_PREFIX/share/man/man1 ln -sf python3.1 python.1) diff --git a/packages/python2/build.sh b/packages/python2/build.sh index f789b4e22..5488b611f 100644 --- a/packages/python2/build.sh +++ b/packages/python2/build.sh @@ -28,9 +28,12 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_buggy_getaddrinfo=no" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_little_endian_double=yes" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --build=$TERMUX_BUILD_TUPLE --with-system-ffi --without-ensurepip" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-unicode=ucs4" - -# Let 2to3 be in the python3 package: -TERMUX_PKG_RM_AFTER_INSTALL="bin/2to3" +TERMUX_PKG_RM_AFTER_INSTALL=" +bin/smtpd.py +bin/python +bin/python-config +share/man/man1/python.1 +" termux_step_host_build () { # We need a host-built Parser/pgen binary, copied into cross-compile build in termux_step_post_configure() below @@ -63,8 +66,10 @@ termux_step_pre_configure() { termux_step_post_make_install () { # Avoid file clashes with the python (3) package: - mv $TERMUX_PREFIX/share/man/man1/{python.1,python2.1} - rm $TERMUX_PREFIX/bin/python + (cd $TERMUX_PREFIX/bin + mv 2to3 2to3-${_MAJOR_VERSION} + mv pydoc pydoc${_MAJOR_VERSION} + ln -sf pydoc${_MAJOR_VERSION} pydoc2) # Restore path which termux_step_host_build messed with export PATH=$TERMUX_ORIG_PATH }