Skip to content
Permalink
Browse files

py-matplotlib: use qhull installed by MacPorts

Currently matplotlib will always use its vendored qhull version, since
pkg-config does not find the package installed by MacPorts due to a
missing .pc file.

Patch taken from:
fedora-python/matplotlib@5d4c2d0
  • Loading branch information
reneeotten authored and pmetzger committed Oct 11, 2018
1 parent b62652a commit f8d10c64bde7895fd70509e7488d6e631606f287
Showing with 30 additions and 1 deletion.
  1. +2 −1 python/py-matplotlib/Portfile
  2. +28 −0 python/py-matplotlib/files/patch-qhull.diff
@@ -57,7 +57,8 @@ if {${name} ne ${subport}} {

patchfiles-append patch-setup.cfg.diff \
patch-setupext.py.diff \
patch-src-macosx.m.diff
patch-src-macosx.m.diff \
patch-qhull.diff

build.env PKG_CONFIG_PATH="${python.prefix}/lib/pkgconfig"

@@ -0,0 +1,28 @@
--- setupext.py.orig 2018-10-03 09:21:43.000000000 -0400
+++ setupext.py 2018-10-03 09:23:36.000000000 -0400
@@ -1318,23 +1318,10 @@

def check(self):
self.__class__.found_external = True
- try:
- return self._check_for_pkg_config(
- 'libqhull', 'libqhull/qhull_a.h', min_version='2015.2')
- except CheckFailed as e:
- self.__class__.found_pkgconfig = False
- self.__class__.found_external = False
- return str(e) + ' Using local copy.'
+ return ' Using copy installed by MacPorts.'

def add_flags(self, ext):
- if self.found_external:
- pkg_config.setup_extension(ext, 'qhull',
- default_libraries=['qhull'])
- else:
- ext.include_dirs.insert(0, 'extern')
- ext.sources.extend(sorted(glob.glob('extern/libqhull/*.c')))
- if sysconfig.get_config_var('LIBM') == '-lm':
- ext.libraries.extend('m')
+ ext.libraries.append('qhull')


class TTConv(SetupPackage):

0 comments on commit f8d10c6

Please sign in to comment.
You can’t perform that action at this time.