summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Sun2017-11-15 23:34:48 +0000
committerAndrew Sun2017-11-15 23:34:48 +0000
commit64ffb1218e52c0b1fee1e7e964a8279a38d0dc28 (patch)
tree1191261005a1601398f37b1516e7f0c8ce2a95cb
parent459fcd699af51b7b74e0788aac7d549708620c1e (diff)
downloadaur-64ffb1218e52c0b1fee1e7e964a8279a38d0dc28.tar.gz
mingw-w64-python2: update to 2.7.14
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD129
-rw-r--r--patches.tar.gzbin48671 -> 58940 bytes
3 files changed, 109 insertions, 35 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9ed3e17cd9d8..0ed151c924a8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,28 +1,31 @@
pkgbase = mingw-w64-python2
pkgdesc = A high-level scripting language (mingw-w64)
- pkgver = 2.7.9
+ pkgver = 2.7.14
pkgrel = 1
url = http://www.python.org/
arch = any
license = PSF
makedepends = mingw-w64-gcc
makedepends = mingw-w64-pkg-config
- makedepends = python2>=2.7.9
+ makedepends = mingw-w64-configure
+ makedepends = python2>=2.7.14
makedepends = wine
depends = mingw-w64-crt
depends = mingw-w64-expat
depends = mingw-w64-bzip2
- depends = mingw-w64-gdbm
+ depends = mingw-w64-ncurses
depends = mingw-w64-openssl
depends = mingw-w64-libffi
+ depends = mingw-w64-tcl
+ depends = mingw-w64-tk
depends = mingw-w64-zlib
options = staticlibs
options = !buildflags
options = !strip
- source = http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
+ source = http://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz
source = patches.tar.gz
- sha1sums = 3172f6e957713c2d9fca462cc16068222fd1b9d3
- sha1sums = c02170ef8291c56d4ab4978363761eb985da4ea3
+ sha1sums = cf146474fc988b4b6b53fdd81b71c2815873b469
+ sha1sums = fa7bedb476ef593e87f2613d3dc029a1174c350e
pkgname = mingw-w64-python2
diff --git a/PKGBUILD b/PKGBUILD
index 132e058ed710..c9a62c241e27 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
# Contributor: Ray Donnelly <mingw.android@gmail.com>
pkgname=mingw-w64-python2
-pkgver=2.7.9
+pkgver=2.7.14
_pybasever=2.7
pkgrel=1
pkgdesc="A high-level scripting language (mingw-w64)"
@@ -13,23 +13,31 @@ url="http://www.python.org/"
depends=('mingw-w64-crt'
'mingw-w64-expat'
'mingw-w64-bzip2'
- 'mingw-w64-gdbm'
+ 'mingw-w64-ncurses'
'mingw-w64-openssl'
'mingw-w64-libffi'
+ 'mingw-w64-tcl'
+ 'mingw-w64-tk'
'mingw-w64-zlib')
-makedepends=('mingw-w64-gcc' 'mingw-w64-pkg-config' "python2>=${pkgver}" 'wine')
+makedepends=('mingw-w64-gcc' 'mingw-w64-pkg-config' 'mingw-w64-configure' "python2>=${pkgver}" 'wine')
options=('staticlibs' '!buildflags' '!strip')
source=("http://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz"
'patches.tar.gz')
-sha1sums=('3172f6e957713c2d9fca462cc16068222fd1b9d3'
- 'c02170ef8291c56d4ab4978363761eb985da4ea3')
+sha1sums=('cf146474fc988b4b6b53fdd81b71c2815873b469'
+ 'fa7bedb476ef593e87f2613d3dc029a1174c350e')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd "${srcdir}/Python-${pkgver}"
# these are created by patches
- rm -f Modules/_ctypes/libffi_msvc/win32.S Python/fileblocks.c Misc/python-config.sh.in
+ 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 \
+ Lib/list2cmdline.py
PATCHES=$(find "${srcdir}/${pkgver}" -maxdepth 1 -name "*.patch" | sort)
for PATCH in $PATCHES; do
@@ -40,10 +48,6 @@ prepare() {
sed -i "s|\\\$(PGEN) \\\$(GRAMMAR_INPUT)|wine \\\$(PGEN) \\\$(GRAMMAR_INPUT)|g" Makefile.pre.in
autoreconf -vfi
-
- # Temporary workaround for FS#22322
- # See http://bugs.python.org/issue10835 for upstream report
- sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c
# Enable built-in SQLite module to load extensions (fix FS#22122)
sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
@@ -54,6 +58,15 @@ prepare() {
sed -i "s/python2.3/python2/g" Lib/distutils/tests/test_build_scripts.py \
Lib/distutils/tests/test_install_scripts.py Tools/scripts/gprof2html.py
+ touch Include/graminit.h
+ touch Python/graminit.c
+ touch Parser/Python.asdl
+ touch Parser/asdl.py
+ touch Parser/asdl_c.py
+ touch Include/Python-ast.h
+ touch Python/Python-ast.c
+ echo \"\" > Parser/pgen.stamp
+
# 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
@@ -65,17 +78,49 @@ build() {
cd "${srcdir}/Python-${pkgver}"
unset LDFLAGS
for _arch in ${_architectures}; do
+
+ declare -a extra_config
+
+ CFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 "
+ CXXFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 "
+ CPPFLAGS+=" -I/usr/${_arch}/include/ncursesw "
+
+ if check_option "strip" "y"; then
+ LDFLAGS+=" -s "
+ fi
+
+ # Most of this is unnecessary, perhaps just
+ # the extra_config bit?
+ if check_option "debug" "n"; then
+ CFLAGS+=" -DNDEBUG "
+ CXXFLAGS+=" -DNDEBUG "
+ else
+ CFLAGS+=" -DDEBUG -DPy_DEBUG -D_DEBUG "
+ CXXFLAGS+=" -DDEBUG -DPy_DEBUG -D_DEBUG "
+ extra_config+=("--with-pydebug")
+ fi
+
+ # Workaround for conftest error on 64-bit builds
+ export ac_cv_working_tzset=no
+
mkdir -p "build-${_arch}" && pushd "build-${_arch}"
export LIBFFI_INCLUDEDIR=`${_arch}-pkg-config libffi --cflags-only-I | sed "s|\-I||g"`
- ../configure \
+
+ CFLAGS+="-I/usr/${_arch}/include" \
+ CXXFLAGS+="-I/usr/${_arch}/include" \
+ CPPFLAGS+="-I/usr/${_arch}/include" \
+ LDFLAGS+="-L/usr/${_arch}/lib" \
+ ${_arch}-configure \
--prefix=/usr/${_arch} \
--host=${_arch} \
--build=$CHOST \
--enable-shared \
- --with-threads \
+ --with-threads=win32 \
--with-system-expat \
- --with-dbmliborder=gdbm:ndbm \
- --with-system-ffi
+ --with-system-ffi \
+ "${extra_config[@]}" \
+ OPT=""
+ #--with-dbmliborder='gdbm:ndbm'
make
popd
done
@@ -85,20 +130,46 @@ package() {
for _arch in ${_architectures}; do
cd "${srcdir}/Python-${pkgver}/build-${_arch}"
make install DESTDIR="$pkgdir"
- chmod 755 "$pkgdir"/usr/${_arch}/bin/*.dll
- install -m 644 libpython${_pybasever}.a "$pkgdir"/usr/${_arch}/lib
- install -m 644 libpython${_pybasever}.dll.a "$pkgdir"/usr/${_arch}/lib
- rm -rf "$pkgdir"/usr/${_arch}/share
- rm "$pkgdir"/usr/${_arch}/bin/*.sh
- rm "$pkgdir"/usr/${_arch}/bin/2to3
- rm "$pkgdir"/usr/${_arch}/bin/python-config*
- rm "$pkgdir"/usr/${_arch}/bin/idle
- rm "$pkgdir"/usr/${_arch}/bin/pydoc
- rm "$pkgdir"/usr/${_arch}/bin/python.exe
- mv "${pkgdir}"/usr/${_arch}/bin/smtpd.py "${pkgdir}"/usr/${_arch}/lib/python${_pybasever}/
- rm "${pkgdir}"/usr/${_arch}/lib/pkgconfig/python.pc
- ${_arch}-strip "$pkgdir"/usr/${_arch}/bin/*.exe
- ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
- ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
+ mv "${pkgdir}/usr/${_arch}"/bin/smtpd.py "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/
+
+ [[ -d "${pkgdir}/usr/${_arch}"/share/gdb/python2/ ]] || mkdir -p "${pkgdir}/usr/${_arch}"/share/gdb/python2/
+ cp -f python.exe-gdb.py "${pkgdir}/usr/${_arch}"/share/gdb/python2/python_gdb.py
+
+ rm "${pkgdir}/usr/${_arch}"/bin/2to3
+
+ # Copy python import library to $prefix/lib because some programs can't find it in other locations
+ cp -f "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/config/libpython${_pybasever}.dll.a "${pkgdir}/usr/${_arch}"/lib/libpython${_pybasever}.dll.a
+
+ # some useful "stuff"
+ install -dm755 "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/Tools/{i18n,scripts}
+ install -m755 "${srcdir}/Python-${pkgver}"/Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/Tools/i18n/
+ install -m755 "${srcdir}/Python-${pkgver}"/Tools/scripts/{README,*py} "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/Tools/scripts/
+
+ # clean up #!s
+ find "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/ -name '*.py' | \
+ xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python2|"
+
+ # clean-up reference to build directory
+ sed -i "s#${srcdir}/Python-${pkgver}:##" "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/config/Makefile
+
+ for fscripts in idle pydoc; do
+ sed -e "s|/usr/${_arch}/bin/|/usr/bin/env |g" -i "${pkgdir}/usr/${_arch}"/bin/$fscripts
+ done
+
+ sed -i "s|#!${pkgdir}/usr/${_arch}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}/usr/${_arch}"/bin/python${_pybasever}-config
+ sed -i "s|#!${pkgdir}/usr/${_arch}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}/usr/${_arch}"/bin/python2-config
+ sed -i "s|#!${pkgdir}/usr/${_arch}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}/usr/${_arch}"/bin/python-config
+
+ # fix permissons
+ find ${pkgdir}/usr/${_arch} -type f \( -name "*.dll" -o -name "*.exe" \) | xargs chmod 0755
+
+ # replace paths in sysconfig
+ sed -i "s|${pkgdir}/usr/${_arch}|/usr/${_arch}|g" \
+ "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/_sysconfigdata.py \
+ "${pkgdir}/usr/${_arch}"/lib/python${_pybasever}/smtpd.py
+
+ # Create python executable with windows subsystem
+ cp -f "${pkgdir}/usr/${_arch}"/bin/python2.exe "${pkgdir}/usr/${_arch}"/bin/python2w.exe
+ /usr/${_arch}/bin/objcopy --subsystem windows "${pkgdir}/usr/${_arch}"/bin/python2w.exe
done
}
diff --git a/patches.tar.gz b/patches.tar.gz
index c38f8c6a04dd..3879551e44e1 100644
--- a/patches.tar.gz
+++ b/patches.tar.gz
Binary files differ