commit:     263c4d2298d7a6c0d1cc778a4933a47088ceaadb
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon May 27 09:39:02 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon May 27 09:42:01 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=263c4d22

bootstrap-prefix.sh (stage1 python-3.6.8): apply cygwin patches

Using cygwinports patches for stage1 python much like the ebuild does.
Bug: https://bugs.gentoo.org/686522
Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index b3ab8cb4bb..224fbb5ba3 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -945,7 +945,34 @@ bootstrap_python() {
                patch -p0 < 
"${DISTDIR}"/python-3.6-02_all_disable_modules_and_ssl.patch
        fi
 
-       # Cygwin TODO: use cygwin python sources here?
+       case ${CHOST} in
+       (*-*-cygwin*)
+               # apply patches from cygwinports much like the ebuild does
+               local gitrev pf pn
+               gitrev="71f2ac2444946c97d892be3892e47d2a509e0e96" # python36 
3.6.8
+               efetch 
"https://github.com/cygwinports/python36/archive/${gitrev}.tar.gz"; \
+                       || return 1
+               gzip -dc "${DISTDIR}"/${gitrev}.tar.gz | tar -xf -
+               [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1
+               for pf in $(
+                       sed -ne '/PATCH_URI="/,/"/{s/.*="//;s/".*$//;p}' \
+                       < python36-${gitrev}/python3.cygport
+               ); do
+                       pf="python36-${gitrev}/${pf}"
+                       for pn in {1..2} fail; do
+                               if [[ ${pn} == fail ]]; then
+                                       eerror "failed to apply ${pf}"
+                                       return 1
+                               fi
+                               patch -N -p${pn} -i "${pf}" --dry-run 
>/dev/null 2>&1 || continue
+                               echo "applying (-p${pn}) ${pf}"
+                               patch -N -p${pn} -i "${pf}" || return 1
+                               break
+                       done
+               done
+               ;;
+       esac
+
        local myconf=""
 
        case $CHOST in

Reply via email to