diff --git a/mingw-w64-python-matplotlib/PKGBUILD b/mingw-w64-python-matplotlib/PKGBUILD index 7289f6247d..e18e350536 100644 --- a/mingw-w64-python-matplotlib/PKGBUILD +++ b/mingw-w64-python-matplotlib/PKGBUILD @@ -2,8 +2,11 @@ _realname=matplotlib pkgbase=mingw-w64-python-${_realname} -pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") -pkgver=1.5.3 +pkgname=( + "${MINGW_PACKAGE_PREFIX}-python2-${_realname}" + "${MINGW_PACKAGE_PREFIX}-python3-${_realname}" + ) +pkgver=2.0.0 pkgrel=1 pkgdesc="A python plotting library, making publication quality plots (mingw-w64)" arch=('any') @@ -27,13 +30,15 @@ makedepends=( "${MINGW_PACKAGE_PREFIX}-freetype" "${MINGW_PACKAGE_PREFIX}-libpng" #"${MINGW_PACKAGE_PREFIX}-qhull" -) -source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/matplotlib/matplotlib/archive/v${pkgver}.tar.gz" - setupext.py.patch - setup.py.patch) -sha256sums=('c72276afc11f0b77cee736a783861039c0284d2e4739de8ca09d2dd1407745aa' - 'dd3f49ab7dfffb4771add36685f0df1d93fb186166e6c08ec72c16f315f3af93' - '17e4353062e165dfe54293e39d8924355a4a3c44f2ffee3739d7cc7bddc9c699') + ) +source=( + "${_realname}-${pkgver}.tar.gz"::"https://github.com/matplotlib/matplotlib/archive/v${pkgver}.tar.gz" + setupext.py.patch + setup.py.patch + ) +sha256sums=('966a0807bc961726a68e5b60b6e97c91eed6ba20e0d50dfd699a8f854b2d7370' + 'ae811b10d1ada6af030f0a6670e5726fe451f6049464ad3de1e9019e853e394e' + 'd3fb3a35cb95baad3ff2ec813328fc0864ecfb29e575d3f132960e9ee8521fe3') noextract=("${_realname}-${pkgver}.tar.gz") prepare() { @@ -130,3 +135,5 @@ package_mingw-w64-x86_64-python2-matplotlib() { package_mingw-w64-x86_64-python3-matplotlib() { package_python3-matplotlib } + +# vim:set ts=2 sw=2 et: diff --git a/mingw-w64-python-matplotlib/setup.py.patch b/mingw-w64-python-matplotlib/setup.py.patch index 548dfc505b..41d787c34b 100644 --- a/mingw-w64-python-matplotlib/setup.py.patch +++ b/mingw-w64-python-matplotlib/setup.py.patch @@ -1,6 +1,6 @@ ---- old/setup.py 2014-08-26 04:24:27.000000000 +0200 -+++ new/setup.py 2014-09-18 23:28:32.597091000 +0200 -@@ -97,7 +97,7 @@ +--- matplotlib-2.0.0/setup.py.orig 2017-02-15 14:08:45 +0900 ++++ matplotlib-2.0.0/setup.py 2017-02-15 14:09:26 +0900 +@@ -103,7 +103,7 @@ setupext.BackendGtk3Agg(), setupext.BackendGtk3Cairo(), setupext.BackendGtkAgg(), diff --git a/mingw-w64-python-matplotlib/setupext.py.patch b/mingw-w64-python-matplotlib/setupext.py.patch index d45d561640..9692deeead 100644 --- a/mingw-w64-python-matplotlib/setupext.py.patch +++ b/mingw-w64-python-matplotlib/setupext.py.patch @@ -1,21 +1,22 @@ ---- matplotlib-1.5.3/setupext.py.orig 2016-09-09 05:50:50.000000000 +0300 -+++ matplotlib-1.5.3/setupext.py 2016-09-23 13:10:33.239264300 +0300 -@@ -19,6 +19,7 @@ +--- matplotlib-2.0.0/setupext.py.orig 2017-02-15 14:30:26 +0900 ++++ matplotlib-2.0.0/setupext.py 2017-02-15 14:30:37 +0900 +@@ -21,6 +21,8 @@ + PY3min = (sys.version_info[0] >= 3) - PY32min = (PY3min and sys.version_info[1] >= 2 or sys.version_info[0] > 3) +MSYS = "MSYSTEM" in os.environ ++ - try: - from subprocess import check_output -@@ -46,9 +47,16 @@ - return output - + def _get_home(): + """Find user's home directory if possible. +@@ -68,9 +70,17 @@ + # md5 hash of the freetype tarball + LOCAL_FREETYPE_HASH = '348e667d728c597360e4a87c16556597' -if sys.platform != 'win32': +if sys.platform != 'win32' or MSYS: if not PY3min: -- from commands import getstatusoutput + from commands import getstatusoutput + def getstatusoutput(cmd): + """Return (status, output) of executing cmd in a shell.""" + pipe = os.popen(cmd, 'r') @@ -27,7 +28,7 @@ else: from subprocess import getstatusoutput -@@ -126,9 +134,10 @@ +@@ -148,9 +158,10 @@ Returns `True` if `filename` can be found in one of the directories in `include_dirs`. """ @@ -39,7 +40,7 @@ if os.path.exists(os.path.join(dir, filename)): return True return False -@@ -239,6 +248,7 @@ +@@ -261,6 +272,7 @@ """ ext = DelayedExtension(name, files, *args, **kwargs) for dir in get_base_dirs(): @@ -47,15 +48,7 @@ include_dir = os.path.join(dir, 'include') if os.path.exists(include_dir): ext.include_dirs.append(include_dir) -@@ -247,7 +257,6 @@ - if os.path.exists(lib_dir): - ext.library_dirs.append(lib_dir) - ext.include_dirs.append('.') -- - return ext - - -@@ -259,7 +268,7 @@ +@@ -296,7 +308,7 @@ """ Determines whether pkg-config exists on this machine. """ @@ -64,16 +57,16 @@ self.has_pkgconfig = False else: try: -@@ -268,7 +277,7 @@ +@@ -305,7 +317,7 @@ self.pkg_config = 'pkg-config' self.set_pkgconfig_path() - status, output = getstatusoutput(self.pkg_config + " --help") -+ status, output = getstatusoutput('sh -c "'+self.pkg_config+' --help"') ++ status, output = getstatusoutput('sh -c "' + self.pkg_config + ' --help"') self.has_pkgconfig = (status == 0) if not self.has_pkgconfig: print("IMPORTANT WARNING:") -@@ -309,7 +318,7 @@ +@@ -346,7 +358,7 @@ command = "{0} --libs --cflags ".format(executable) try: @@ -82,18 +75,17 @@ stderr=subprocess.STDOUT) except subprocess.CalledProcessError: pass -@@ -319,11 +328,16 @@ +@@ -356,11 +368,16 @@ for token in output.split(): attr = flag_map.get(token[:2]) if attr is not None: - getattr(ext, attr).insert(0, token[2:]) -- + if attr.endswith('dirs'): + dir = os.popen(' '.join(['cygpath', '-w', token[2:]])).readline().strip() + getattr(ext, attr).insert(0, dir) + else: + getattr(ext, attr).insert(0, token[2:]) -+ + if use_defaults: basedirs = get_base_dirs() for base in basedirs: @@ -101,19 +93,19 @@ for include in default_include_dirs: dir = os.path.join(base, include) if os.path.exists(dir): -@@ -345,7 +359,7 @@ +@@ -382,7 +399,7 @@ return None status, output = getstatusoutput( - self.pkg_config + " %s --modversion" % (package)) -+ 'sh -c "'+self.pkg_config+' %s --modversion"' % (package)) ++ 'sh -c "' + self.pkg_config + ' %s --modversion"' % (package)) if status == 0: return output return None -@@ -897,11 +911,11 @@ - name = "freetype" +@@ -958,11 +975,11 @@ + if options.get('local_freetype'): + return "Using local version for testing" - def check(self): - if sys.platform == 'win32': + if sys.platform == 'win32' and not MSYS: check_include_file(get_include_dirs(), 'ft2build.h', 'freetype') @@ -124,15 +116,16 @@ if status == 0: version = output else: -@@ -926,6 +940,7 @@ +@@ -987,6 +1004,8 @@ return version # Return the first version found in the include dirs. for include_dir in ext.include_dirs: -+ include_dir = os.popen(' '.join(['cygpath', '-w', include_dir])).readline().strip() ++ include_dir = os.popen(' '.join(['cygpath', '-w', include_dir])).readline().st ++ rip() header_fname = os.path.join(include_dir, 'freetype.h') if os.path.exists(header_fname): major, minor, patch = 0, 0, 0 -@@ -972,11 +987,11 @@ +@@ -1136,11 +1155,11 @@ name = "png" def check(self): @@ -146,7 +139,7 @@ if status == 0: version = output else: -@@ -1368,7 +1383,7 @@ +@@ -1602,7 +1621,7 @@ return ext def add_flags(self, ext): @@ -155,7 +148,7 @@ def getoutput(s): ret = os.popen(s).read().strip() return ret -@@ -1423,7 +1438,7 @@ +@@ -1657,7 +1676,7 @@ 'm' in ext.libraries): ext.libraries.remove('m') @@ -164,7 +157,7 @@ pkg_config.setup_extension(ext, 'pygtk-2.0') pkg_config.setup_extension(ext, 'gtk+-2.0') -@@ -1830,7 +1845,7 @@ +@@ -2060,7 +2079,7 @@ def check(self): try: @@ -173,25 +166,24 @@ stderr=subprocess.STDOUT) return "version %s" % output.splitlines()[1].decode().split()[-1] except (IndexError, ValueError, subprocess.CalledProcessError): -@@ -1843,7 +1858,7 @@ +@@ -2072,14 +2091,14 @@ + optional = True def check(self): - try: -- if sys.platform == 'win32': -+ if sys.platform == 'win32' and not MSYS: - command = 'gswin32c --version' - try: - output = check_output(command, shell=True, -@@ -1853,7 +1868,7 @@ - output = check_output(command, shell=True, - stderr=subprocess.STDOUT) - else: -- command = 'gs --version' -+ command = 'sh -c "gs --version"' +- if sys.platform == 'win32': ++ if sys.platform == 'win32' and not MSYS: + # mgs is the name in miktex + gs_execs = ['gswin32c', 'gswin64c', 'mgs', 'gs'] + else: + gs_execs = ['gs'] + for gs_exec in gs_execs: + try: +- command = gs_exec + ' --version' ++ command = 'sh -c "%s --version"' % gs_exec output = check_output(command, shell=True, stderr=subprocess.STDOUT) - return "version %s" % output.decode()[:-1] -@@ -1867,7 +1882,7 @@ + return "version %s" % output.decode()[:-1] +@@ -2095,7 +2114,7 @@ def check(self): try: @@ -200,7 +192,7 @@ stderr=subprocess.STDOUT) line = output.splitlines()[0].decode() pattern = '(3\.1\d+)|(MiKTeX \d+.\d+)' -@@ -1883,7 +1898,7 @@ +@@ -2111,7 +2130,7 @@ def check(self): try: