Skip to content

Commit b04b2e4

Browse files
committed
Add a patch to fix win build without vendoring igraph
1 parent 1bd16f8 commit b04b2e4

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff -ruN python-igraph-0.11.9/setup.py python-igraph-0.11.9-patch/setup.py
2+
--- python-igraph-0.11.9/setup.py 2025-06-11 02:02:53.000000000 +0200
3+
+++ python-igraph-0.11.9-patch/setup.py 2025-10-13 15:31:02.911638088 +0200
4+
@@ -742,6 +742,21 @@
5+
self.libraries = [opt[2:] for opt in opts if opt.startswith("-l")]
6+
self.library_dirs = [opt[2:] for opt in opts if opt.startswith("-L")]
7+
self.include_dirs = [opt[2:] for opt in opts if opt.startswith("-I")]
8+
+
9+
+ # On Windows with MSVC, conda-forge import libraries are typically named
10+
+ # with a lib prefix (e.g. libxml2.lib, liblzma.lib, libiconv.lib), while
11+
+ # pkg-config emits xml2, lzma, iconv (and sometimes z for zlib).
12+
+ # Remap these to the expected names and drop unsupported ones.
13+
+ if building_on_windows_msvc():
14+
+ remap = {
15+
+ "xml2": "libxml2",
16+
+ "lzma": "liblzma",
17+
+ "iconv": "libiconv",
18+
+ "z": "zlib",
19+
+ }
20+
+ self.libraries = [remap.get(lib, lib) for lib in self.libraries]
21+
+ # Remove libraries not meaningful for MSVC builds if present
22+
+ self.libraries = [lib for lib in self.libraries if lib not in ("pthread", "gomp")]
23+
return True
24+
25+
def print_build_info(self) -> None:

recipe/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ source:
1212
fn: {{ name }}-{{ version }}.tar.gz
1313
url: https://pypi.org/packages/source/{{ pypiname[0] }}/{{ pypiname }}/{{ pypiname }}-{{ version }}.tar.gz
1414
sha256: c57ce44873abcfcfd1d61d7d261e416d352186958e7b5d299cf244efa6757816
15+
patches:
16+
- 0001-win-unvendor-igraph.patch # [win]
1517

1618
build:
1719
number: 3

0 commit comments

Comments
 (0)