|
| 1 | +diff --git a/setup.py b/setup.py |
| 2 | +index a8d1c965a..7032cea16 100644 |
| 3 | +--- a/setup.py |
| 4 | ++++ b/setup.py |
| 5 | +@@ -408,6 +408,7 @@ class BuildConfiguration: |
| 6 | + self.extra_objects = [] |
| 7 | + self.static_extension = False |
| 8 | + self.use_pkgconfig = False |
| 9 | ++ self._pkgconfig_bin = None |
| 10 | + self.use_sanitizers = False |
| 11 | + self.c_core_built = False |
| 12 | + self.allow_educated_guess = True |
| 13 | +@@ -422,8 +423,18 @@ class BuildConfiguration: |
| 14 | + and it knows about igraph or not.""" |
| 15 | + if self._has_pkgconfig is None: |
| 16 | + if self.use_pkgconfig: |
| 17 | +- _, exit_code = get_output_single_line(["pkg-config", "igraph"]) |
| 18 | +- self._has_pkgconfig = exit_code == 0 |
| 19 | ++ exit_code = None |
| 20 | ++ for pkgconfig_bin in ["pkg-config", "pkgconf"]: |
| 21 | ++ _, exit_code = get_output_single_line([pkgconfig_bin, "igraph"]) |
| 22 | ++ if exit_code == 0: |
| 23 | ++ self._pkgconfig_bin = pkgconfig_bin |
| 24 | ++ break |
| 25 | ++ if exit_code == 0: |
| 26 | ++ print(f"Detected {self._pkgconfig_bin} as pkg-config variant.") |
| 27 | ++ self._has_pkgconfig = True |
| 28 | ++ else: |
| 29 | ++ print("Not detected any pkg-config variant.") |
| 30 | ++ self._has_pkgconfig = False |
| 31 | + else: |
| 32 | + self._has_pkgconfig = False |
| 33 | + return self._has_pkgconfig |
| 34 | +@@ -731,7 +742,7 @@ class BuildConfiguration: |
| 35 | + if not buildcfg.has_pkgconfig: |
| 36 | + return False |
| 37 | + |
| 38 | +- cmd = ["pkg-config", "igraph", "--cflags", "--libs"] |
| 39 | ++ cmd = [self._pkgconfig_bin, "igraph", "--cflags", "--libs"] |
| 40 | + if self.static_extension: |
| 41 | + cmd += ["--static"] |
| 42 | + line, exit_code = get_output_single_line(cmd) |
0 commit comments