summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrejbasket <39080670+rejbasket@users.noreply.github.com>2024-02-21 16:01:47 +0100
committerGitHub <noreply@github.com>2024-02-21 16:01:47 +0100
commit9b3950137db88715ac55d1e9bebc9aea2db4e83e (patch)
tree8fb187aeb59cc3062586952dfbedba4e64c0c14d
parent3a697187ffbde982377394fc4caace852f00a819 (diff)
Build with shapely with geos 3.12.x (#2732)
authored-by: rejbasket
-rw-r--r--.github/workflows/build.yml15
-rw-r--r--bin/build-distribution-archives15
-rwxr-xr-xbin/build-geos-win.cmd29
-rwxr-xr-xbin/build-linux-dist24
4 files changed, 67 insertions, 16 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0e6726b3..8d8667de 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -86,7 +86,7 @@ jobs:
echo "${{ env.pythonLocation }}\bin" >> $GITHUB_PATH
- shell: bash
run: |
- make dist
+ bin/build-linux-dist
env:
BUILD: linux
INKSTITCH_GPG_KEY: ${{ secrets.INKSTITCH_GPG_KEY }}
@@ -128,6 +128,11 @@ jobs:
python -m pip install pyinstaller
echo "${{ env.pythonLocation }}\bin" >> $GITHUB_PATH
+ - name: install geos 32
+ shell: cmd
+ run: |
+ SET BUILD32="1"
+ bin\build-geos-win.cmd
- shell: bash
run: |
make dist
@@ -180,6 +185,10 @@ jobs:
python -m pip install pyinstaller
echo "${{ env.pythonLocation }}\bin" >> $GITHUB_PATH
+ - name: install geos 64
+ shell: cmd
+ run: |
+ bin\build-geos-win.cmd
- shell: bash
run: |
make dist
@@ -239,6 +248,10 @@ jobs:
# for networkx
pip install pandas
pip install pyarrow
+ # remove and build shapely with brew geos version
+ pip uninstall -y shapely
+ pip cache remove shapely
+ pip install -v shapely --no-binary shapely
pip install pyinstaller
diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives
index 285e5ef8..3565e3f5 100644
--- a/bin/build-distribution-archives
+++ b/bin/build-distribution-archives
@@ -8,21 +8,6 @@ if [ "$BUILD" = "osx" ]; then
# adding version to Info.plist
plutil -replace CFBundleShortVersionString -string ${VERSION} dist/inkstitch.app/Contents/Info.plist
rm -rf dist/inkstitch/
- # unlinking the libgeos and dot dylib folder syslinks and fix broken syslinks for notary.
- # copying libgeos dylibs with ditto preserves information to pass notary.
- unlink dist/inkstitch.app/Contents/Resources/shapely/.dylibs
-
- unlink dist/inkstitch.app/Contents/Resources/libgeos.3.11.2.dylib
- unlink dist/inkstitch.app/Contents/Resources/libgeos_c.1.17.2.dylib
-
- unlink dist/inkstitch.app/Contents/Frameworks/libgeos.3.11.2.dylib
- unlink dist/inkstitch.app/Contents/Frameworks/libgeos_c.1.17.2.dylib
-
- ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos.3.11.2.dylib dist/inkstitch.app/Contents/Resources/
- ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos_c.1.17.2.dylib dist/inkstitch.app/Contents/Resources/
-
- ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos.3.11.2.dylib dist/inkstitch.app/Contents/Frameworks/
- ditto dist/inkstitch.app/Contents/Frameworks/shapely/__dot__dylibs/libgeos_c.1.17.2.dylib dist/inkstitch.app/Contents/Frameworks/
# Install location for pkgbuild
PKG_INSTALL_PATH="/tmp/inkstitch/"
# Checking arch of macos and setting path of electron for arm64 or intel
diff --git a/bin/build-geos-win.cmd b/bin/build-geos-win.cmd
new file mode 100755
index 00000000..c2b5d4b7
--- /dev/null
+++ b/bin/build-geos-win.cmd
@@ -0,0 +1,29 @@
+@echo off
+mkdir %CD%\geos-build
+SET GEOS_INSTALL=%CD%\geos-build
+
+if NOT DEFINED BUILD32 (SET BUILDFLAG="x64") else (SET BUILDFLAG="Win32")
+echo %BUILDFLAG%
+
+curl -O https://download.osgeo.org/geos/geos-3.12.1.tar.bz2
+
+7z x geos-3.12.1.tar.bz2
+7z x geos-3.12.1.tar
+
+cd geos-3.12.1
+cmake -S . -B _build -G "Visual Studio 17 2022" -A %BUILDFLAG% -DCMAKE_INSTALL_PREFIX=%GEOS_INSTALL% -DCMAKE_GENERATOR_TOOLSET=host=x64
+
+cmake --build _build --config Release -j 16 --verbose
+cd _build
+cmake --install .
+
+SET PATH=%GEOS_INSTALL%\bin;%PATH%
+SET GEOS_INCLUDE_PATH=%GEOS_INSTALL%\include
+set GEOS_LIBRARY_PATH=%GEOS_INSTALL%\lib
+
+xcopy %GEOS_INSTALL%\bin\geos_c.dll %pythonLocation% /E /H /C /I
+xcopy %GEOS_INSTALL%\bin\geos.dll %pythonLocation% /E /H /C /I
+
+python -m pip uninstall -y shapely
+python -m pip cache remove shapely
+python -m pip install -v shapely --no-binary shapely
diff --git a/bin/build-linux-dist b/bin/build-linux-dist
new file mode 100755
index 00000000..6893e3c1
--- /dev/null
+++ b/bin/build-linux-dist
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# creating folder to install geos
+mkdir $HOME/geos-build
+GEOS_PATH=$HOME/geos-build
+# Downloading geos
+curl -O https://download.osgeo.org/geos/geos-3.12.1.tar.bz2
+
+# uzipping geos
+tar -xf geos-3.12.1.tar.bz2
+cd geos-3.12.1
+# Building geos
+mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=$GEOS_PATH -DCMAKE_BUILD_TYPE=Release ..
+make && make install
+
+export PATH=$GEOS_PATH/bin:$PATH
+export GEOS_INCLUDE_PATH=$GEOS_PATH/include
+export GEOS_LIBRARY_PATH=$GEOS_PATH/lib
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GEOS_PATH/lib
+cd ../..
+python -m pip uninstall -y shapely
+python -m pip cache remove shapely
+python -m pip install -v shapely --no-binary shapely
+make dist
+