summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Sun2018-06-24 08:38:47 -0400
committerAndrew Sun2018-06-24 08:38:47 -0400
commitbca323f12ca20b01fdba8d20e24efc92a8736c24 (patch)
tree5d8b5ef13d0d774127e92727afec22430e563837
parent013a29e9f1917f1b11894372a7478d7e380ac751 (diff)
downloadaur-bca323f12ca20b01fdba8d20e24efc92a8736c24.tar.gz
mingw-w64-python2: add missing patch and minor fixes
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD43
-rw-r--r--descr_ref.patch58
-rw-r--r--patches.tar.gzbin59553 -> 59553 bytes
4 files changed, 95 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ce2c35640bdf..d9853a915a0e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mingw-w64-python2
pkgdesc = A high-level scripting language (mingw-w64)
pkgver = 2.7.15
- pkgrel = 1
+ pkgrel = 2
url = http://www.python.org/
arch = any
license = PSF
@@ -9,7 +9,7 @@ pkgbase = mingw-w64-python2
makedepends = mingw-w64-pkg-config
makedepends = mingw-w64-configure
makedepends = python2>=2.7.15
- makedepends = wine
+ makedepends = mingw-w64-wine
depends = mingw-w64-crt
depends = mingw-w64-expat
depends = mingw-w64-bzip2
@@ -19,13 +19,16 @@ pkgbase = mingw-w64-python2
depends = mingw-w64-tcl
depends = mingw-w64-tk
depends = mingw-w64-zlib
+ depends = mingw-w64-wine
options = staticlibs
options = !buildflags
options = !strip
source = http://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
source = patches.tar.gz
+ source = descr_ref.patch
sha1sums = f99348a095ec4a6411c84c0d15343d11920c9724
- sha1sums = 7bd3d920902d6edfcab4605e5e056342131f1771
+ sha1sums = ecc4f9469bb16c03d860ae1a6f4cc1f6d1ee3bcb
+ sha1sums = 8cc6ac63e909063eb16bbdabc0f0eac7d24ff0c1
pkgname = mingw-w64-python2
diff --git a/PKGBUILD b/PKGBUILD
index 5b71dc622da4..d5989e783a75 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,26 +5,29 @@
pkgname=mingw-w64-python2
pkgver=2.7.15
_pybasever=2.7
-pkgrel=1
+pkgrel=2
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
license=('PSF')
url="http://www.python.org/"
depends=('mingw-w64-crt'
'mingw-w64-expat'
- 'mingw-w64-bzip2'
- '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' 'mingw-w64-configure' "python2>=${pkgver}" 'wine')
+ 'mingw-w64-bzip2'
+ 'mingw-w64-ncurses'
+ 'mingw-w64-openssl'
+ 'mingw-w64-libffi'
+ 'mingw-w64-tcl'
+ 'mingw-w64-tk'
+ 'mingw-w64-zlib'
+ 'mingw-w64-wine')
+makedepends=('mingw-w64-gcc' 'mingw-w64-pkg-config' 'mingw-w64-configure' "python2>=${pkgver}" 'mingw-w64-wine')
options=('staticlibs' '!buildflags' '!strip')
source=("http://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.xz"
- 'patches.tar.gz')
+ 'patches.tar.gz'
+ 'descr_ref.patch')
sha1sums=('f99348a095ec4a6411c84c0d15343d11920c9724'
- '7bd3d920902d6edfcab4605e5e056342131f1771')
+ 'ecc4f9469bb16c03d860ae1a6f4cc1f6d1ee3bcb'
+ '8cc6ac63e909063eb16bbdabc0f0eac7d24ff0c1')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
# Helper macros to help make tasks easier #
@@ -184,6 +187,10 @@ 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
@@ -208,6 +215,17 @@ prepare() {
rm -r Modules/expat
rm -r Modules/zlib
rm -r Modules/_ctypes/{darwin,libffi}*
+
+ # clean up #!s
+ find . -name '*.py' | \
+ xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python2|"
+
+ # Workaround asdl_c.py/makeopcodetargets.py errors after we touched the shebangs
+ touch Include/Python-ast.h Python/Python-ast.c Python/opcode_targets.h
+
+ # FS#48761
+ # http://bugs.python.org/issue25750
+ patch -Np1 -i ../descr_ref.patch
}
build() {
@@ -298,7 +316,8 @@ package() {
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
+ find ${pkgdir}/usr/${_arch} -type f \( -name "*.dll" \) | xargs chmod 0755
+ find ${pkgdir}/usr/${_arch} -type f \( -name "*.exe" \) | xargs chmod 0755
find ${pkgdir}/usr/${_arch} -type f \( -name "*.a" \) | xargs chmod 0755
# replace paths in sysconfig
diff --git a/descr_ref.patch b/descr_ref.patch
new file mode 100644
index 000000000000..b55cf58a2d25
--- /dev/null
+++ b/descr_ref.patch
@@ -0,0 +1,58 @@
+When calling tp_descr_get(self, obj, type), make sure that we own a reference to "self"
+
+diff -ru Python-2.7.9/Objects/typeobject.c Python-2.7.9-fixed//Objects/typeobject.c
+--- Python-2.7.9/Objects/typeobject.c 2014-12-10 16:59:57.000000000 +0100
++++ Python-2.7.9-fixed//Objects/typeobject.c 2015-11-27 20:39:58.276156800 +0100
+@@ -2542,6 +2542,7 @@
+ PyTypeObject *metatype = Py_TYPE(type);
+ PyObject *meta_attribute, *attribute;
+ descrgetfunc meta_get;
++ PyObject* res;
+
+ if (!PyString_Check(name)) {
+ PyErr_Format(PyExc_TypeError,
+@@ -2563,6 +2564,7 @@
+ meta_attribute = _PyType_Lookup(metatype, name);
+
+ if (meta_attribute != NULL) {
++ Py_INCREF(meta_attribute);
+ meta_get = Py_TYPE(meta_attribute)->tp_descr_get;
+
+ if (meta_get != NULL && PyDescr_IsData(meta_attribute)) {
+@@ -2570,10 +2572,11 @@
+ * writes. Assume the attribute is not overridden in
+ * type's tp_dict (and bases): call the descriptor now.
+ */
+- return meta_get(meta_attribute, (PyObject *)type,
++ res = meta_get(meta_attribute, (PyObject *)type,
+ (PyObject *)metatype);
++ Py_DECREF(meta_attribute);
++ return res;
+ }
+- Py_INCREF(meta_attribute);
+ }
+
+ /* No data descriptor found on metatype. Look in tp_dict of this
+@@ -2581,6 +2584,7 @@
+ attribute = _PyType_Lookup(type, name);
+ if (attribute != NULL) {
+ /* Implement descriptor functionality, if any */
++ Py_INCREF(attribute);
+ descrgetfunc local_get = Py_TYPE(attribute)->tp_descr_get;
+
+ Py_XDECREF(meta_attribute);
+@@ -2588,11 +2592,12 @@
+ if (local_get != NULL) {
+ /* NULL 2nd argument indicates the descriptor was
+ * found on the target object itself (or a base) */
+- return local_get(attribute, (PyObject *)NULL,
++ res = local_get(attribute, (PyObject *)NULL,
+ (PyObject *)type);
++ Py_DECREF(attribute);
++ return res;
+ }
+
+- Py_INCREF(attribute);
+ return attribute;
+ }
+
diff --git a/patches.tar.gz b/patches.tar.gz
index e04e2a219ffb..a7585fa48f67 100644
--- a/patches.tar.gz
+++ b/patches.tar.gz
Binary files differ