Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 1.4 kB view raw
1commit d8e0bac0c0d831510683939ec7a7b5bd72192423 2Author: Frederik Rietdijk <fridh@fridh.nl> 3Date: Sat Jan 5 11:38:28 2019 +0100 4 5 Have a top-level attribute for the executable 6 7diff --git a/pkgconfig/pkgconfig.py b/pkgconfig/pkgconfig.py 8index 3deb97f..e7c5561 100644 9--- a/pkgconfig/pkgconfig.py 10+++ b/pkgconfig/pkgconfig.py 11@@ -30,6 +30,9 @@ from functools import wraps 12 from subprocess import call, PIPE, Popen 13 14 15+PKG_CONFIG_EXE = "pkg-config" 16+ 17+ 18 def _compare_versions(v1, v2): 19 """ 20 Compare two version strings and return -1, 0 or 1 depending on the equality 21@@ -65,7 +68,7 @@ def _convert_error(func): 22 23 @_convert_error 24 def _query(package, *options): 25- pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config' 26+ pkg_config_exe = os.environ.get('PKG_CONFIG', None) or PKG_CONFIG_EXE 27 cmd = '{0} {1} {2}'.format(pkg_config_exe, ' '.join(options), package) 28 proc = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE) 29 out, err = proc.communicate() 30@@ -84,7 +87,7 @@ def exists(package): 31 32 If ``pkg-config`` not on path, raises ``EnvironmentError``. 33 """ 34- pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config' 35+ pkg_config_exe = os.environ.get('PKG_CONFIG', None) or PKG_CONFIG_EXE 36 cmd = '{0} --exists {1}'.format(pkg_config_exe, package).split() 37 return call(cmd) == 0 38