Skip to content

Commit d7c6a08

Browse files
committed
Use pkgconf instead of pkg-config
1 parent c89a5ff commit d7c6a08

File tree

2 files changed

+44
-24
lines changed

2 files changed

+44
-24
lines changed

recipe/0001-allow-pkgconf.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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)

recipe/meta.yaml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,10 @@ source:
1313
url: https://pypi.org/packages/source/{{ pypiname[0] }}/{{ pypiname }}/{{ pypiname }}-{{ version }}.tar.gz
1414
sha256: c57ce44873abcfcfd1d61d7d261e416d352186958e7b5d299cf244efa6757816
1515
patches:
16-
- 0001-win-unvendor-igraph.patch # [win]
16+
- 0001-allow-pkgconf.patch
1717

1818
build:
1919
number: 3
20-
ignore_run_exports_from:
21-
- igraph
22-
- arpack # [win]
23-
- glpk # [win]
24-
- gmp # [win]
25-
- libblas # [win]
26-
- libiconv # [win]
27-
- liblapack # [win]
28-
- liblzma-devel # [win]
29-
- libxml2-devel # [win]
30-
- zlib # [win]
3120

3221
requirements:
3322
build:
@@ -36,23 +25,12 @@ requirements:
3625
- {{ compiler('c') }}
3726
- {{ stdlib("c") }}
3827
- {{ compiler('cxx') }}
39-
- pkg-config
28+
- pkgconf
4029
host:
4130
- python
4231
- pip
4332
- setuptools >=64,<72.2.0
4433
- igraph {{ igraph_version }}
45-
# Windows requires additional libs for pkg-config to work because igraph.pc
46-
# lists them in Libs
47-
- arpack # [win]
48-
- glpk # [win]
49-
- gmp # [win]
50-
- libblas # [win]
51-
- libiconv # [win]
52-
- liblapack # [win]
53-
- liblzma-devel # [win]
54-
- libxml2-devel # [win]
55-
- zlib # [win]
5634
run:
5735
- python
5836
- igraph {{ igraph_version }}

0 commit comments

Comments
 (0)