diff --git a/ports/py-rasterio/no-gdal-config-autodetect.patch b/ports/py-rasterio/no-gdal-config-autodetect.patch new file mode 100644 index 00000000..c1430f3b --- /dev/null +++ b/ports/py-rasterio/no-gdal-config-autodetect.patch @@ -0,0 +1,27 @@ +--- a/setup.py ++++ b/setup.py +@@ -233,24 +233,6 @@ + log.info("GDAL API version obtained from gdal-config: %s", gdalversion) + + if "clean" not in sys.argv: +- try: +- fill_gdal_build_options_using_gdal_config() +- except Exception as e: +- # Try to run gdalinfo and get information from that instead +- log.info( +- "Failed to use gdal-config, trying to run gdalinfo instead (gdal-config error of type %s: %s)", +- type(e).__name__, +- e, +- ) +- try: +- fill_gdal_build_options_using_executable(executable_name="gdalinfo") +- except Exception as e: +- log.warning( +- "Failed to get options via both gdal-config and gdalinfo. (gdalinfo error of type %s: %s)", +- type(e).__name__, +- e, +- ) +- + # Get GDAL API version from environment variable. + if 'GDAL_VERSION' in os.environ: + gdalversion = os.environ['GDAL_VERSION'] diff --git a/ports/py-rasterio/portfile.cmake b/ports/py-rasterio/portfile.cmake index de42567b..1e925e3a 100644 --- a/ports/py-rasterio/portfile.cmake +++ b/ports/py-rasterio/portfile.cmake @@ -34,6 +34,10 @@ library_dirs=${CURRENT_INSTALLED_DIR}/lib libraries=gdal ") +vcpkg_apply_patches(SOURCE_PATH "${SOURCE_PATH}" + PATCHES no-gdal-config-autodetect.patch +) + vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")