summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Sun2018-08-06 18:17:21 -0400
committerAndrew Sun2018-08-06 18:17:21 -0400
commit507a881e5ea1816ef51218904255878b722bf7b9 (patch)
tree4ba546fe5ac58453b60c115c7acf5531a5023546
parent6789b053468bb300f1582e9129348a697f154d0b (diff)
downloadaur-507a881e5ea1816ef51218904255878b722bf7b9.tar.gz
mingw-w64-python: update to 3.7.0
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD234
-rw-r--r--patches.tar.gzbin58549 -> 52857 bytes
-rw-r--r--wine-python.sh14
4 files changed, 233 insertions, 32 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2384496edffc..1e7857b3b6f2 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,13 @@
pkgbase = mingw-w64-python
pkgdesc = Next generation of the python high-level scripting language (mingw-w64)
- pkgver = 3.6.3
+ pkgver = 3.7.0
pkgrel = 1
url = http://www.python.org/
arch = any
license = PSF
makedepends = mingw-w64-configure
- makedepends = mingw-w64-gcc
- makedepends = mingw-w64-pkg-config
+ makedepends = mingw-w64-wine
+ makedepends = python
depends = mingw-w64-crt
depends = mingw-w64-expat
depends = mingw-w64-bzip2
@@ -19,15 +19,18 @@ pkgbase = mingw-w64-python
depends = mingw-w64-tk
depends = mingw-w64-zlib
depends = mingw-w64-xz
+ depends = mingw-w64-mpdecimal
depends = mingw-w64-sqlite
- depends = wine
+ optdepends = mingw-w64-wine: runtime support
options = staticlibs
options = !buildflags
options = !strip
- source = http://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
+ source = http://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
source = patches.tar.gz
- sha1sums = 6c71b14bdbc4d8aa0cfd59d4b6dc356d46abfdf5
- sha1sums = f058e3caa8c5b0b37b9adfa413846a051ae558c6
+ source = wine-python.sh
+ sha1sums = 653cffa5b9f2a28150afe4705600d2e55d89b564
+ sha1sums = a16075f44a5222b7b32471aacd6444b60528a620
+ sha1sums = a024e7fd7eea7984a0d050164a4a015dea762da7
pkgname = mingw-w64-python
diff --git a/PKGBUILD b/PKGBUILD
index 0f951ee8ba2f..851706fdcc11 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,8 +4,8 @@
# Contributor: Dr-Shadow <kerdiles.robin@gmail.com>
pkgname=mingw-w64-python
-pkgver=3.6.3
-_pybasever=3.6
+pkgver=3.7.0
+_pybasever=3.7
pkgrel=1
pkgdesc="Next generation of the python high-level scripting language (mingw-w64)"
arch=('any')
@@ -22,29 +22,179 @@ depends=('mingw-w64-crt'
'mingw-w64-tk'
'mingw-w64-zlib'
'mingw-w64-xz'
- 'mingw-w64-sqlite'
- 'wine')
+ 'mingw-w64-mpdecimal'
+ 'mingw-w64-sqlite')
-makedepends=('mingw-w64-configure' 'mingw-w64-gcc' 'mingw-w64-pkg-config')
+makedepends=('mingw-w64-configure' 'mingw-w64-wine' 'python')
+optdepends=('mingw-w64-wine: runtime support')
options=('staticlibs' '!buildflags' '!strip')
-
source=("http://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz"
- 'patches.tar.gz')
-sha1sums=('6c71b14bdbc4d8aa0cfd59d4b6dc356d46abfdf5'
- 'f058e3caa8c5b0b37b9adfa413846a051ae558c6')
+ 'patches.tar.gz'
+ "wine-python.sh")
+sha1sums=('653cffa5b9f2a28150afe4705600d2e55d89b564'
+ 'a16075f44a5222b7b32471aacd6444b60528a620'
+ 'a024e7fd7eea7984a0d050164a4a015dea762da7')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+# Helper macros to help make tasks easier #
+apply_patch_with_msg() {
+ for _patch in "$@"
+ do
+ msg2 "Applying ${_patch}"
+ patch -Nbp1 -i "${srcdir}/${pkgver}/${_patch}"
+ done
+}
+
+del_file_exists() {
+ for _fname in "$@"
+ do
+ if [ -f ${_fname} ]; then
+ rm -rf ${_fname}
+ fi
+ done
+}
+# =========================================== #
+
prepare() {
cd "${srcdir}/Python-${pkgver}"
# these are created by patches
- rm -f Misc/config_mingw Misc/cross_mingw32 Python/fileblocks.c
+ rm -f Misc/config_mingw \
+ Misc/cross_mingw32 \
+ Modules/Setup.config.in \
+ Python/fileblocks.c
- PATCHES=$(find "${srcdir}/${pkgver}" -maxdepth 1 -name "*.patch" | sort)
- for PATCH in $PATCHES; do
- patch -Np1 -i $PATCH
- done
+ plain "Apply Ray Donnelly's should-be-upstreamed patches"
+ apply_patch_with_msg \
+ 0000-make-_sysconfigdata.py-relocatable.patch \
+ 0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch \
+ 0002-restore-setup-config.patch
+
+ plain "Apply Roumen Petrov's core patches (10)"
+ apply_patch_with_msg \
+ 0100-MINGW-BASE-use-NT-thread-model.patch \
+ 0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch \
+ 0130-MINGW-configure-MACHDEP-and-platform-for-build.patch \
+ 0140-MINGW-preset-configure-defaults.patch \
+ 0150-MINGW-configure-largefile-support-for-windows-builds.patch \
+ 0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch \
+ 0180-MINGW-init-system-calls.patch \
+ 0200-MINGW-build-in-windows-modules-winreg.patch \
+ 0210-MINGW-determine-if-pwdmodule-should-be-used.patch \
+ 0230-MINGW-AC_LIBOBJ-replacement-of-fileblocks.patch
+
+ plain "Apply Roumen Petrov's compiler patch (2)"
+ apply_patch_with_msg \
+ 0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch \
+ 0260-MINGW-compiler-enable-new-dtags.patch
+
+ plain "Apply Roumen Petrov's extensions patches (21)"
+ apply_patch_with_msg \
+ 0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch \
+ 0300-MINGW-configure-for-shared-build.patch \
+ 0310-MINGW-dynamic-loading-support.patch \
+ 0330-MINGW-ignore-main-program-for-frozen-scripts.patch \
+ 0340-MINGW-setup-exclude-termios-module.patch \
+ 0350-MINGW-setup-_multiprocessing-module.patch \
+ 0360-MINGW-setup-select-module.patch \
+ 0370-MINGW-setup-_ctypes-module-with-system-libffi.patch \
+ 0380-MINGW-defect-winsock2-and-setup-_socket-module.patch \
+ 0390-MINGW-exclude-unix-only-modules.patch \
+ 0400-MINGW-setup-msvcrt-and-_winapi-modules.patch \
+ 0410-MINGW-build-extensions-with-GCC.patch \
+ 0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch \
+ 0430-MINGW-find-import-library.patch \
+ 0440-MINGW-setup-_ssl-module.patch \
+ 0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch \
+ 0462-MINGW-support-stdcall-without-underscore.patch \
+ 0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch \
+ 0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch \
+ 0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch \
+ 0490-MINGW-customize-site.patch
+
+ plain "Apply Ray Donnelly's general/cross patches (42)"
+ apply_patch_with_msg \
+ 0500-add-python-config-sh.patch \
+ 0510-cross-darwin-feature.patch \
+ 0520-py3k-mingw-ntthreads-vs-pthreads.patch \
+ 0530-mingw-system-libffi.patch \
+ 0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch \
+ 0560-mingw-use-posix-getpath.patch \
+ 0565-mingw-add-ModuleFileName-dir-to-PATH.patch \
+ 0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch
+ # 0610- changed to not using -DVPATH='"$(VPATH_b2h)"' anymore since VPATH is
+ # relative, therefore getpath.c:355: joinpath(prefix, vpath) works naturally
+ apply_patch_with_msg \
+ 0610-msys-cygwin-semi-native-build-sysconfig.patch \
+ 0620-mingw-sysconfig-like-posix.patch \
+ 0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch \
+ 0640-mingw-x86_64-size_t-format-specifier-pid_t.patch \
+ 0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch \
+ 0660-mingw-use-backslashes-in-compileall-py.patch \
+ 0670-msys-convert_path-fix-and-root-hack.patch \
+ 0690-allow-static-tcltk.patch
+
+ apply_patch_with_msg \
+ 0720-mingw-pdcurses_ISPAD.patch \
+ 0740-grammar-fixes.patch \
+ 0750-builddir-fixes.patch \
+ 0760-msys-monkeypatch-os-system-via-sh-exe.patch \
+ 0770-msys-replace-slashes-used-in-io-redirection.patch \
+ 0800-mingw-install-layout-as-posix.patch \
+ 0810-remove_path_max.default.patch \
+ 0820-dont-link-with-gettext.patch \
+ 0830-ctypes-python-dll.patch \
+ 0840-gdbm-module-includes.patch \
+ 0845-3.7-_abs-mingw.patch \
+ 0850-use-gnu_printf-in-format.patch \
+ 0870-mingw-fix-ssl-dont-use-enum_certificates.patch \
+ 0890-mingw-build-optimized-ext.patch \
+ 0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch \
+ 0910-fix-using-dllhandle-and-winver-mingw.patch \
+ 0920-mingw-add-LIBPL-to-library-dirs.patch \
+ 0930-mingw-w64-build-overlapped-module.patch \
+ 0940-mingw-w64-Also-define-_Py_BEGIN_END_SUPPRESS_IPH-when-Py_BUILD_CORE_MODULE.patch \
+ 0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch \
+ 0990-MINGW-link-with-additional-library.patch \
+ 1010-install-msilib.patch
+
+ plain "New patches added for the update from 3.5.3 to 3.6.1"
+ apply_patch_with_msg \
+ 1620-fix-signal-module-build.patch \
+ 1630-build-winconsoleio.patch \
+ 1650-expose-sem_unlink.patch
+
+ # Extend some isatty calls to check for mintty when checking for
+ # a terminal output.
+ # https://github.com/Alexpux/MINGW-packages/issues/2645
+ # https://github.com/Alexpux/MINGW-packages/issues/2656
+ apply_patch_with_msg \
+ 1700-cygpty-isatty.patch
+
+ # gdbm is broken and as a result breaks dbm/shelve.
+ # Don't include it so the dbm.dumb backend is used instead,
+ # like with the official CPython build.
+ apply_patch_with_msg \
+ 1701-disable-broken-gdbm-module.patch
+
+ # https://github.com/Alexpux/MINGW-packages/issues/3139
+ apply_patch_with_msg \
+ 1800-link-win-resource-files-and-build-pythonw.patch
+
+ apply_patch_with_msg \
+ 1810-3.7-mpdec-mingw.patch \
+ 1830-mingw-implement-setenv-for-PY_COERCE_C_LOCALE.patch \
+ 1840-fix-building-core-modules.patch \
+ 1850-disable-readline.patch \
+ 1860-fix-isselectable.patch
+
+ apply_patch_with_msg 2000-warnings-fixes.patch
+
+ # fix case
+ sed -e "s|MSTcpIP.h|mstcpip.h|g" -i ${srcdir}/Python-${pkgver}/Modules/socketmodule.h
+ sed -e "s|Windows.h|windows.h|g" -i ${srcdir}/Python-${pkgver}/Modules/_io/_iomodule.c
+ sed -e "s|VersionHelpers.h|versionhelpers.h|g" -i ${srcdir}/Python-${pkgver}/Modules/socketmodule.c
autoreconf -vfi
@@ -60,7 +210,7 @@ prepare() {
# Ensure that we are using the system copy of various libraries (expat, zlib and libffi),
# rather than copies shipped in the tarball
rm -r Modules/expat
- rm -r Modules/zlib
+ # rm -r Modules/zlib
rm -r Modules/_ctypes/{darwin,libffi}*
}
@@ -70,8 +220,8 @@ build() {
for _arch in ${_architectures}; do
mkdir -p "build-${_arch}" && pushd "build-${_arch}"
- CFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 "
- CXXFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1"
+ CFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601"
+ CXXFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601"
CPPFLAGS+=" -I/usr/${_arch}/include/ncursesw "
declare -a _extra_config
@@ -91,7 +241,7 @@ build() {
fi
# Workaround for conftest error on 64-bit builds
-export ac_cv_working_tzset=no
+ export ac_cv_working_tzset=no
# export LIBFFI_INCLUDEDIR=`${_arch}-pkg-config libffi --cflags-only-I | sed "s|\-I||g"`
CFLAGS+="-I/usr/${_arch}/include" \
@@ -99,15 +249,24 @@ export ac_cv_working_tzset=no
CPPFLAGS+="-I/usr/${_arch}/include" \
LDFLAGS+="-L/usr/${_arch}/lib" \
${_arch}-configure \
- --with-threads=win32 \
+ --with-nt-threads \
--with-computed-gotos \
--with-system-expat \
--with-system-ffi \
+ --with-system-libmpdec \
--without-ensurepip \
"${_extra_config[@]}" \
OPT=""
-
+
+ # append ${_arch} to windres
+ sed -e "s|windres|${_arch}-windres|g" -i ${srcdir}/Python-${pkgver}/build-${_arch}/Makefile
+
make
+
+ # wrappers
+ sed "s|@TRIPLE@|${_arch}|g;s|@PYVER@|${_pybasever}|g" "${srcdir}"/wine-python.sh > ${_arch}-python${_pybasever}
+ sed "s|@TRIPLE@|${_arch}|g;s|@PYVER@|${_pybasever}|g" "${srcdir}"/wine-python.sh > ${_arch}-python3
+ sed "s|@TRIPLE@|${_arch}|g;s|@PYVER@|${_pybasever}|g" "${srcdir}"/wine-python.sh > ${_arch}-python
popd
done
}
@@ -159,11 +318,36 @@ package() {
"${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/_sysconfigdata*.py \
"${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/smtpd.py
- # Correct name of _sysconfigdata_m_win32_.py
- mv -f "${pkgdir}/usr/${_arch}"/lib/python3.6/_sysconfigdata_m_win_.py "${pkgdir}/usr/${_arch}"/lib/python3.6/_sysconfigdata_m_win32_.py
+ # Doing sysconfig relocatable as patch 0000 do it only partially
+ sed -e "s/sys.prefix + //g" \
+ -e "s/'\/bin'/sys.prefix + '\/bin'/g" \
+ -e "s/'\/include\//sys.prefix + '\/include\//g" \
+ -e "s/'\/include /sys.prefix + '\/include /g" \
+ -e "s/'\/include'/sys.prefix + '\/include'/g" \
+ -e "s/ \/include\// ' + sys.prefix + '\/include\//g" \
+ -e "s/ \/include / ' + sys.prefix + '\/include /g" \
+ -e "s/'\/lib\//sys.prefix + '\/lib\//g" \
+ -e "s/'\/lib /sys.prefix + '\/lib /g" \
+ -e "s/'\/lib'/sys.prefix + '\/lib'/g" \
+ -e "s/ \/lib\// ' + sys.prefix + '\/lib\//g" \
+ -e "s/ \/lib / ' + sys.prefix + '\/lib /g" \
+ -e "s/'\/share\//sys.prefix + '\/share\//g" \
+ -e "s/'\/share'/sys.prefix + '\/share'/g" \
+ -i "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/_sysconfigdata*.py
+
+ # Correct name of _sysconfigdata_m_win32_.py and copy it to lib-dynload
+ cp -f "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/_sysconfigdata_m_win_.py "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/_sysconfigdata_m_win32_.py
+ cp -f "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/_sysconfigdata_m_win32_.py "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/lib-dynload/_sysconfigdata_m_win32_.py
- # Create python executable with windows subsystem
- cp -f "${pkgdir}/usr/${_arch}"/bin/python3.exe "${pkgdir}/usr/${_arch}"/bin/python3w.exe
- /usr/${_arch}/bin/objcopy --subsystem windows "${pkgdir}/usr/${_arch}"/bin/python3w.exe
+ # install wrappers
+ mkdir -p ${pkgdir}/usr/bin
+ install -m755 ${_arch}-python${_pybasever} "${pkgdir}"/usr/bin/${_arch}-python${_pybasever}
+ install -m755 ${_arch}-python3 "${pkgdir}"/usr/bin/${_arch}-python3
+ install -m755 ${_arch}-python "${pkgdir}"/usr/bin/${_arch}-python
+
+ ln -s "/usr/${_arch}/bin/python${_pybasever}.exe" "${pkgdir}/usr/${_arch}/bin/python.exe"
+ ln -s "/usr/${_arch}/bin/python3-config" "${pkgdir}/usr/${_arch}/bin/python-config"
+ ln -s "/usr/${_arch}/bin/idle3" "${pkgdir}/usr/${_arch}/bin/idle"
+ ln -s "/usr/${_arch}/bin/pydoc3" "${pkgdir}/usr/${_arch}/bin/pydoc"
done
}
diff --git a/patches.tar.gz b/patches.tar.gz
index 03ee930216cf..afc5ec8eee8e 100644
--- a/patches.tar.gz
+++ b/patches.tar.gz
Binary files differ
diff --git a/wine-python.sh b/wine-python.sh
new file mode 100644
index 000000000000..83601211eb50
--- /dev/null
+++ b/wine-python.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+export PYTHONHOME=/usr/@TRIPLE@
+
+if test -z "${PYTHONPATH}"
+then
+ export PYTHONPATH=/usr/@TRIPLE@/lib/python@PYVER@
+else
+ export PYTHONPATH="${PYTHONPATH};/usr/@TRIPLE@/lib/python@PYVER@"
+fi
+
+@TRIPLE@-wine /usr/@TRIPLE@/bin/python@PYVER@.exe "$@"