Skip to content

Commit f43725e

Browse files
committed
build geos from source on windows
1 parent 8b721dc commit f43725e

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@ env:
55
CIBW_BUILD_VERBOSITY: 1
66
PYTHONUNBUFFERED: "1"
77
PYTHONWARNINGS: "ignore:DEPRECATION"
8-
9-
on:
10-
push:
11-
paths:
12-
- ".github/workflows/**"
13-
- "packages/basemap/**"
14-
pull_request:
15-
paths:
16-
- ".github/workflows/**"
17-
- "packages/basemap/**"
18-
workflow_dispatch:
8+
GEOS_VERSION: "3.6.5"
199

2010
jobs:
2111
build_wheels:
@@ -39,8 +29,16 @@ jobs:
3929
4030
- name: Install GEOS (Windows)
4131
if: runner.os == 'Windows'
32+
shell: bash
4233
run: |
43-
choco install geos
34+
wget https://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2
35+
tar xjf geos-${GEOS_VERSION}.tar.bz2
36+
cd geos-${GEOS_VERSION}
37+
mkdir build
38+
cd build
39+
cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/geos-install ..
40+
cmake --build . --config Release --target install
41+
echo "GEOS_DIR=$GITHUB_WORKSPACE/geos-install" >> $GITHUB_ENV
4442
4543
- name: Install GEOS (macOS)
4644
if: runner.os == 'macOS'
@@ -60,9 +58,14 @@ jobs:
6058
CIBW_SKIP: "pp* *-musllinux*"
6159
CIBW_BEFORE_BUILD: >
6260
pip install --upgrade pip &&
63-
pip install numpy>=1.21.4 cython>=0.29.21 &&
64-
python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)"
65-
CIBW_ENVIRONMENT: >
61+
pip install numpy>=1.21.4 cython>=0.29.21
62+
CIBW_ENVIRONMENT_WINDOWS: >
63+
GEOS_DIR=${{ env.GEOS_DIR }}
64+
SETUPTOOLS_USE_DISTUTILS=stdlib
65+
CIBW_ENVIRONMENT_LINUX: >
66+
GEOS_DIR={project}/extern
67+
SETUPTOOLS_USE_DISTUTILS=stdlib
68+
CIBW_ENVIRONMENT_MACOS: >
6669
GEOS_DIR={project}/extern
6770
SETUPTOOLS_USE_DISTUTILS=stdlib
6871
CIBW_TEST_COMMAND: >

0 commit comments

Comments
 (0)