8000 add LibpngConfig · matplotlib/matplotlib@89c582d · GitHub
[go: up one dir, main page]

Skip to content

Commit 89c582d

Browse files
committed
add LibpngConfig
1 parent ad7336a commit 89c582d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

setupext.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,29 @@ def get_version(self, package):
401401
return None
402402

403403

404+
class LibpngConfig(Configurator):
405+
406+
def setup_extension(self, ext, package, **kw):
407+
"""Add parameters to the given `ext` for the given `package`."""
408+
if package != 'freetype2':
409+
raise RuntimeError('package must be "freetype2"')
410+
package = ''
411+
return super(LibpngConfig, self).setup_extension(ext, package, **kw)
412+
413+
def get_version(self, package):
414+
if package != 'libpng':
415+
raise RuntimeError('package must be libpng')
416+
417+
status, output = getstatusoutput('libpng-config --version')
418+
if status == 0:
419+
return output
420+
return None
404421

405422

406423
# The PkgConfig/FreetypeConfig class should be used through singletons
407424
pkg_config = PkgConfig('pkg-config')
408425
ft_config = FreetypeConfig('freetype-config')
426+
png_config = LibpngConfig('libpng-config')
409427

410428

411429
class CheckFailed(Exception):

0 commit comments

Comments
 (0)
0