From e8915b79779749a44e2d5803ca4aedea34be870c Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Mon, 28 Apr 2014 21:02:40 +0100 Subject: [PATCH] python2: make a python-config-u.sh .. which returns Unixy/MSYS2 paths rather than Windows-y ones. This is so that GDB detects and defines PYTHON_PATH_RELOCATABLE. --- .../0500-add-python-config-sh.patch | 68 +++++++++++++------ mingw-w64-python2/PKGBUILD | 6 +- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/mingw-w64-python2/0500-add-python-config-sh.patch b/mingw-w64-python2/0500-add-python-config-sh.patch index 26a9b75588..1103582730 100644 --- a/mingw-w64-python2/0500-add-python-config-sh.patch +++ b/mingw-w64-python2/0500-add-python-config-sh.patch @@ -1,6 +1,6 @@ -diff -Naur a/configure.ac b/configure.ac ---- a/configure.ac 2014-02-18 09:32:21.949400000 +0400 -+++ b/configure.ac 2014-02-18 09:32:40.092200000 +0400 +diff -urN a/configure.ac b/configure.ac +--- a/configure.ac 2014-04-28 11:20:12.678807400 +0000 ++++ b/configure.ac 2014-04-28 17:37:05.595077900 +0000 @@ -912,6 +912,7 @@ # Other platforms follow @@ -27,39 +27,47 @@ diff -Naur a/configure.ac b/configure.ac if test "$cross_compiling" = yes; then RUNSHARED= -@@ -4777,7 +4782,7 @@ +@@ -4777,7 +4782,13 @@ AC_MSG_RESULT(done) # 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) ++ ++AM_CONDITIONAL([MACHDEP_WIN32], [test "x$MACHDEP" = "xwin32"]) ++AM_COND_IF([MACHDEP_WIN32], ++ [AC_CONFIG_FILES(Misc/python-config-u.sh)], ++ []) ++ AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) AC_OUTPUT -diff -Naur a/Makefile.pre.in b/Makefile.pre.in ---- a/Makefile.pre.in 2014-02-18 09:32:13.853000000 +0400 -+++ b/Makefile.pre.in 2014-02-18 09:32:40.092200000 +0400 -@@ -1057,6 +1057,8 @@ +diff -urN a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in 2014-04-28 11:20:15.317807400 +0000 ++++ b/Makefile.pre.in 2014-04-28 17:57:07.877077900 +0000 +@@ -1057,6 +1057,9 @@ # Substitution happens here, as the completely-expanded BINDIR # 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 # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) -@@ -1115,6 +1117,7 @@ +@@ -1115,6 +1118,8 @@ $(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 rm python-config @if [ -s Modules/python.exp -a \ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ -diff -Naur a/Misc/python-config.sh.in b/Misc/python-config.sh.in ---- a/Misc/python-config.sh.in 1970-01-01 03:00:00.000000000 +0300 -+++ b/Misc/python-config.sh.in 2014-02-18 09:32:40.092200000 +0400 -@@ -0,0 +1,121 @@ +diff -urN a/Misc/python-config.sh.in b/Misc/python-config.sh.in +--- a/Misc/python-config.sh.in 1970-01-01 00:00:00.000000000 +0000 ++++ b/Misc/python-config.sh.in 2014-04-28 17:26:00.488077900 +0000 +@@ -0,0 +1,127 @@ +#!/usr/bin/env sh + +exit_with_usage () @@ -150,23 +158,27 @@ diff -Naur a/Misc/python-config.sh.in b/Misc/python-config.sh.in + esac +done + ++RESULT= +for ARG in $* +do ++ if [ ! -z "$RESULT" ]; then ++ RESULT=$RESULT" " ++ fi + case $ARG in + --prefix) -+ echo -ne "$prefix " ++ RESULT=$RESULT"$prefix" + ;; + --exec-prefix) -+ echo -ne "$exec_prefix " ++ RESULT=$RESULT"$exec_prefix" + ;; + --includes) -+ echo -ne "$INCDIR " ++ RESULT=$RESULT"$INCDIR" + ;; + --cflags) -+ echo -ne "$INCDIR $BASECFLAGS $CFLAGS $OPT " ++ RESULT=$RESULT"$INCDIR $BASECFLAGS $CFLAGS $OPT" + ;; + --libs) -+ echo -ne "$LIBS " ++ RESULT=$RESULT"$LIBS" + ;; + --ldflags) + LINKFORSHAREDUSED= @@ -174,10 +186,26 @@ diff -Naur a/Misc/python-config.sh.in b/Misc/python-config.sh.in + LINKFORSHAREDUSED=$LINKFORSHARED + fi + LIBPLUSED= -+ if [ "$PY_ENABLE_SHARED" = "0" -o -n "$(DLLLIBRARY)" ] ; then ++ if [ "$PY_ENABLE_SHARED" = "0" -o -n "${DLLLIBRARY}" ] ; then + LIBPLUSED="-L$LIBPL" + fi -+ echo -ne "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED " ++ RESULT=$RESULT"$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED" + ;; +esac +done ++echo -ne $RESULT ++ +diff -urN a/Misc/python-config-u.sh.in b/Misc/python-config-u.sh.in +--- a/Misc/python-config-u.sh.in 1970-01-01 00:00:00.000000000 +0000 ++++ b/Misc/python-config-u.sh.in 2014-04-28 17:42:58.258077900 +0000 +@@ -0,0 +1,10 @@ ++#!/usr/bin/env sh ++ ++THISDIR="$(dirname $0)" ++test "$THISDIR" = "." && THISDIR=${PWD} ++ ++RESULT=$("${THISDIR}"/python-config.sh "$@") ++ ++exec_prefix_win=$("${THISDIR}"/python-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/PKGBUILD b/mingw-w64-python2/PKGBUILD index 57394025fe..769985f36a 100644 --- a/mingw-w64-python2/PKGBUILD +++ b/mingw-w64-python2/PKGBUILD @@ -5,7 +5,7 @@ _realname=python2 _mingw_suff=mingw-w64-${CARCH} pkgname="${_mingw_suff}-${_realname}" pkgver=2.7.6 -pkgrel=10 +pkgrel=11 _pybasever=2.7 pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') @@ -103,7 +103,7 @@ prepare() { cd "${srcdir}/Python-${pkgver}" # these are created by patches - rm -f Misc/config_mingw Misc/cross_mingw32 Misc/python-config.sh.in Python/fileblocks.c + rm -f Misc/config_mingw Misc/cross_mingw32 Misc/python-config.sh.in Misc/cross_mingw32 Misc/python-config-u.sh.in Python/fileblocks.c plain "Apply Roumen Petrov's core patches (15)" patch -p1 -i "${srcdir}"/0100-MINGW-BASE-use-NT-thread-model.patch @@ -354,7 +354,7 @@ sha1sums=('8321636af2acbeaa68fc635d7dda7369ed446a80' 'f1e8d12d31b7ece5e10999e12ab00de76873d019' 'c0e278de34b416454f7727a6701d82371ce717b8' '61b783ee45bb5aa5875b5bbef671c3db179d5291' - '584c979f65b642c643cc43fff350ace7e4f17638' + '9fbc34a5308500522c9d0f682e460e7ea11fd781' '1cf9f4571b2b19392e6a4d8d9546fa5196e70008' '0ac2b1b07ba9df85201766f81ac44e49010a2037' '54f0a022fdc4c06d4c113c52b95111fa04ddb7a7'