diff --git a/mingw-w64-python-numpy/1.0.4-fenv.patch b/mingw-w64-python-numpy/1.0.4-fenv.patch deleted file mode 100644 index d72bce7b5e..0000000000 --- a/mingw-w64-python-numpy/1.0.4-fenv.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- numpy-1.0.4/numpy/core/include/numpy/fenv/fenv.c.orig 2007-11-07 16:05:15.000000000 -0600 -+++ numpy-1.0.4/numpy/core/include/numpy/fenv/fenv.c 2007-11-29 22:29:31.513750000 -0600 -@@ -26,6 +26,9 @@ - * $FreeBSD$ - */ - -+#ifndef NUMPY_FENV_C -+#define NUMPY_FENV_C -+ - #include - #include "fenv.h" - -@@ -36,3 +39,5 @@ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff } - }; -+ -+#endif /* NUMPY_FENV_C */ diff --git a/mingw-w64-python-numpy/PKGBUILD b/mingw-w64-python-numpy/PKGBUILD index 95dba46042..59e4e83639 100644 --- a/mingw-w64-python-numpy/PKGBUILD +++ b/mingw-w64-python-numpy/PKGBUILD @@ -2,9 +2,10 @@ # Contributor: Ray Donnelly _realname=numpy +pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") -pkgver=1.9.2 -pkgrel=3 +pkgver=1.10.0 +pkgrel=1 pkgdesc="Scientific tools for Python (mingw-w64)" arch=('any') license=('BSD') @@ -17,28 +18,34 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-openblas" "${MINGW_PACKAGE_PREFIX}-gcc-fortran") options=('staticlibs' 'strip' '!debug') source=(http://downloads.sourceforge.net/numpy/${_realname}-${pkgver}.tar.gz + detect-mingw-environment.patch fix-finding-python2.patch gfortran-better-version-check.patch fix-testsuite.patch - 1.0.4-fenv.patch) -md5sums=('a1ed53432dbcd256398898d35bc8e645' - '6f03968645956c24216763b6ccce609d' - '58aff1fb52401458bfd6a03c9b3b5e32' + mincoming-stack-boundary-only-32bit.patch + disable-visualcompaq-for-mingw.patch) +md5sums=('116c65ae392e9b50aad713f42158f32a' + 'e2c63f8472ea162d442beb9f05441f9d' + 'c9e172056f09052d17cf8162b9cf5b3a' + 'f4a729b29154f1fde5ffe911beef5984' '59c4e9b71cc7b297099b4430bcb7ea28' - 'c0a280441fff1a8c15a11d7e567f2544') + 'abc51ef8452d30fd83c69eb183425b16' + 'c4fd82349f2c2c9352ae666b91b7ceea') prepare() { cd ${_realname}-${pkgver} + patch -Np1 -i ${srcdir}/detect-mingw-environment.patch patch -Np1 -i ${srcdir}/fix-finding-python2.patch patch -Np1 -i ${srcdir}/gfortran-better-version-check.patch patch -Np1 -i ${srcdir}/fix-testsuite.patch - patch -Np1 -i ${srcdir}/1.0.4-fenv.patch + patch -Np1 -i ${srcdir}/mincoming-stack-boundary-only-32bit.patch + patch -Np1 -i ${srcdir}/disable-visualcompaq-for-mingw.patch cd .. - cp -a numpy-${pkgver} numpy-py2-${pkgver}-${CARCH} - cp -a numpy-${pkgver} numpy-py3-${pkgver}-${CARCH} + cp -a numpy-${pkgver} ${_realname}-py2-${CARCH} + cp -a numpy-${pkgver} ${_realname}-py3-${CARCH} - cd numpy-py2-${pkgver}-${CARCH} + cd ${_realname}-py2-${CARCH} sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \ @@ -50,12 +57,12 @@ build() { export LDFLAGS="$LDFLAGS -shared" echo "Building Python2" - cd numpy-py2-${pkgver}-${CARCH} + cd ${_realname}-py2-${CARCH} MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python2 setup.py config_fc --fcompiler=gnu95 build echo "Building Python3" - cd ../numpy-py3-${pkgver}-${CARCH} + cd ../${_realname}-py3-${CARCH} MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python3 setup.py config_fc --fcompiler=gnu95 build } @@ -69,7 +76,7 @@ package_python2-numpy() { export ATLAS=None export LDFLAGS="$LDFLAGS -shared" - cd numpy-py2-${pkgver}-${CARCH} + cd ${_realname}-py2-${CARCH} MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python2 setup.py config_fc --fcompiler=gnu95 install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 @@ -90,13 +97,13 @@ package_python3-numpy() { depends=("${MINGW_PACKAGE_PREFIX}-openblas" "${MINGW_PACKAGE_PREFIX}-python3") optdepends=("${MINGW_PACKAGE_PREFIX}-python3-nose: testsuite") - _pyver=3.4 - _pyinc=3.4m + _pyver=3.5 + _pyinc=${_pyver}m export ATLAS=None export LDFLAGS="$LDFLAGS -shared" - cd numpy-py3-${pkgver}-${CARCH} + cd ${_realname}-py3-${CARCH} MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python3 setup.py config_fc --fcompiler=gnu95 install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 diff --git a/mingw-w64-python-numpy/detect-mingw-environment.patch b/mingw-w64-python-numpy/detect-mingw-environment.patch new file mode 100644 index 0000000000..62bfc375a1 --- /dev/null +++ b/mingw-w64-python-numpy/detect-mingw-environment.patch @@ -0,0 +1,21 @@ +--- numpy-1.10.0/numpy/distutils/misc_util.py.orig 2015-10-08 15:20:14.760758300 +0300 ++++ numpy-1.10.0/numpy/distutils/misc_util.py 2015-10-08 15:21:22.951938500 +0300 +@@ -13,6 +13,7 @@ + + import distutils + from distutils.errors import DistutilsError ++from sysconfig import _POSIX_BUILD + try: + from threading import local as tlocal + except ImportError: +@@ -385,6 +386,10 @@ + return True + if os.environ.get('MSYSTEM', '')=='MINGW32': + return True ++ if os.environ.get('MSYSTEM', '')=='MINGW64': ++ return True ++ if _POSIX_BUILD: ++ return True + return False + + def msvc_runtime_library(): diff --git a/mingw-w64-python-numpy/disable-visualcompaq-for-mingw.patch b/mingw-w64-python-numpy/disable-visualcompaq-for-mingw.patch new file mode 100644 index 0000000000..0f61b4c558 --- /dev/null +++ b/mingw-w64-python-numpy/disable-visualcompaq-for-mingw.patch @@ -0,0 +1,29 @@ +--- numpy-1.10.0/numpy/distutils/fcompiler/compaq.py.orig 2015-10-08 14:58:05.495698100 +0300 ++++ numpy-1.10.0/numpy/distutils/fcompiler/compaq.py 2015-10-08 14:59:02.712975800 +0300 +@@ -4,13 +4,14 @@ + + import os + import sys ++from sysconfig import _POSIX_BUILD + + from numpy.distutils.fcompiler import FCompiler + from numpy.distutils.compat import get_exception + from distutils.errors import DistutilsPlatformError + + compilers = ['CompaqFCompiler'] +-if os.name != 'posix' or sys.platform[:6] == 'cygwin' : ++if (os.name != 'posix' or sys.platform[:6] == 'cygwin') and not _POSIX_BUILD : + # Otherwise we'd get a false positive on posix systems with + # case-insensitive filesystems (like darwin), because we'll pick + # up /bin/df +--- numpy-1.10.0/numpy/distutils/msvccompiler.py.orig 2015-10-08 15:14:33.374900300 +0300 ++++ numpy-1.10.0/numpy/distutils/msvccompiler.py 2015-10-08 15:14:40.886149100 +0300 +@@ -10,7 +10,7 @@ + def initialize(self, plat_name=None): + environ_lib = os.getenv('lib') + environ_include = os.getenv('include') +- distutils.msvccompiler.MSVCCompiler.initialize(self, plat_name) ++ distutils.msvccompiler.MSVCCompiler.initialize(self) + if environ_lib is not None: + os.environ['lib'] = environ_lib + os.environ['lib'] + if environ_include is not None: diff --git a/mingw-w64-python-numpy/fix-finding-python2.patch b/mingw-w64-python-numpy/fix-finding-python2.patch index d21541d247..d84aeb892d 100644 --- a/mingw-w64-python-numpy/fix-finding-python2.patch +++ b/mingw-w64-python-numpy/fix-finding-python2.patch @@ -1,30 +1,38 @@ ---- numpy-py2-1.8.0/numpy/distutils/mingw32ccompiler.py 2014-02-19 01:07:43.787600000 +0400 -+++ numpy-1.8.0/numpy/distutils/mingw32ccompiler.py 2014-02-19 01:26:21.634200000 +0400 -@@ -86,22 +86,6 @@ - self.linker = 'g++' - - # **changes: eric jones 4/11/01 -- # 1. Check for import library on Windows. Build if it doesn't exist. +--- numpy-py2-1.10.0/numpy/distutils/mingw32ccompiler.py 2014-02-19 01:07:43.787600000 +0400 ++++ numpy-1.10.0/numpy/distutils/mingw32ccompiler.py 2014-02-19 01:26:21.634200000 +0400 +@@ -91,30 +91,6 @@ + stdout=subprocess.PIPE) + out_string = p.stdout.read() + p.stdout.close() - -- build_import_library() +- # Before build with MinGW-W64 generate the python import library +- # with gendef and dlltool according to the MingW-W64 FAQ. +- # Use the MinGW-W64 provided msvc runtime import libraries. +- # Don't call build_import_library() and build_msvcr_library. - -- # Check for custom msvc runtime library on Windows. Build if it doesn't exist. -- msvcr_success = build_msvcr_library() -- msvcr_dbg_success = build_msvcr_library(debug=True) -- if msvcr_success or msvcr_dbg_success: -- # add preprocessor statement for using customized msvcr lib -- self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR') +- if 'MinGW-W64' not in str(out_string): +- +- # **changes: eric jones 4/11/01 +- # 1. Check for import library on Windows. Build if it doesn't +- # exist. +- build_import_library() +- +- # Check for custom msvc runtime library on Windows. Build if it +- # doesn't exist. +- msvcr_success = build_msvcr_library() +- msvcr_dbg_success = build_msvcr_library(debug=True) +- if msvcr_success or msvcr_dbg_success: +- # add preprocessor statement for using customized msvcr lib +- self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR') - - # Define the MSVC version as hint for MinGW - msvcr_version = '0x%03i0' % int(msvc_runtime_library().lstrip('msvcr')) - self.define_macro('__MSVCRT_VERSION__', msvcr_version) -- -- # **changes: eric jones 4/11/01 - # 2. increased optimization and turned off all warnings - # 3. also added --driver-name g++ - #self.set_executables(compiler='gcc -mno-cygwin -O2 -w', ---- numpy-py2-1.8.0/numpy/distutils/fcompiler/gnu.py 2014-02-19 01:27:32.252800000 +0400 -+++ numpy-1.8.0/numpy/distutils/fcompiler/gnu.py 2014-02-19 01:31:29.804200000 +0400 + + # MS_WIN64 should be defined when building for amd64 on windows, + # but python headers define it only for MS compilers, which has all +--- numpy-py2-1.10.0/numpy/distutils/fcompiler/gnu.py 2014-02-19 01:27:32.252800000 +0400 ++++ numpy-1.10.0/numpy/distutils/fcompiler/gnu.py 2014-02-19 01:31:29.804200000 +0400 @@ -6,6 +6,7 @@ import warnings import platform @@ -33,7 +41,7 @@ from subprocess import Popen, PIPE, STDOUT from numpy.distutils.cpuinfo import cpu -@@ -86,7 +87,7 @@ +@@ -103,7 +103,7 @@ pic_flags = ['-fPIC'] # use -mno-cygwin for g77 when Python is not Cygwin-Python @@ -42,26 +50,3 @@ for key in ['version_cmd', 'compiler_f77', 'linker_so', 'linker_exe']: executables[key].append('-mno-cygwin') -@@ -238,7 +239,7 @@ - pass - else: - # use -mno-cygwin flag for gfortran when Python is not Cygwin-Python -- if sys.platform == 'win32': -+ if sys.platform == 'win32' and not _POSIX_BUILD: - for key in ['version_cmd', 'compiler_f77', 'compiler_f90', - 'compiler_fix', 'linker_so', 'linker_exe']: - self.executables[key].append('-mno-cygwin') -@@ -328,13 +328,6 @@ - i = opt.index("gcc") - opt.insert(i+1, "mingwex") - opt.insert(i+1, "mingw32") -- # XXX: fix this mess, does not work for mingw -- if is_win64(): -- c_compiler = self.c_compiler -- if c_compiler and c_compiler.compiler_type == "msvc": -- return [] -- else: -- raise NotImplementedError("Only MS compiler supported with gfortran on win64") - return opt - - def get_target(self): diff --git a/mingw-w64-python-numpy/gfortran-better-version-check.patch b/mingw-w64-python-numpy/gfortran-better-version-check.patch index e8626c0a3f..ceb1c6d685 100644 --- a/mingw-w64-python-numpy/gfortran-better-version-check.patch +++ b/mingw-w64-python-numpy/gfortran-better-version-check.patch @@ -1,11 +1,11 @@ ---- numpy-1.8.2/numpy/distutils/fcompiler/gnu.py.orig 2014-08-28 15:49:10.742000000 +0400 -+++ numpy-1.8.2/numpy/distutils/fcompiler/gnu.py 2014-08-28 15:50:44.903600000 +0400 -@@ -42,7 +42,7 @@ - m = re.search(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) - if m: - return ('gfortran', m.group(1)) -- m = re.search(r'GNU Fortran.*?\-?([0-9-.]+)', version_string) -+ m = re.search(r'GNU Fortran.*?\-?(\d*(?:\.\d+)+)', version_string) - if m: - v = m.group(1) - if v.startswith('0') or v.startswith('2') or v.startswith('3'): +--- numpy-1.10.0/numpy/distutils/fcompiler/gnu.py.orig 2014-08-28 15:49:10.742000000 +0400 ++++ numpy-1.10.0/numpy/distutils/fcompiler/gnu.py 2014-08-28 15:50:44.903600000 +0400 +@@ -63,7 +63,7 @@ + m = re.search(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) + if m: + return ('gfortran', m.group(1)) +- m = re.search(r'GNU Fortran.*?\-?([0-9-.]+)', version_string) ++ m = re.search(r'GNU Fortran.*?\-?(\d*(?:\.\d+)+)', version_string) + if m: + v = m.group(1) + if v.startswith('0') or v.startswith('2') or v.startswith('3'): diff --git a/mingw-w64-python-numpy/mincoming-stack-boundary-only-32bit.patch b/mingw-w64-python-numpy/mincoming-stack-boundary-only-32bit.patch new file mode 100644 index 0000000000..444ddf82d4 --- /dev/null +++ b/mingw-w64-python-numpy/mincoming-stack-boundary-only-32bit.patch @@ -0,0 +1,71 @@ +--- numpy-1.10.0/numpy/distutils/mingw32ccompiler.py.orig 2015-10-08 14:37:03.956864600 +0300 ++++ numpy-1.10.0/numpy/distutils/mingw32ccompiler.py 2015-10-08 14:44:27.194536400 +0300 +@@ -13,6 +13,7 @@ + import sys + import subprocess + import re ++import platform + + # Overwrite certain distutils.ccompiler functions: + import numpy.distutils.ccompiler +@@ -41,6 +42,11 @@ + _START = re.compile(r'\[Ordinal/Name Pointer\] Table') + _TABLE = re.compile(r'^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)') + ++def is_win64(): ++ return sys.platform == "win32" and platform.architecture()[0] == "64bit" ++def is_win32(): ++ return sys.platform == "win32" and platform.architecture()[0] == "32bit" ++ + # the same as cygwin plus some additional parameters + class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler): + """ A modified MingW32 compiler compatible with an MSVC built Python. +@@ -130,19 +136,35 @@ + linker_exe='g++ -mno-cygwin', + linker_so='g++ -mno-cygwin -shared') + else: +- # gcc-4 series releases do not support -mno-cygwin option i686 +- # build needs '-mincoming-stack-boundary=2' due to ABI +- # incompatibility to Win32 ABI +- self.set_executables( +- compiler='gcc -O2 -march=core2 -mtune=generic' +- ' -mfpmath=sse -msse2' +- ' -mincoming-stack-boundary=2 -Wall', +- compiler_so='gcc -O2 -march=core2 -mtune=generic' +- ' -mfpmath=sse -msse2' +- ' -mincoming-stack-boundary=2 -Wall' +- ' -Wstrict-prototypes', +- linker_exe='g++ ', +- linker_so='g++ -shared -Wl,-gc-sections -Wl,-s') ++ if is_win32(): ++ # gcc-4 series releases do not support -mno-cygwin option i686 ++ # build needs '-mincoming-stack-boundary=2' due to ABI ++ # incompatibility to Win32 ABI ++ self.set_executables( ++ compiler='gcc -O2 -march=core2 -mtune=generic' ++ ' -mfpmath=sse -msse2' ++ ' -mincoming-stack-boundary=2 -Wall', ++ compiler_so='gcc -O2 -march=core2 -mtune=generic' ++ ' -mfpmath=sse -msse2' ++ ' -mincoming-stack-boundary=2 -Wall' ++ ' -Wstrict-prototypes', ++ linker_exe='g++ ', ++ linker_so='g++ -shared -Wl,-gc-sections -Wl,-s') ++ else: ++ # gcc-4 series releases do not support -mno-cygwin option i686 ++ # build needs '-mincoming-stack-boundary=2' due to ABI ++ # incompatibility to Win32 ABI ++ self.set_executables( ++ compiler='gcc -O2 -march=x86-64 -DMS_WIN64 -mtune=generic' ++ ' -mfpmath=sse -msse2' ++ ' -Wall', ++ compiler_so='gcc -O2 -march=x86-64 -DMS_WIN64 -mtune=generic' ++ ' -mfpmath=sse -msse2' ++ ' -Wall' ++ ' -Wstrict-prototypes', ++ linker_exe='g++ ', ++ linker_so='g++ -shared -Wl,-gc-sections -Wl,-s') ++ + # added for python2.3 support we can't pass it through set_executables + # because pre 2.2 would fail + self.compiler_cxx = ['g++']