From 4c3da4df084dfb269bb7aebc46ec487ae124efac Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Tue, 9 Jul 2019 13:28:15 +0300 Subject: [PATCH] python2: Fix dependencies, make it non-default python --- .../0500-add-python-config-sh.patch | 30 +++++++++---------- ...0821-make-python2-non-default-python.patch | 14 +++++++++ mingw-w64-python2/PKGBUILD | 12 ++++---- 3 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 mingw-w64-python2/0821-make-python2-non-default-python.patch diff --git a/mingw-w64-python2/0500-add-python-config-sh.patch b/mingw-w64-python2/0500-add-python-config-sh.patch index d2375edb65..6835afc8c2 100644 --- a/mingw-w64-python2/0500-add-python-config-sh.patch +++ b/mingw-w64-python2/0500-add-python-config-sh.patch @@ -32,11 +32,11 @@ diff -Naur Python-2.7.9-orig/configure.ac Python-2.7.9/configure.ac # generate output files -AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc) -+AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh) ++AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python2-config.sh) + +AM_CONDITIONAL([MACHDEP_WIN32], [test "x$MACHDEP" = "xwin32"]) +AM_COND_IF([MACHDEP_WIN32], -+ [AC_CONFIG_FILES(Misc/python-config-u.sh)], ++ [AC_CONFIG_FILES(Misc/python2-config-u.sh)], + []) + AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) @@ -50,8 +50,8 @@ diff -Naur Python-2.7.9-orig/Makefile.pre.in Python-2.7.9/Makefile.pre.in # is not available in configure sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config + # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} -+ sed -e "s,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g" < Misc/python-config.sh >python-config.sh -+ -sed -e "s,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g" < Misc/python-config-u.sh >python-config-u.sh ++ sed -e "s,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g" < Misc/python2-config.sh >python2-config.sh ++ -sed -e "s,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g" < Misc/python2-config-u.sh >python2-config-u.sh # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) @@ -59,14 +59,14 @@ diff -Naur Python-2.7.9-orig/Makefile.pre.in Python-2.7.9/Makefile.pre.in $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config -+ $(INSTALL_SCRIPT) python-config.sh $(DESTDIR)$(BINDIR)/python-config.sh -+ -test -f python-config-u.sh && $(INSTALL_SCRIPT) python-config-u.sh $(DESTDIR)$(BINDIR)/python-config-u.sh ++ $(INSTALL_SCRIPT) python2-config.sh $(DESTDIR)$(BINDIR)/python2-config.sh ++ -test -f python2-config-u.sh && $(INSTALL_SCRIPT) python2-config-u.sh $(DESTDIR)$(BINDIR)/python2-config-u.sh rm python-config @if [ -s Modules/python.exp -a \ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ -diff -Naur Python-2.7.9-orig/Misc/python-config.sh.in Python-2.7.9/Misc/python-config.sh.in ---- Python-2.7.9-orig/Misc/python-config.sh.in 1970-01-01 03:00:00.000000000 +0300 -+++ Python-2.7.9/Misc/python-config.sh.in 2014-12-11 13:50:27.643400000 +0300 +diff -Naur Python-2.7.9-orig/Misc/python2-config.sh.in Python-2.7.9/Misc/python2-config.sh.in +--- Python-2.7.9-orig/Misc/python2-config.sh.in 1970-01-01 03:00:00.000000000 +0300 ++++ Python-2.7.9/Misc/python2-config.sh.in 2014-12-11 13:50:27.643400000 +0300 @@ -0,0 +1,127 @@ +#!/usr/bin/env sh + @@ -77,7 +77,7 @@ diff -Naur Python-2.7.9-orig/Misc/python-config.sh.in Python-2.7.9/Misc/python-c +} + +# Really, python-config.py (and thus .sh) should be called directly, but -+# sometimes software (e.g. GDB) calls python-config.sh as if it were the ++# sometimes software (e.g. GDB) calls python2-config.sh as if it were the +# Python executable, passing python-config.py as the first argument. +# Work around that oddness by ignoring any .py passed as first arg. +case "$1" in @@ -195,17 +195,17 @@ diff -Naur Python-2.7.9-orig/Misc/python-config.sh.in Python-2.7.9/Misc/python-c +done +echo -ne $RESULT + -diff -Naur Python-2.7.9-orig/Misc/python-config-u.sh.in Python-2.7.9/Misc/python-config-u.sh.in ---- Python-2.7.9-orig/Misc/python-config-u.sh.in 1970-01-01 03:00:00.000000000 +0300 -+++ Python-2.7.9/Misc/python-config-u.sh.in 2014-12-11 13:50:27.643400000 +0300 +diff -Naur Python-2.7.9-orig/Misc/python2-config-u.sh.in Python-2.7.9/Misc/python2-config-u.sh.in +--- Python-2.7.9-orig/Misc/python2-config-u.sh.in 1970-01-01 03:00:00.000000000 +0300 ++++ Python-2.7.9/Misc/python2-config-u.sh.in 2014-12-11 13:50:27.643400000 +0300 @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +THISDIR="$(dirname $0)" +test "$THISDIR" = "." && THISDIR=${PWD} + -+RESULT=$("${THISDIR}"/python-config.sh "$@") ++RESULT=$("${THISDIR}"/python2-config.sh "$@") + -+exec_prefix_win=$("${THISDIR}"/python-config.sh --exec-prefix) ++exec_prefix_win=$("${THISDIR}"/python2-config.sh --exec-prefix) +exec_prefix_unix=@prefix@ +echo $(echo $RESULT | sed "s#${exec_prefix_win}#${exec_prefix_unix}#g") diff --git a/mingw-w64-python2/0821-make-python2-non-default-python.patch b/mingw-w64-python2/0821-make-python2-non-default-python.patch new file mode 100644 index 0000000000..cb121d3d77 --- /dev/null +++ b/mingw-w64-python2/0821-make-python2-non-default-python.patch @@ -0,0 +1,14 @@ +--- Python-2.7.16/Makefile.pre.in.orig 2019-07-09 10:06:59.567193900 +0300 ++++ Python-2.7.16/Makefile.pre.in 2019-07-09 10:08:32.277323700 +0300 +@@ -996,11 +996,8 @@ + fi + -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE) + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE)) +- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON)) + -rm -f $(DESTDIR)$(BINDIR)/python2-config + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config) +- -rm -f $(DESTDIR)$(BINDIR)/python-config +- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config) + -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC) + -rm -f $(DESTDIR)$(LIBPC)/python2.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc) diff --git a/mingw-w64-python2/PKGBUILD b/mingw-w64-python2/PKGBUILD index 18e4015ea6..07a3d936bd 100644 --- a/mingw-w64-python2/PKGBUILD +++ b/mingw-w64-python2/PKGBUILD @@ -6,7 +6,7 @@ _realname=python2 pkgbase="mingw-w64-${_realname}" pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=2.7.16 -pkgrel=4 +pkgrel=5 _pybasever=${pkgver%.*} pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') @@ -16,7 +16,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-expat" "${MINGW_PACKAGE_PREFIX}-bzip2" "${MINGW_PACKAGE_PREFIX}-libffi" - "${MINGW_PACKAGE_PREFIX}-pdcurses" + "${MINGW_PACKAGE_PREFIX}-ncurses" "${MINGW_PACKAGE_PREFIX}-openssl" "${MINGW_PACKAGE_PREFIX}-tcl" "${MINGW_PACKAGE_PREFIX}-tk" @@ -91,6 +91,7 @@ source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz 0790-mingw-add-_exec_prefix-for-tcltk-dlls.patch 0800-mingw-install-layout-as-posix.patch 0820-mingw-reorder-bininstall-ln-symlink-creation.patch + 0821-make-python2-non-default-python.patch 0830-add-build-sysroot-config-option.patch 0840-add-builddir-to-library_dirs.patch 0845-Remove-compiler-lib-dirs-from-extension-lib-dirs.patch @@ -226,6 +227,7 @@ prepare() { 0790-mingw-add-_exec_prefix-for-tcltk-dlls.patch \ 0800-mingw-install-layout-as-posix.patch \ 0820-mingw-reorder-bininstall-ln-symlink-creation.patch \ + 0821-make-python2-non-default-python.patch \ 0830-add-build-sysroot-config-option.patch \ 0840-add-builddir-to-library_dirs.patch \ 0845-Remove-compiler-lib-dirs-from-extension-lib-dirs.patch \ @@ -394,14 +396,13 @@ package() { sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/bin/python${_pybasever}-config sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/bin/python2-config - sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/bin/python-config # fix permissons find ${pkgdir}${MINGW_PREFIX} -type f \( -name "*.dll" -o -name "*.exe" \) | xargs chmod 0755 # Fix up two instances of MSYS2 paths in python-config.sh in-case the final consumer of the results are native executables. sed -e "s|${MINGW_PREFIX}|${PREFIX_WIN}|" \ - -i "${pkgdir}${MINGW_PREFIX}"/bin/python-config.sh + -i "${pkgdir}${MINGW_PREFIX}"/bin/python2-config.sh # replace paths in sysconfig sed -i "s|${pkgdir}${MINGW_PREFIX}|${MINGW_PREFIX}|g" \ @@ -451,7 +452,7 @@ sha256sums=('f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7' 'd01b8072bd32f1ef321966aa4139ff0cf67fe7043978ff9eb81c83e078cd4585' '32c77169b4efbd5ba720aaa09e4c9f4f900f7427049bb9bc5a07b3f72bfd7758' '5fc794b7c84690bcd564fb456a49471c0c0091eb54cafe0a14cb4cac39cdd30c' - 'b18fd667d2d988457ada25221f5792b07df1927c78c107b076a770c2e0c75683' + '0e8ec11e59d77b138a14870e655669e6da27c359a49685bdae6ace60fb0d3597' '6300f5a7338aff519daff98b3879ac4649c831269a6b86e858728f253905607d' '074a93a56e17016d73a6438ffb501068ac3da4d65d15fe1624edf5b7c1a189a7' '801845f4d91330ccf82a01b9182fd4e52002daecd26ec143364dd8f3fd23d51b' @@ -480,6 +481,7 @@ sha256sums=('f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7' '1dabb52a527f006eafe0da24eb2952b39623216bc123a9afe1867f43c9e6e664' '115e5bf1dc091b14a97f4f5c8ba53624a1445426030f9a5166a9602c309db53e' '331af7adc53b87c8b377b3e0a1e65a9f3b2c241b72048c5629f452ce8aa531ee' + '56bb5044285fd87718a1c8593ee9c780cdec545f9c41e08b73b339e9c0adb433' 'f38f07fdc1fecf971ddce8e37e88c064144c842ddb3f2be3bab61fc8812c760e' '2ebb52e6ba331ea759a7136e93355d83514453126d573e8c9289f0c35aeba106' 'a0d15f9fe1577ca7284c2aa538a922fe083d94a2fe954de67aad699ad84a8320'