Skip to content

Commit

Permalink
Conda: fix numpy detection for python 3.12.5 + numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Aug 11, 2024
1 parent 3ab5eae commit c9c4e09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ci/travis/conda/install_python.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/recipe/install_python.sh b/recipe/install_python.sh
index 9cdaa2c..48d4ad2 100644
--- a/recipe/install_python.sh
+++ b/recipe/install_python.sh
@@ -10,8 +10,11 @@ rm -rf swig/python

Python_LOOKUP_VERSION=$($PYTHON -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor)+'.'+str(sys.version_info.micro))")

+Python_NumPy_INCLUDE_DIR=$($PYTHON -c "import numpy; print(numpy.get_include())")
+
cmake "-UPython*" "-U*LATER_PLUGIN" \
-DPython_LOOKUP_VERSION=${Python_LOOKUP_VERSION} \
+ -DPython_NumPy_INCLUDE_DIR=${Python_NumPy_INCLUDE_DIR} \
-DBUILD_PYTHON_BINDINGS:BOOL=ON \
${SRC_DIR} || (cat CMakeFiles/CMakeError.log;false)

1 change: 1 addition & 0 deletions ci/travis/conda/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ git clone https://github.com/conda-forge/gdal-feedstock.git
cd gdal-feedstock

patch -p1 < ../ci/travis/conda/meta.yaml.patch
patch -p1 < ../ci/travis/conda/install_python.sh.patch

cat > recipe/recipe_clobber.yaml <<EOL
source:
Expand Down

0 comments on commit c9c4e09

Please sign in to comment.