From b8f5ff3247b4424e2a9d5a47da4f8541e48c0848 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 26 Jul 2023 19:04:14 +0300 Subject: [PATCH 001/105] gdal: migrate to Conan v2 --- recipes/gdal/post_3.5.0/conandata.yml | 2 - recipes/gdal/post_3.5.0/conanfile.py | 587 +++++++++--------- .../post_3.5.0/test_package/CMakeLists.txt | 9 +- .../gdal/post_3.5.0/test_package/conanfile.py | 32 +- .../post_3.5.0/test_package/test_package.c | 74 +-- .../post_3.5.0/test_package/test_package.cpp | 72 +-- .../post_3.5.0/test_v1_package/CMakeLists.txt | 8 + .../post_3.5.0/test_v1_package/conanfile.py | 23 + 8 files changed, 420 insertions(+), 387 deletions(-) create mode 100644 recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt create mode 100644 recipes/gdal/post_3.5.0/test_v1_package/conanfile.py diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 6ac086393ccfd..fcd71c4acfec6 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -14,7 +14,5 @@ patches: base_path: "source_subfolder" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" - base_path: "source_subfolder" "3.5.1": - patch_file: "patches/3.5.1/0-replace-find-package.patch" - base_path: "source_subfolder" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 3e0847981c026..416b468caab33 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -1,24 +1,73 @@ -from conan import ConanFile -from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.files import apply_conandata_patches, get, files -from conan.errors import ConanInvalidConfiguration -from conans import CMake +# TODO: verify the Conan v2 migration + +import os + +from conan import ConanFile, conan_version +from conan.errors import ConanInvalidConfiguration, ConanException +from conan.tools.android import android_abi +from conan.tools.apple import XCRun, fix_apple_shared_install_name, is_apple_os, to_apple_arch +from conan.tools.build import build_jobs, can_run, check_min_cppstd, cross_building, default_cppstd, stdcpp_library, valid_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import ( + apply_conandata_patches, + chdir, + collect_libs, + copy, + download, + export_conandata_patches, + get, + load, + mkdir, + patch, + patches, + rename, + replace_in_file, + rm, + rmdir, + save, + symlinks, + unzip, +) +from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfig, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import MesonToolchain, Meson +from conan.tools.microsoft import ( + MSBuild, + MSBuildDeps, + MSBuildToolchain, + NMakeDeps, + NMakeToolchain, + VCVars, + check_min_vs, + is_msvc, + is_msvc_static_runtime, + msvc_runtime_flag, + unix_path, + unix_path_package_info_legacy, + vs_layout, +) +from conan.tools.scm import Version +from conan.tools.system import package_manager import functools import os +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + +required_conan_version = ">=1.52.0" + class GdalConan(ConanFile): name = "gdal" description = "GDAL is an open source X/MIT licensed translator library " \ "for raster and vector geospatial data formats." license = "MIT" - topics = ("osgeo", "geospatial", "raster", "vector") - homepage = "https://github.com/OSGeo/gdal" url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/OSGeo/gdal" + topics = ("osgeo", "geospatial", "raster", "vector", "pre-built") + package_type = "library" settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" - # A list of gdal dependencies can be taken from cmake/helpers/CheckDependentLibraries.cmake # within gdal sources with the command: # grep -E '^[ \t]*gdal_check_package\(' cmake/helpers/CheckDependentLibraries.cmake \ @@ -126,18 +175,9 @@ class GdalConan(ConanFile): "with_zstd": False, } - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build" - def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -148,10 +188,10 @@ def configure(self): self.output.error("with_crypto option is deprecated, use with_openssl instead.") if self.options.shared: - try: - del self.options.fPIC - except: - pass + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("json-c/0.16") @@ -247,7 +287,7 @@ def requirements(self): self.requires("openjpeg/2.5.0") if self.options.with_openssl: - self.requires("openssl/1.1.1u") + self.requires("openssl/1.1.1v") if self.options.with_pcre: self.requires("pcre/8.45") @@ -302,10 +342,10 @@ def validate(self): if self.options.get_safe("with_pcre") and self.options.get_safe("with_pcre2"): raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") - if self.options.get_safe("with_sqlite3") and not self.options["sqlite3"].enable_column_metadata: + if self.options.get_safe("with_sqlite3") and not self.dependencies["sqlite3"].options.enable_column_metadata: raise ConanInvalidConfiguration("gdql requires sqlite3:enable_column_metadata=True") - if self.options.get_safe("with_libtiff") and self.options["libtiff"].jpeg != self.options.get_safe("with_jpeg"): + if self.options.get_safe("with_libtiff") and self.dependencies["libtiff"].options.jpeg != self.options.get_safe("with_jpeg"): msg = "libtiff:jpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." # For some reason, the ConanInvalidConfiguration message is not shown, only # ERROR: At least two recipes provides the same functionality: @@ -314,428 +354,387 @@ def validate(self): self.output.error(msg) raise ConanInvalidConfiguration(msg) - if self.options.get_safe("with_poppler") and self.options["poppler"].with_libjpeg != self.options.get_safe("with_jpeg"): - msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." + if self.options.get_safe("with_poppler") and self.dependencies["poppler"].options.with_libjpeg != self.options.get_safe("with_jpeg"): + msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or" " libjpeg-turbo." self.output.error(msg) raise ConanInvalidConfiguration(msg) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + def generate(self): + tc = CMakeToolchain(self) if self.options.get_safe("fPIC", True): - cmake.definitions[ - "GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True + tc.variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True - cmake.definitions["BUILD_JAVA_BINDINGS"] = False - cmake.definitions["BUILD_CSHARP_BINDINGS"] = False - cmake.definitions["BUILD_PYTHON_BINDINGS"] = False + tc.variables["BUILD_JAVA_BINDINGS"] = False + tc.variables["BUILD_CSHARP_BINDINGS"] = False + tc.variables["BUILD_PYTHON_BINDINGS"] = False - cmake.definitions["BUILD_TESTING"] = False - cmake.definitions["GDAL_USE_ZLIB_INTERNAL"] = False - cmake.definitions["GDAL_USE_JSONC_INTERNAL"] = False - cmake.definitions["GDAL_USE_JPEG_INTERNAL"] = False - cmake.definitions["GDAL_USE_JPEG12_INTERNAL"] = False - cmake.definitions["GDAL_USE_TIFF_INTERNAL"] = False - cmake.definitions["GDAL_USE_GEOTIFF_INTERNAL"] = False - cmake.definitions["GDAL_USE_GIF_INTERNAL"] = False - cmake.definitions["GDAL_USE_PNG_INTERNAL"] = False + tc.variables["BUILD_TESTING"] = False + tc.variables["GDAL_USE_ZLIB_INTERNAL"] = False + tc.variables["GDAL_USE_JSONC_INTERNAL"] = False + tc.variables["GDAL_USE_JPEG_INTERNAL"] = False + tc.variables["GDAL_USE_JPEG12_INTERNAL"] = False + tc.variables["GDAL_USE_TIFF_INTERNAL"] = False + tc.variables["GDAL_USE_GEOTIFF_INTERNAL"] = False + tc.variables["GDAL_USE_GIF_INTERNAL"] = False + tc.variables["GDAL_USE_PNG_INTERNAL"] = False - cmake.definitions["GDAL_USE_LERC_INTERNAL"] = True - cmake.definitions["GDAL_USE_SHAPELIB_INTERNAL"] = True + tc.variables["GDAL_USE_LERC_INTERNAL"] = True + tc.variables["GDAL_USE_SHAPELIB_INTERNAL"] = True - cmake.definitions["BUILD_APPS"] = self.options.tools + tc.variables["BUILD_APPS"] = self.options.tools - cmake.definitions["SQLite3_HAS_COLUMN_METADATA"] = \ - self.options["sqlite3"].enable_column_metadata + tc.variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata - cmake.definitions["SQLite3_HAS_RTREE"] = self.options[ - "sqlite3"].enable_rtree + tc.variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree - cmake.definitions["GDAL_USE_JSONC"] = True - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" + tc.variables["GDAL_USE_JSONC"] = True + tc.variables["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" - cmake.definitions["GDAL_USE_GEOTIFF"] = True - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" - cmake.definitions["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" + tc.variables["GDAL_USE_GEOTIFF"] = True + tc.variables["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" + tc.variables["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" - cmake.definitions["GDAL_USE_ARMADILLO"] = self.options.with_armadillo + tc.variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo if self.options.with_armadillo: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARMADILLO"] = "armadillo" - cmake.definitions["TARGET_FOR_ARMADILLO"] = \ - self.dependencies["armadillo"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_ARMADILLO"] = "armadillo" + tc.variables["TARGET_FOR_ARMADILLO"] = self.dependencies["armadillo"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Armadillo_FOUND"] = False + tc.variables["Armadillo_FOUND"] = False - cmake.definitions["GDAL_USE_ARROW"] = self.options.with_arrow + tc.variables["GDAL_USE_ARROW"] = self.options.with_arrow if self.options.with_arrow: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ARROW"] = "arrow" - cmake.definitions["TARGET_FOR_ARROW"] = \ - self.dependencies["arrow"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_ARROW"] = "arrow" + tc.variables["TARGET_FOR_ARROW"] = self.dependencies["arrow"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Arrow_FOUND"] = False + tc.variables["Arrow_FOUND"] = False - cmake.definitions["GDAL_USE_BLOSC"] = self.options.with_blosc + tc.variables["GDAL_USE_BLOSC"] = self.options.with_blosc if self.options.with_blosc: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_BLOSC"] = "c-blosc" - cmake.definitions["TARGET_FOR_BLOSC"] = \ - self.dependencies["c-blosc"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_BLOSC"] = "c-blosc" + tc.variables["TARGET_FOR_BLOSC"] = self.dependencies["c-blosc"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Blosc_FOUND"] = False + tc.variables["Blosc_FOUND"] = False - cmake.definitions["GDAL_USE_CFITSIO"] = self.options.with_cfitsio + tc.variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio if self.options.with_cfitsio: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CFITSIO"] = "cfitsio" - cmake.definitions["TARGET_FOR_CFITSIO"] = \ - self.dependencies["cfitsio"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_CFITSIO"] = "cfitsio" + tc.variables["TARGET_FOR_CFITSIO"] = self.dependencies["cfitsio"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["CFITSIO_FOUND"] = False + tc.variables["CFITSIO_FOUND"] = False - cmake.definitions["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp + tc.variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp if self.options.with_cryptopp: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRYPTOPP"] = "cryptopp" - cmake.definitions["TARGET_FOR_CRYPTOPP"] = \ - self.dependencies["cryptopp"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_CRYPTOPP"] = "cryptopp" + tc.variables["TARGET_FOR_CRYPTOPP"] = self.dependencies["cryptopp"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["CryptoPP_FOUND"] = False + tc.variables["CryptoPP_FOUND"] = False - cmake.definitions["GDAL_USE_CURL"] = self.options.with_curl + tc.variables["GDAL_USE_CURL"] = self.options.with_curl if self.options.with_curl: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CURL"] = "libcurl" - cmake.definitions["TARGET_FOR_CURL"] = \ - self.dependencies["libcurl"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_CURL"] = "libcurl" + tc.variables["TARGET_FOR_CURL"] = self.dependencies["libcurl"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["CURL_FOUND"] = False + tc.variables["CURL_FOUND"] = False - cmake.definitions["GDAL_USE_CRNLIB"] = self.options.with_dds + tc.variables["GDAL_USE_CRNLIB"] = self.options.with_dds if self.options.with_dds: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_CRNLIB"] = "crunch" - cmake.definitions["TARGET_FOR_CRNLIB"] = \ - self.dependencies["crunch"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_CRNLIB"] = "crunch" + tc.variables["TARGET_FOR_CRNLIB"] = self.dependencies["crunch"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Crnlib_FOUND"] = False + tc.variables["Crnlib_FOUND"] = False - cmake.definitions["GDAL_USE_EXPAT"] = self.options.with_expat + tc.variables["GDAL_USE_EXPAT"] = self.options.with_expat if self.options.with_expat: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_EXPAT"] = "expat" - cmake.definitions["TARGET_FOR_EXPAT"] = "EXPAT::EXPAT" + tc.variables["GDAL_CONAN_PACKAGE_FOR_EXPAT"] = "expat" + tc.variables["TARGET_FOR_EXPAT"] = "EXPAT::EXPAT" else: - cmake.definitions["EXPAT_FOUND"] = False + tc.variables["EXPAT_FOUND"] = False - cmake.definitions["GDAL_USE_OPENEXR"] = self.options.with_exr + tc.variables["GDAL_USE_OPENEXR"] = self.options.with_exr if self.options.with_exr: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENEXR"] = "openexr" - cmake.definitions["TARGET_FOR_OPENEXR"] = \ - self.dependencies["openexr"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_OPENEXR"] = "openexr" + tc.variables["TARGET_FOR_OPENEXR"] = self.dependencies["openexr"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["OpenEXR_FOUND"] = False + tc.variables["OpenEXR_FOUND"] = False - cmake.definitions["GDAL_USE_FREEXL"] = self.options.with_freexl + tc.variables["GDAL_USE_FREEXL"] = self.options.with_freexl if self.options.with_freexl: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_FREEXL"] = "freexl" - cmake.definitions["TARGET_FOR_FREEXL"] = "freexl::freexl" + tc.variables["GDAL_CONAN_PACKAGE_FOR_FREEXL"] = "freexl" + tc.variables["TARGET_FOR_FREEXL"] = "freexl::freexl" else: - cmake.definitions["FreeXL_FOUND"] = False + tc.variables["FreeXL_FOUND"] = False - cmake.definitions["GDAL_USE_GEOS"] = self.options.with_geos + tc.variables["GDAL_USE_GEOS"] = self.options.with_geos if self.options.with_geos: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GEOS"] = "geos" - cmake.definitions["TARGET_FOR_GEOS"] = \ - self.dependencies["geos"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_GEOS"] = "geos" + tc.variables["TARGET_FOR_GEOS"] = self.dependencies["geos"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["GEOS_FOUND"] = False + tc.variables["GEOS_FOUND"] = False - cmake.definitions["GDAL_USE_GIF"] = self.options.with_gif + tc.variables["GDAL_USE_GIF"] = self.options.with_gif if self.options.with_gif: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GIF"] = "giflib" - cmake.definitions["TARGET_FOR_GIF"] = \ - self.dependencies["giflib"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_GIF"] = "giflib" + tc.variables["TARGET_FOR_GIF"] = self.dependencies["giflib"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["GIF_FOUND"] = False + tc.variables["GIF_FOUND"] = False - cmake.definitions["GDAL_USE_GTA"] = self.options.with_gta + tc.variables["GDAL_USE_GTA"] = self.options.with_gta if self.options.with_gta: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_GTA"] = "libgta" - cmake.definitions["TARGET_FOR_GTA"] = \ - self.dependencies["libgta"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_GTA"] = "libgta" + tc.variables["TARGET_FOR_GTA"] = self.dependencies["libgta"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["GTA_FOUND"] = False + tc.variables["GTA_FOUND"] = False - cmake.definitions["GDAL_USE_HDF4"] = self.options.with_hdf4 + tc.variables["GDAL_USE_HDF4"] = self.options.with_hdf4 if self.options.with_hdf4: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF4"] = "hdf4" - cmake.definitions["TARGET_FOR_HDF4"] = \ - self.dependencies["hdf4"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_HDF4"] = "hdf4" + tc.variables["TARGET_FOR_HDF4"] = self.dependencies["hdf4"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["HDF4_FOUND"] = False + tc.variables["HDF4_FOUND"] = False - cmake.definitions["GDAL_USE_HDF5"] = self.options.with_hdf5 + tc.variables["GDAL_USE_HDF5"] = self.options.with_hdf5 if self.options.with_hdf5: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HDF5"] = "hdf5" - cmake.definitions["TARGET_FOR_HDF5"] = \ - self.dependencies["hdf5"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_HDF5"] = "hdf5" + tc.variables["TARGET_FOR_HDF5"] = self.dependencies["hdf5"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["HDF5_FOUND"] = False + tc.variables["HDF5_FOUND"] = False - cmake.definitions["GDAL_USE_HEIF"] = self.options.with_heif + tc.variables["GDAL_USE_HEIF"] = self.options.with_heif if self.options.with_heif: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_HEIF"] = "libheif" - cmake.definitions["TARGET_FOR_HEIF"] = \ - self.dependencies["libheif"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_HEIF"] = "libheif" + tc.variables["TARGET_FOR_HEIF"] = self.dependencies["libheif"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["HEIF_FOUND"] = False + tc.variables["HEIF_FOUND"] = False - cmake.definitions["GDAL_USE_KEA"] = self.options.with_kea + tc.variables["GDAL_USE_KEA"] = self.options.with_kea if self.options.with_kea: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_KEA"] = "kealib" - cmake.definitions["TARGET_FOR_KEA"] = \ - self.dependencies["kealib"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_KEA"] = "kealib" + tc.variables["TARGET_FOR_KEA"] = self.dependencies["kealib"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["KEA_FOUND"] = False + tc.variables["KEA_FOUND"] = False - cmake.definitions["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + tc.variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate if self.options.with_libdeflate: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_DEFLATE"] = "libdeflate" - cmake.definitions["TARGET_FOR_DEFLATE"] = \ - self.dependencies["libdeflate"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_DEFLATE"] = "libdeflate" + tc.variables["TARGET_FOR_DEFLATE"] = self.dependencies["libdeflate"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Deflate_FOUND"] = False + tc.variables["Deflate_FOUND"] = False - cmake.definitions["GDAL_USE_ICONV"] = self.options.with_libiconv + tc.variables["GDAL_USE_ICONV"] = self.options.with_libiconv if self.options.with_libiconv: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ICONV"] = "libiconv" - cmake.definitions["TARGET_FOR_ICONV"] = \ - self.dependencies["libiconv"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_ICONV"] = "libiconv" + tc.variables["TARGET_FOR_ICONV"] = self.dependencies["libiconv"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Iconv_FOUND"] = False + tc.variables["Iconv_FOUND"] = False if self.options.with_jpeg == "libjpeg" or self.options.with_jpeg == "libjpeg-turbo": - print(f'self.options.with_jpeg: {self.options.with_jpeg}') - cmake.definitions["GDAL_USE_JPEG"] = True - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg - cmake.definitions["TARGET_FOR_JPEG"] = ( - "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else - self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"] \ - .get_property("cmake_target_name")) - else: - cmake.definitions["JPEG_FOUND"] = False - - cmake.definitions["GDAL_USE_LIBKML"] = self.options.with_libkml + print(f"self.options.with_jpeg: {self.options.with_jpeg}") + tc.variables["GDAL_USE_JPEG"] = True + tc.variables["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg + tc.variables["TARGET_FOR_JPEG"] = ( + "JPEG::JPEG" + if self.options.with_jpeg == "libjpeg" + else self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"].get_property("cmake_target_name") + ) + else: + tc.variables["JPEG_FOUND"] = False + + tc.variables["GDAL_USE_LIBKML"] = self.options.with_libkml if self.options.with_libkml: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBKML"] = "libkml" - cmake.definitions["TARGET_FOR_LIBKML"] = \ - self.dependencies["libkml"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_LIBKML"] = "libkml" + tc.variables["TARGET_FOR_LIBKML"] = self.dependencies["libkml"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["LibKML_FOUND"] = False + tc.variables["LibKML_FOUND"] = False - cmake.definitions["GDAL_USE_TIFF"] = self.options.with_libtiff + tc.variables["GDAL_USE_TIFF"] = self.options.with_libtiff if self.options.with_libtiff: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_TIFF"] = "libtiff" - cmake.definitions["TARGET_FOR_TIFF"] = \ - self.dependencies["libtiff"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_TIFF"] = "libtiff" + tc.variables["TARGET_FOR_TIFF"] = self.dependencies["libtiff"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["TIFF_FOUND"] = False + tc.variables["TIFF_FOUND"] = False - cmake.definitions["GDAL_USE_LZ4"] = self.options.with_lz4 + tc.variables["GDAL_USE_LZ4"] = self.options.with_lz4 if self.options.with_lz4: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LZ4"] = "lz4" - cmake.definitions["TARGET_FOR_LZ4"] = \ - self.dependencies["lz4"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_LZ4"] = "lz4" + tc.variables["TARGET_FOR_LZ4"] = self.dependencies["lz4"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["LZ4_FOUND"] = False + tc.variables["LZ4_FOUND"] = False - cmake.definitions["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + tc.variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx if self.options.with_mongocxx: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MONGOCXX"] = "mongo-cxx-driver" - cmake.definitions["TARGET_FOR_MONGOCXX"] = \ - self.dependencies["mongo-cxx-driver"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_MONGOCXX"] = "mongo-cxx-driver" + tc.variables["TARGET_FOR_MONGOCXX"] = self.dependencies["mongo-cxx-driver"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["MONGOCXX_FOUND"] = False + tc.variables["MONGOCXX_FOUND"] = False if self.options.with_mysql == "libmysqlclient" or self.options.with_mysql == "mariadb-connector-c": - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) - cmake.definitions["TARGET_FOR_MYSQL"] = \ - "mariadb-connector-c::mariadb-connector-c" \ - if self.options.with_mysql == "mariadb-connector-c" \ - else "libmysqlclient::libmysqlclient" + tc.variables["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) + tc.variables["TARGET_FOR_MYSQL"] = ( + "mariadb-connector-c::mariadb-connector-c" + if self.options.with_mysql == "mariadb-connector-c" + else "libmysqlclient::libmysqlclient" + ) else: - cmake.definitions["MYSQL_FOUND"] = False + tc.variables["MYSQL_FOUND"] = False - cmake.definitions["GDAL_USE_NETCDF"] = self.options.with_netcdf + tc.variables["GDAL_USE_NETCDF"] = self.options.with_netcdf if self.options.with_netcdf: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_NETCDF"] = "netcdf" - cmake.definitions["TARGET_FOR_NETCDF"] = \ - self.dependencies["netcdf"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_NETCDF"] = "netcdf" + tc.variables["TARGET_FOR_NETCDF"] = self.dependencies["netcdf"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["NetCDF_FOUND"] = False + tc.variables["NetCDF_FOUND"] = False - cmake.definitions["GDAL_USE_ODBC"] = self.options.with_odbc + tc.variables["GDAL_USE_ODBC"] = self.options.with_odbc if self.options.with_odbc: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ODBC"] = "odbc" - cmake.definitions["TARGET_FOR_ODBC"] = \ - self.dependencies["odbc"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_ODBC"] = "odbc" + tc.variables["TARGET_FOR_ODBC"] = self.dependencies["odbc"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["ODBC_FOUND"] = False + tc.variables["ODBC_FOUND"] = False - cmake.definitions["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg + tc.variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg if self.options.with_openjpeg: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENJPEG"] = "openjpeg" - cmake.definitions["TARGET_FOR_OPENJPEG"] = \ - self.dependencies["openjpeg"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_OPENJPEG"] = "openjpeg" + tc.variables["TARGET_FOR_OPENJPEG"] = self.dependencies["openjpeg"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["OPENJPEG_FOUND"] = False + tc.variables["OPENJPEG_FOUND"] = False - cmake.definitions["GDAL_USE_OPENSSL"] = self.options.with_openssl + tc.variables["GDAL_USE_OPENSSL"] = self.options.with_openssl if self.options.with_openssl: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_OPENSSL"] = "openssl" - cmake.definitions["TARGET_FOR_OPENSSL"] = \ - self.dependencies["openssl"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_OPENSSL"] = "openssl" + tc.variables["TARGET_FOR_OPENSSL"] = self.dependencies["openssl"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["OpenSSL_FOUND"] = False + tc.variables["OpenSSL_FOUND"] = False - cmake.definitions["GDAL_USE_PCRE"] = self.options.with_pcre + tc.variables["GDAL_USE_PCRE"] = self.options.with_pcre if self.options.with_pcre: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE"] = "pcre" - cmake.definitions["TARGET_FOR_PCRE"] = \ - self.dependencies["pcre"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_PCRE"] = "pcre" + tc.variables["TARGET_FOR_PCRE"] = self.dependencies["pcre"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["PCRE_FOUND"] = False + tc.variables["PCRE_FOUND"] = False - cmake.definitions["GDAL_USE_PCRE2"] = self.options.with_pcre2 + tc.variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 if self.options.with_pcre2: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PCRE2"] = "pcre2" - cmake.definitions["TARGET_FOR_PCRE2"] = \ - self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_PCRE2"] = "pcre2" + tc.variables["TARGET_FOR_PCRE2"] = self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["PCRE2_FOUND"] = False + tc.variables["PCRE2_FOUND"] = False - cmake.definitions["GDAL_USE_PDFIUM"] = False - cmake.definitions["PDFIUM_FOUND"] = False + tc.variables["GDAL_USE_PDFIUM"] = False + tc.variables["PDFIUM_FOUND"] = False - cmake.definitions["GDAL_USE_POSTGRESQL"] = self.options.with_pg + tc.variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg if self.options.with_pg: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POSTGRESQL"] = "libpq" - cmake.definitions["TARGET_FOR_POSTGRESQL"] = \ - self.dependencies["libpq"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_POSTGRESQL"] = "libpq" + tc.variables["TARGET_FOR_POSTGRESQL"] = self.dependencies["libpq"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["PostgreSQL_FOUND"] = False + tc.variables["PostgreSQL_FOUND"] = False - cmake.definitions["GDAL_USE_PNG"] = self.options.with_png + tc.variables["GDAL_USE_PNG"] = self.options.with_png if self.options.with_png: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PNG"] = "libpng" - cmake.definitions["TARGET_FOR_PNG"] = \ - self.dependencies["libpng"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_PNG"] = "libpng" + tc.variables["TARGET_FOR_PNG"] = self.dependencies["libpng"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["PNG_FOUND"] = False + tc.variables["PNG_FOUND"] = False - cmake.definitions["GDAL_USE_PODOFO"] = self.options.with_podofo + tc.variables["GDAL_USE_PODOFO"] = self.options.with_podofo if self.options.with_podofo: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PODOFO"] = "podofo" - cmake.definitions["TARGET_FOR_PODOFO"] = \ - self.dependencies["podofo"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_PODOFO"] = "podofo" + tc.variables["TARGET_FOR_PODOFO"] = self.dependencies["podofo"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Podofo_FOUND"] = False + tc.variables["Podofo_FOUND"] = False - cmake.definitions["GDAL_USE_POPPLER"] = self.options.with_poppler + tc.variables["GDAL_USE_POPPLER"] = self.options.with_poppler if self.options.with_poppler: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_POPPLER"] = "poppler" - cmake.definitions["TARGET_FOR_POPPLER"] = \ - self.dependencies["poppler"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_POPPLER"] = "poppler" + tc.variables["TARGET_FOR_POPPLER"] = self.dependencies["poppler"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["Poppler_FOUND"] = False + tc.variables["Poppler_FOUND"] = False - cmake.definitions["GDAL_USE_PROJ"] = self.options.with_proj + tc.variables["GDAL_USE_PROJ"] = self.options.with_proj if self.options.with_proj: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_PROJ"] = "proj" - cmake.definitions["TARGET_FOR_PROJ"] = \ - self.dependencies["proj"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_PROJ"] = "proj" + tc.variables["TARGET_FOR_PROJ"] = self.dependencies["proj"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["PROJ_FOUND"] = False + tc.variables["PROJ_FOUND"] = False - cmake.definitions["GDAL_USE_QHULL"] = self.options.with_qhull + tc.variables["GDAL_USE_QHULL"] = self.options.with_qhull if self.options.with_qhull: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_QHULL"] = "qhull" - cmake.definitions["TARGET_FOR_QHULL"] = \ - self.dependencies["qhull"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_QHULL"] = "qhull" + tc.variables["TARGET_FOR_QHULL"] = self.dependencies["qhull"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["QHULL_FOUND"] = False + tc.variables["QHULL_FOUND"] = False - cmake.definitions["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + tc.variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 if self.options.with_sqlite3: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_SQLITE3"] = "sqlite3" - cmake.definitions["TARGET_FOR_SQLITE3"] = \ - self.dependencies["sqlite3"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_SQLITE3"] = "sqlite3" + tc.variables["TARGET_FOR_SQLITE3"] = self.dependencies["sqlite3"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["SQLite3_FOUND"] = False + tc.variables["SQLite3_FOUND"] = False - cmake.definitions["GDAL_USE_WEBP"] = self.options.with_webp + tc.variables["GDAL_USE_WEBP"] = self.options.with_webp if self.options.with_webp: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_WEBP"] = "libwebp" - cmake.definitions["TARGET_FOR_WEBP"] = \ - self.dependencies["libwebp"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_WEBP"] = "libwebp" + tc.variables["TARGET_FOR_WEBP"] = self.dependencies["libwebp"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["WebP_FOUND"] = False + tc.variables["WebP_FOUND"] = False - cmake.definitions["GDAL_USE_XERCESC"] = self.options.with_xerces + tc.variables["GDAL_USE_XERCESC"] = self.options.with_xerces if self.options.with_xerces: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_XERCESC"] = "xerces-c" - cmake.definitions["TARGET_FOR_XERCESC"] = \ - self.dependencies["xerces-c"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_XERCESC"] = "xerces-c" + tc.variables["TARGET_FOR_XERCESC"] = self.dependencies["xerces-c"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["XercesC_FOUND"] = False + tc.variables["XercesC_FOUND"] = False - cmake.definitions["GDAL_USE_LIBXML2"] = self.options.with_xml2 + tc.variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 if self.options.with_xml2: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_LIBXML2"] = "libxml2" - cmake.definitions["TARGET_FOR_LIBXML2"] = \ - self.dependencies["libxml2"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_LIBXML2"] = "libxml2" + tc.variables["TARGET_FOR_LIBXML2"] = self.dependencies["libxml2"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["LibXml2_FOUND"] = False + tc.variables["LibXml2_FOUND"] = False - cmake.definitions["GDAL_USE_ZLIB"] = self.options.with_zlib + tc.variables["GDAL_USE_ZLIB"] = self.options.with_zlib if self.options.with_zlib: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZLIB"] = "zlib" - cmake.definitions["TARGET_FOR_ZLIB"] = \ - self.dependencies["zlib"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_ZLIB"] = "zlib" + tc.variables["TARGET_FOR_ZLIB"] = self.dependencies["zlib"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["ZLIB_FOUND"] = False + tc.variables["ZLIB_FOUND"] = False - cmake.definitions["GDAL_USE_ZSTD"] = self.options.with_zstd + tc.variables["GDAL_USE_ZSTD"] = self.options.with_zstd if self.options.with_zstd: - cmake.definitions["GDAL_CONAN_PACKAGE_FOR_ZSTD"] = "zstd" - cmake.definitions["TARGET_FOR_ZSTD"] = \ - self.dependencies["zstd"].cpp_info.get_property("cmake_target_name") + tc.variables["GDAL_CONAN_PACKAGE_FOR_ZSTD"] = "zstd" + tc.variables["TARGET_FOR_ZSTD"] = self.dependencies["zstd"].cpp_info.get_property("cmake_target_name") else: - cmake.definitions["ZSTD_FOUND"] = False + tc.variables["ZSTD_FOUND"] = False - - for k, v in cmake.definitions.items(): + for k, v in tc.variables.items(): print(k, " = ", v) - cmake.configure(build_folder=self._build_subfolder) - return cmake + tc.generate() + + tc = CMakeDeps(self) + tc.generate() def build(self): apply_conandata_patches(self) - cmake = self._configure_cmake() - + cmake = CMake(self) + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): - self.copy("LICENSE.TXT", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE.TXT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "share")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) fix_apple_shared_install_name(self) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "GDAL") self.cpp_info.set_property("cmake_target_name", "GDAL::GDAL") self.cpp_info.set_property("cmake_find_mode", "both") @@ -750,7 +749,7 @@ def package_info(self): if self.settings.os == "Windows": if self.settings.build_type == "Debug": libname += "d" - self.cpp_info.libs = [ libname ] + self.cpp_info.libs = [libname] self.cpp_info.requires.extend(['json-c::json-c']) self.cpp_info.requires.extend(['libgeotiff::libgeotiff']) diff --git a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt index 861d8d69409b0..fa9f0f5580ed7 100644 --- a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt @@ -1,10 +1,7 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(GDAL REQUIRED) +find_package(GDAL REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} GDAL::GDAL) diff --git a/recipes/gdal/post_3.5.0/test_package/conanfile.py b/recipes/gdal/post_3.5.0/test_package/conanfile.py index 9dced2ad9cf71..cf27fad652610 100644 --- a/recipes/gdal/post_3.5.0/test_package/conanfile.py +++ b/recipes/gdal/post_3.5.0/test_package/conanfile.py @@ -1,12 +1,20 @@ -from conan import ConanFile -from conan.tools.build import cross_building -from conans import CMake import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake + class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -14,10 +22,10 @@ def build(self): cmake.build() def test(self): - if not cross_building(self): - if self.options["gdal"].tools: - self.run("gdal_translate --formats", run_environment=True) - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) - bin_path_c = os.path.join("bin", "test_package_c") - self.run(bin_path_c, run_environment=True) + if can_run(self): + if self.dependencies["gdal"].options.tools: + self.run("gdal_translate --formats", env="conanrun") + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") + bin_path_c = os.path.join(self.cpp.build.bindir, "test_package_c") + self.run(bin_path_c, env="conanrun") diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.c b/recipes/gdal/post_3.5.0/test_package/test_package.c index e4faf1b9e561d..863d204802b9f 100644 --- a/recipes/gdal/post_3.5.0/test_package/test_package.c +++ b/recipes/gdal/post_3.5.0/test_package/test_package.c @@ -4,55 +4,55 @@ #include int main() { - GDALAllRegister(); + GDALAllRegister(); - const char *pszDriverName = "ESRI Shapefile"; - GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); - if (!hDriver) { - printf("%s driver not available.\n", pszDriverName); - exit(1); - } + const char *pszDriverName = "ESRI Shapefile"; + GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); + if (!hDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } - GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); - if (!hDS) { - printf("Creation of output file failed.\n"); - exit(1); - } + GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!hDS) { + printf("Creation of output file failed.\n"); + exit(1); + } - OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); - if (!hLayer) { - printf("Layer creation failed.\n"); - exit(1); - } + OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); + if (!hLayer) { + printf("Layer creation failed.\n"); + exit(1); + } - OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); + OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); - OGR_Fld_SetWidth(hFieldDefn, 32); + OGR_Fld_SetWidth(hFieldDefn, 32); - if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { - printf("Creating Name field failed.\n"); - exit(1); - } + if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } - OGR_Fld_Destroy(hFieldDefn); + OGR_Fld_Destroy(hFieldDefn); - OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); - OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); + OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); + OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); - OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); - OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); + OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); + OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); - OGR_F_SetGeometry(hFeature, hPt); - OGR_G_DestroyGeometry(hPt); + OGR_F_SetGeometry(hFeature, hPt); + OGR_G_DestroyGeometry(hPt); - if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { - printf("Failed to create feature in shapefile.\n"); - exit(1); - } + if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit(1); + } - OGR_F_Destroy(hFeature); + OGR_F_Destroy(hFeature); - GDALClose(hDS); + GDALClose(hDS); - return 0; + return 0; } diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.cpp b/recipes/gdal/post_3.5.0/test_package/test_package.cpp index ec77987bc5ece..a556f4a451a72 100644 --- a/recipes/gdal/post_3.5.0/test_package/test_package.cpp +++ b/recipes/gdal/post_3.5.0/test_package/test_package.cpp @@ -4,51 +4,51 @@ #include int main() { - GDALAllRegister(); + GDALAllRegister(); - const char *pszDriverName = "ESRI Shapefile"; - GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); - if (!poDriver) { - printf("%s driver not available.\n", pszDriverName); - exit(1); - } + const char *pszDriverName = "ESRI Shapefile"; + GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); + if (!poDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } - GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); - if (!poDS) { - printf("Creation of output file failed.\n"); - exit(1); - } + GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!poDS) { + printf("Creation of output file failed.\n"); + exit(1); + } - OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); - if (!poLayer) { - printf("Layer creation failed.\n"); - exit(1); - } + OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); + if (!poLayer) { + printf("Layer creation failed.\n"); + exit(1); + } - OGRFieldDefn oField("Name", OFTString); - oField.SetWidth(32); + OGRFieldDefn oField("Name", OFTString); + oField.SetWidth(32); - if (poLayer->CreateField(&oField) != OGRERR_NONE) { - printf("Creating Name field failed.\n"); - exit(1); - } + if (poLayer->CreateField(&oField) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } - OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); - poFeature->SetField("Name", "conan"); + OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); + poFeature->SetField("Name", "conan"); - OGRPoint pt; - pt.setX(40.74); - pt.setY(-27.891); - poFeature->SetGeometry(&pt); + OGRPoint pt; + pt.setX(40.74); + pt.setY(-27.891); + poFeature->SetGeometry(&pt); - if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { - printf("Failed to create feature in shapefile.\n"); - exit( 1 ); - } + if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit(1); + } - OGRFeature::DestroyFeature(poFeature); + OGRFeature::DestroyFeature(poFeature); - GDALClose(poDS); + GDALClose(poDS); - return 0; + return 0; } diff --git a/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/gdal/post_3.5.0/test_v1_package/conanfile.py b/recipes/gdal/post_3.5.0/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..e5d5a707ca0b3 --- /dev/null +++ b/recipes/gdal/post_3.5.0/test_v1_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.build import cross_building +from conans import CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + if self.options["gdal"].tools: + self.run("gdal_translate --formats", run_environment=True) + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) + bin_path_c = os.path.join("bin", "test_package_c") + self.run(bin_path_c, run_environment=True) From b96b4b4a5b247477d8fb09fcf8ac2c0ac60c0137 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 27 Jul 2023 15:45:48 +0300 Subject: [PATCH 002/105] gdal/post_3.5.0: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 39 +++++++++++++--------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 416b468caab33..85e68dad5f34f 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -9,6 +9,7 @@ from conan.tools.build import build_jobs, can_run, check_min_cppstd, cross_building, default_cppstd, stdcpp_library, valid_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.apple import fix_apple_shared_install_name from conan.tools.files import ( apply_conandata_patches, chdir, @@ -198,22 +199,22 @@ def requirements(self): self.requires("libgeotiff/1.7.1") if self.options.with_armadillo: - self.requires("armadillo/10.7.3") + self.requires("armadillo/12.2.0") if self.options.with_arrow: - self.requires("arrow/8.0.1") + self.requires("arrow/12.0.0") if self.options.with_blosc: - self.requires("c-blosc/1.21.1") + self.requires("c-blosc/1.21.4") if self.options.with_cfitsio: - self.requires("cfitsio/4.1.0") + self.requires("cfitsio/4.2.0") if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_curl: - self.requires("libcurl/8.2.0") + self.requires("libcurl/8.2.1") if self.options.with_dds: self.requires("crunch/cci.20190615") @@ -229,7 +230,7 @@ def requirements(self): self.requires("freexl/1.0.6") if self.options.with_geos: - self.requires("geos/3.11.1") + self.requires("geos/3.11.2") if self.options.with_gif: self.requires("giflib/5.2.1") @@ -241,7 +242,7 @@ def requirements(self): self.requires("hdf4/4.2.15") if self.options.with_hdf5: - self.requires("hdf5/1.13.1") + self.requires("hdf5/1.14.1") if self.options.with_heif: self.requires("libheif/1.13.0") @@ -249,7 +250,7 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") if self.options.with_kea: self.requires("kealib/1.4.14") @@ -270,12 +271,12 @@ def requirements(self): self.requires("lz4/1.9.4") if self.options.with_mongocxx: - self.requires("mongo-cxx-driver/3.6.7") + self.requires("mongo-cxx-driver/3.7.2") if self.options.with_mysql == "libmysqlclient": - self.requires("libmysqlclient/8.0.30") + self.requires("libmysqlclient/8.1.0") elif self.options.with_mysql == "mariadb-connector-c": - self.requires("mariadb-connector-c/3.1.12") + self.requires("mariadb-connector-c/3.3.3") if self.options.with_netcdf: self.requires("netcdf/4.8.1") @@ -296,7 +297,7 @@ def requirements(self): self.requires("pcre2/10.42") if self.options.with_pg: - self.requires("libpq/14.5") + self.requires("libpq/15.3") if self.options.with_png: self.requires("libpng/1.6.40") @@ -308,7 +309,7 @@ def requirements(self): self.requires("poppler/21.07.0") if self.options.with_proj: - self.requires("proj/9.1.1") + self.requires("proj/9.2.1") if self.options.with_qhull: self.requires("qhull/8.0.1") @@ -320,10 +321,10 @@ def requirements(self): self.requires("libwebp/1.3.1") if self.options.with_xerces: - self.requires("xerces-c/3.2.3") + self.requires("xerces-c/3.2.4") if self.options.with_xml2: - self.requires("libxml2/2.10.3") + self.requires("libxml2/2.11.4") if self.options.with_zlib: self.requires("zlib/1.2.13") @@ -728,7 +729,6 @@ def package(self): copy(self, "LICENSE.TXT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) @@ -888,9 +888,7 @@ def package_info(self): self.cpp_info.requires.extend(['zstd::zstdlib']) gdal_data_path = os.path.join(self.package_folder, "res", "gdal") - self.output.info( - "Prepending to GDAL_DATA environment variable: {}".format( - gdal_data_path)) + self.output.info(f"Prepending to GDAL_DATA environment variable: {gdal_data_path}") self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator self.env_info.GDAL_DATA = gdal_data_path @@ -898,6 +896,5 @@ def package_info(self): if self.options.tools: self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) bin_path = os.path.join(self.package_folder, "bin") - self.output.info( - "Appending PATH environment variable: {}".format(bin_path)) + self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) From d2ab7563e1ecd6bf80d4280e082a62a9260bbc6e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 27 Jul 2023 15:48:24 +0300 Subject: [PATCH 003/105] gdal/post_3.5.0: propagate libjpeg dependency option in graph --- recipes/gdal/post_3.5.0/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 85e68dad5f34f..83a52ddbe70da 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -191,6 +191,12 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + self.options["hdf4"].jpegturbo = self.options.with_jpeg == "libjpeg-turbo" + self.options["libtiff"].jpeg = self.options.with_jpeg + # TODO: add libjpeg options to poppler and podofo recipes + # self.options["poppler"].with_libjpeg = self.options.with_jpeg + # self.options["podofo"].with_libjpeg = self.options.with_jpeg + def layout(self): cmake_layout(self, src_folder="src") From c644aa7141d30838480e0c16876d4fbb090a8287 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 27 Jul 2023 16:03:02 +0300 Subject: [PATCH 004/105] gdal/post_3.5.0: migrate to Conan v2, WIP --- recipes/gdal/post_3.5.0/CMakeLists.txt | 66 +++++++++++--------------- recipes/gdal/post_3.5.0/conanfile.py | 6 +-- 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt index 7c7f67a48db89..c28eceecbce1a 100644 --- a/recipes/gdal/post_3.5.0/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -1,50 +1,38 @@ cmake_minimum_required(VERSION 3.15) project(gdal_cmake_wrapper) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) -include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -include(CMakePushCheckState) - - -if (${GDAL_USE_POPPLER}) - find_package(poppler) +if (GDAL_USE_POPPLER) + find_package(poppler REQUIRED) set(Poppler_VERSION_STRING ${poppler_VERSION}) add_library(Poppler::Poppler ALIAS poppler::libpoppler) endif() -file(GLOB CONAN_GENERATED_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Find*.cmake") -foreach(CMAKE_FILE ${CONAN_GENERATED_CMAKE_FILES}) - include(${CMAKE_FILE}) -endforeach() - -if (${GDAL_USE_ARROW}) +if (GDAL_USE_ARROW) find_package(Arrow REQUIRED) add_library(arrow_shared ALIAS arrow::arrow) endif() -if (${GDAL_USE_CRYPTOPP}) +if (GDAL_USE_CRYPTOPP) find_package(cryptopp REQUIRED) add_library(CRYPTOPP::CRYPTOPP ALIAS ${TARGET_FOR_CRYPTOPP}) endif() -if (${GDAL_USE_DEFLATE}) +if (GDAL_USE_DEFLATE) find_package(libdeflate REQUIRED) add_library(Deflate::Deflate ALIAS ${TARGET_FOR_DEFLATE}) endif() -if (${GDAL_USE_LZ4}) +if (GDAL_USE_LZ4) find_package(lz4 REQUIRED) add_library(LZ4::LZ4 ALIAS lz4::lz4) endif() -if (${GDAL_USE_BLOSC}) +if (GDAL_USE_BLOSC) find_package(c-blosc REQUIRED) add_library(Blosc::Blosc ALIAS c-blosc::c-blosc) endif() -if (${GDAL_USE_OPENEXR}) +if (GDAL_USE_OPENEXR) find_package(Imath REQUIRED) find_package(OpenEXR REQUIRED) add_library(OpenEXR::IlmImf ALIAS OpenEXR::IlmThread) @@ -56,62 +44,62 @@ if (${GDAL_USE_OPENEXR}) target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) endif() -if (${GDAL_USE_FREEXL}) +if (GDAL_USE_FREEXL) find_package(freexl REQUIRED) add_library(FREEXL::freexl ALIAS freexl::freexl) endif() -if (${GDAL_USE_OPENJPEG}) +if (GDAL_USE_OPENJPEG) add_library(OPENJPEG::OpenJPEG ALIAS OpenJPEG::OpenJPEG) endif() -if (${GDAL_USE_GIF}) +if (GDAL_USE_GIF) find_package(GIF REQUIRED) endif() -if (${GDAL_USE_CFITSIO}) +if (GDAL_USE_CFITSIO) find_package(cfitsio) add_library(CFITSIO::CFITSIO ALIAS cfitsio::cfitsio) endif() -if (${GDAL_USE_SQLITE3}) - find_package(SQLite3) +if (GDAL_USE_SQLITE3) + find_package(SQLite3 REQUIRED) endif() -if (${GDAL_USE_LIBXML2}) - find_package(LibXml2) +if (GDAL_USE_LIBXML2) + find_package(LibXml2 REQUIRED) endif() -if (${GDAL_USE_POSTGRESQL}) - find_package(PostgreSQL) +if (GDAL_USE_POSTGRESQL) + find_package(PostgreSQL REQUIRED) add_library(PostgreSQL::PostgreSQL ALIAS PostgreSQL::pq) endif() -if (${GDAL_USE_HDF5}) - find_package(HDF5) +if (GDAL_USE_HDF5) + find_package(HDF5 REQUIRED) set(HDF5_C_LIBRARIES HDF5::C) endif() -if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "libmysqlclient") +if (GDAL_CONAN_PACKAGE_FOR_MYSQL STREQUAL "libmysqlclient") find_package(mysql REQUIRED) endif() -if ("${GDAL_CONAN_PACKAGE_FOR_MYSQL}" STREQUAL "mariadb-connector-c") +if (GDAL_CONAN_PACKAGE_FOR_MYSQL STREQUAL "mariadb-connector-c") find_package(mariadb-connector-c REQUIRED) endif() -if (${GDAL_USE_ZLIB}) - find_package(ZLIB) +if (GDAL_USE_ZLIB) + find_package(ZLIB REQUIRED) endif() -if ("${GDAL_CONAN_PACKAGE_FOR_JPEG}" STREQUAL "libjpeg-turbo") +if (GDAL_CONAN_PACKAGE_FOR_JPEG STREQUAL "libjpeg-turbo") find_package(libjpeg-turbo REQUIRED) add_library(JPEG::JPEG ALIAS ${TARGET_FOR_JPEG}) endif() -if (${GDAL_USE_PCRE2}) +if (GDAL_USE_PCRE2) find_package(PCRE2 REQUIRED) add_library(PCRE2::PCRE2-8 ALIAS PCRE2::8BIT) endif() -add_subdirectory("source_subfolder") +add_subdirectory(src) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 83a52ddbe70da..da1693b7ecde3 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -717,8 +717,8 @@ def generate(self): else: tc.variables["ZSTD_FOUND"] = False - for k, v in tc.variables.items(): - print(k, " = ", v) + # for k, v in tc.variables.items(): + # print(k, " = ", v) tc.generate() @@ -728,7 +728,7 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder=self.source_path.parent) + cmake.configure(build_script_folder=self.export_sources_folder) cmake.build() def package(self): From 616b52bbb5afbfb737e16a82fd672a1e04fb5128 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 19 Aug 2023 15:26:19 +0300 Subject: [PATCH 005/105] gdal/post_3.5.0: tidy --- recipes/gdal/post_3.5.0/conandata.yml | 1 - recipes/gdal/post_3.5.0/conanfile.py | 663 ++++-------------- .../post_3.5.0/test_package/CMakeLists.txt | 2 +- .../post_3.5.0/test_package/test_package.c | 74 +- .../post_3.5.0/test_package/test_package.cpp | 72 +- .../post_3.5.0/test_v1_package/CMakeLists.txt | 4 +- 6 files changed, 224 insertions(+), 592 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index fcd71c4acfec6..c2e3dc05a4f89 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -11,7 +11,6 @@ sources: patches: "3.7.0": - patch_file: "patches/3.7.0/0-replace-find-package.patch" - base_path: "source_subfolder" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" "3.5.1": diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index da1693b7ecde3..69936d3ab2c12 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -1,58 +1,10 @@ -# TODO: verify the Conan v2 migration - import os -from conan import ConanFile, conan_version -from conan.errors import ConanInvalidConfiguration, ConanException -from conan.tools.android import android_abi -from conan.tools.apple import XCRun, fix_apple_shared_install_name, is_apple_os, to_apple_arch -from conan.tools.build import build_jobs, can_run, check_min_cppstd, cross_building, default_cppstd, stdcpp_library, valid_min_cppstd -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name -from conan.tools.files import ( - apply_conandata_patches, - chdir, - collect_libs, - copy, - download, - export_conandata_patches, - get, - load, - mkdir, - patch, - patches, - rename, - replace_in_file, - rm, - rmdir, - save, - symlinks, - unzip, -) -from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain, PkgConfig, PkgConfigDeps -from conan.tools.layout import basic_layout -from conan.tools.meson import MesonToolchain, Meson -from conan.tools.microsoft import ( - MSBuild, - MSBuildDeps, - MSBuildToolchain, - NMakeDeps, - NMakeToolchain, - VCVars, - check_min_vs, - is_msvc, - is_msvc_static_runtime, - msvc_runtime_flag, - unix_path, - unix_path_package_info_legacy, - vs_layout, -) -from conan.tools.scm import Version -from conan.tools.system import package_manager -import functools -import os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir required_conan_version = ">=1.52.0" @@ -64,7 +16,7 @@ class GdalConan(ConanFile): license = "MIT" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/OSGeo/gdal" - topics = ("osgeo", "geospatial", "raster", "vector", "pre-built") + topics = ("osgeo", "geospatial", "raster", "vector") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -203,138 +155,95 @@ def layout(self): def requirements(self): self.requires("json-c/0.16") self.requires("libgeotiff/1.7.1") - if self.options.with_armadillo: self.requires("armadillo/12.2.0") - if self.options.with_arrow: self.requires("arrow/12.0.0") - if self.options.with_blosc: self.requires("c-blosc/1.21.4") - if self.options.with_cfitsio: self.requires("cfitsio/4.2.0") - if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") - if self.options.with_curl: self.requires("libcurl/8.2.1") - if self.options.with_dds: self.requires("crunch/cci.20190615") - if self.options.with_expat: self.requires("expat/2.5.0") - if self.options.with_exr: self.requires("openexr/3.1.9") self.requires("imath/3.1.9") - if self.options.with_freexl: self.requires("freexl/1.0.6") - if self.options.with_geos: self.requires("geos/3.11.2") - if self.options.with_gif: self.requires("giflib/5.2.1") - if self.options.with_gta: self.requires("libgta/1.2.1") - if self.options.with_hdf4: self.requires("hdf4/4.2.15") - if self.options.with_hdf5: self.requires("hdf5/1.14.1") - if self.options.with_heif: self.requires("libheif/1.13.0") - if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/3.0.0") - if self.options.with_kea: self.requires("kealib/1.4.14") - if self.options.with_libdeflate: self.requires("libdeflate/1.18") - if self.options.with_libiconv: self.requires("libiconv/1.17") - if self.options.with_libkml: self.requires("libkml/1.3.0") - if self.options.with_libtiff: self.requires("libtiff/4.5.1") - if self.options.with_lz4: self.requires("lz4/1.9.4") - if self.options.with_mongocxx: self.requires("mongo-cxx-driver/3.7.2") - if self.options.with_mysql == "libmysqlclient": self.requires("libmysqlclient/8.1.0") elif self.options.with_mysql == "mariadb-connector-c": self.requires("mariadb-connector-c/3.3.3") - if self.options.with_netcdf: self.requires("netcdf/4.8.1") - if self.options.with_odbc: self.requires("odbc/2.3.11") - if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") - if self.options.with_openssl: self.requires("openssl/1.1.1v") - if self.options.with_pcre: self.requires("pcre/8.45") - if self.options.with_pcre2: self.requires("pcre2/10.42") - if self.options.with_pg: self.requires("libpq/15.3") - if self.options.with_png: self.requires("libpng/1.6.40") - if self.options.with_podofo: self.requires("podofo/0.9.7") - if self.options.with_poppler: self.requires("poppler/21.07.0") - if self.options.with_proj: self.requires("proj/9.2.1") - if self.options.with_qhull: self.requires("qhull/8.0.1") - if self.options.with_sqlite3: self.requires("sqlite3/3.42.0") - if self.options.with_webp: self.requires("libwebp/1.3.1") - if self.options.with_xerces: self.requires("xerces-c/3.2.4") - if self.options.with_xml2: self.requires("libxml2/2.11.4") - if self.options.with_zlib: self.requires("zlib/1.2.13") - if self.options.with_zstd: self.requires("zstd/1.5.5") @@ -373,357 +282,123 @@ def generate(self): tc = CMakeToolchain(self) if self.options.get_safe("fPIC", True): - tc.variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True - - tc.variables["BUILD_JAVA_BINDINGS"] = False - tc.variables["BUILD_CSHARP_BINDINGS"] = False - tc.variables["BUILD_PYTHON_BINDINGS"] = False - - tc.variables["BUILD_TESTING"] = False - tc.variables["GDAL_USE_ZLIB_INTERNAL"] = False - tc.variables["GDAL_USE_JSONC_INTERNAL"] = False - tc.variables["GDAL_USE_JPEG_INTERNAL"] = False - tc.variables["GDAL_USE_JPEG12_INTERNAL"] = False - tc.variables["GDAL_USE_TIFF_INTERNAL"] = False - tc.variables["GDAL_USE_GEOTIFF_INTERNAL"] = False - tc.variables["GDAL_USE_GIF_INTERNAL"] = False - tc.variables["GDAL_USE_PNG_INTERNAL"] = False + tc.cache_variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True - tc.variables["GDAL_USE_LERC_INTERNAL"] = True - tc.variables["GDAL_USE_SHAPELIB_INTERNAL"] = True + tc.cache_variables["BUILD_JAVA_BINDINGS"] = False + tc.cache_variables["BUILD_CSHARP_BINDINGS"] = False + tc.cache_variables["BUILD_PYTHON_BINDINGS"] = False - tc.variables["BUILD_APPS"] = self.options.tools + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False + tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False - tc.variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata + tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = True + tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = True - tc.variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree + tc.cache_variables["BUILD_APPS"] = self.options.tools - tc.variables["GDAL_USE_JSONC"] = True - tc.variables["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" + tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata - tc.variables["GDAL_USE_GEOTIFF"] = True - tc.variables["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" - tc.variables["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" - - tc.variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo - if self.options.with_armadillo: - tc.variables["GDAL_CONAN_PACKAGE_FOR_ARMADILLO"] = "armadillo" - tc.variables["TARGET_FOR_ARMADILLO"] = self.dependencies["armadillo"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Armadillo_FOUND"] = False + tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree - tc.variables["GDAL_USE_ARROW"] = self.options.with_arrow - if self.options.with_arrow: - tc.variables["GDAL_CONAN_PACKAGE_FOR_ARROW"] = "arrow" - tc.variables["TARGET_FOR_ARROW"] = self.dependencies["arrow"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Arrow_FOUND"] = False + tc.cache_variables["GDAL_USE_JSONC"] = True + tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" - tc.variables["GDAL_USE_BLOSC"] = self.options.with_blosc - if self.options.with_blosc: - tc.variables["GDAL_CONAN_PACKAGE_FOR_BLOSC"] = "c-blosc" - tc.variables["TARGET_FOR_BLOSC"] = self.dependencies["c-blosc"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Blosc_FOUND"] = False + tc.cache_variables["GDAL_USE_GEOTIFF"] = True + tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" + tc.cache_variables["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" - tc.variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio - if self.options.with_cfitsio: - tc.variables["GDAL_CONAN_PACKAGE_FOR_CFITSIO"] = "cfitsio" - tc.variables["TARGET_FOR_CFITSIO"] = self.dependencies["cfitsio"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["CFITSIO_FOUND"] = False - - tc.variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp - if self.options.with_cryptopp: - tc.variables["GDAL_CONAN_PACKAGE_FOR_CRYPTOPP"] = "cryptopp" - tc.variables["TARGET_FOR_CRYPTOPP"] = self.dependencies["cryptopp"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["CryptoPP_FOUND"] = False - - tc.variables["GDAL_USE_CURL"] = self.options.with_curl - if self.options.with_curl: - tc.variables["GDAL_CONAN_PACKAGE_FOR_CURL"] = "libcurl" - tc.variables["TARGET_FOR_CURL"] = self.dependencies["libcurl"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["CURL_FOUND"] = False - - tc.variables["GDAL_USE_CRNLIB"] = self.options.with_dds - if self.options.with_dds: - tc.variables["GDAL_CONAN_PACKAGE_FOR_CRNLIB"] = "crunch" - tc.variables["TARGET_FOR_CRNLIB"] = self.dependencies["crunch"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Crnlib_FOUND"] = False - - tc.variables["GDAL_USE_EXPAT"] = self.options.with_expat - if self.options.with_expat: - tc.variables["GDAL_CONAN_PACKAGE_FOR_EXPAT"] = "expat" - tc.variables["TARGET_FOR_EXPAT"] = "EXPAT::EXPAT" - else: - tc.variables["EXPAT_FOUND"] = False - - tc.variables["GDAL_USE_OPENEXR"] = self.options.with_exr - if self.options.with_exr: - tc.variables["GDAL_CONAN_PACKAGE_FOR_OPENEXR"] = "openexr" - tc.variables["TARGET_FOR_OPENEXR"] = self.dependencies["openexr"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["OpenEXR_FOUND"] = False - - tc.variables["GDAL_USE_FREEXL"] = self.options.with_freexl - if self.options.with_freexl: - tc.variables["GDAL_CONAN_PACKAGE_FOR_FREEXL"] = "freexl" - tc.variables["TARGET_FOR_FREEXL"] = "freexl::freexl" - else: - tc.variables["FreeXL_FOUND"] = False - - tc.variables["GDAL_USE_GEOS"] = self.options.with_geos - if self.options.with_geos: - tc.variables["GDAL_CONAN_PACKAGE_FOR_GEOS"] = "geos" - tc.variables["TARGET_FOR_GEOS"] = self.dependencies["geos"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["GEOS_FOUND"] = False - - tc.variables["GDAL_USE_GIF"] = self.options.with_gif - if self.options.with_gif: - tc.variables["GDAL_CONAN_PACKAGE_FOR_GIF"] = "giflib" - tc.variables["TARGET_FOR_GIF"] = self.dependencies["giflib"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["GIF_FOUND"] = False - - tc.variables["GDAL_USE_GTA"] = self.options.with_gta - if self.options.with_gta: - tc.variables["GDAL_CONAN_PACKAGE_FOR_GTA"] = "libgta" - tc.variables["TARGET_FOR_GTA"] = self.dependencies["libgta"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["GTA_FOUND"] = False - - tc.variables["GDAL_USE_HDF4"] = self.options.with_hdf4 - if self.options.with_hdf4: - tc.variables["GDAL_CONAN_PACKAGE_FOR_HDF4"] = "hdf4" - tc.variables["TARGET_FOR_HDF4"] = self.dependencies["hdf4"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["HDF4_FOUND"] = False - - tc.variables["GDAL_USE_HDF5"] = self.options.with_hdf5 - if self.options.with_hdf5: - tc.variables["GDAL_CONAN_PACKAGE_FOR_HDF5"] = "hdf5" - tc.variables["TARGET_FOR_HDF5"] = self.dependencies["hdf5"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["HDF5_FOUND"] = False - - tc.variables["GDAL_USE_HEIF"] = self.options.with_heif - if self.options.with_heif: - tc.variables["GDAL_CONAN_PACKAGE_FOR_HEIF"] = "libheif" - tc.variables["TARGET_FOR_HEIF"] = self.dependencies["libheif"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["HEIF_FOUND"] = False - - tc.variables["GDAL_USE_KEA"] = self.options.with_kea - if self.options.with_kea: - tc.variables["GDAL_CONAN_PACKAGE_FOR_KEA"] = "kealib" - tc.variables["TARGET_FOR_KEA"] = self.dependencies["kealib"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["KEA_FOUND"] = False - - tc.variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate - if self.options.with_libdeflate: - tc.variables["GDAL_CONAN_PACKAGE_FOR_DEFLATE"] = "libdeflate" - tc.variables["TARGET_FOR_DEFLATE"] = self.dependencies["libdeflate"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Deflate_FOUND"] = False - - tc.variables["GDAL_USE_ICONV"] = self.options.with_libiconv - if self.options.with_libiconv: - tc.variables["GDAL_CONAN_PACKAGE_FOR_ICONV"] = "libiconv" - tc.variables["TARGET_FOR_ICONV"] = self.dependencies["libiconv"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Iconv_FOUND"] = False + tc.cache_variables["GDAL_USE_PDFIUM"] = False + tc.cache_variables["PDFIUM_FOUND"] = False if self.options.with_jpeg == "libjpeg" or self.options.with_jpeg == "libjpeg-turbo": print(f"self.options.with_jpeg: {self.options.with_jpeg}") - tc.variables["GDAL_USE_JPEG"] = True - tc.variables["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg - tc.variables["TARGET_FOR_JPEG"] = ( + tc.cache_variables["GDAL_USE_JPEG"] = True + tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg + tc.cache_variables["TARGET_FOR_JPEG"] = ( "JPEG::JPEG" if self.options.with_jpeg == "libjpeg" else self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"].get_property("cmake_target_name") ) else: - tc.variables["JPEG_FOUND"] = False - - tc.variables["GDAL_USE_LIBKML"] = self.options.with_libkml - if self.options.with_libkml: - tc.variables["GDAL_CONAN_PACKAGE_FOR_LIBKML"] = "libkml" - tc.variables["TARGET_FOR_LIBKML"] = self.dependencies["libkml"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["LibKML_FOUND"] = False - - tc.variables["GDAL_USE_TIFF"] = self.options.with_libtiff - if self.options.with_libtiff: - tc.variables["GDAL_CONAN_PACKAGE_FOR_TIFF"] = "libtiff" - tc.variables["TARGET_FOR_TIFF"] = self.dependencies["libtiff"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["TIFF_FOUND"] = False - - tc.variables["GDAL_USE_LZ4"] = self.options.with_lz4 - if self.options.with_lz4: - tc.variables["GDAL_CONAN_PACKAGE_FOR_LZ4"] = "lz4" - tc.variables["TARGET_FOR_LZ4"] = self.dependencies["lz4"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["LZ4_FOUND"] = False - - tc.variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx - if self.options.with_mongocxx: - tc.variables["GDAL_CONAN_PACKAGE_FOR_MONGOCXX"] = "mongo-cxx-driver" - tc.variables["TARGET_FOR_MONGOCXX"] = self.dependencies["mongo-cxx-driver"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["MONGOCXX_FOUND"] = False + tc.cache_variables["JPEG_FOUND"] = False if self.options.with_mysql == "libmysqlclient" or self.options.with_mysql == "mariadb-connector-c": - tc.variables["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) - tc.variables["TARGET_FOR_MYSQL"] = ( + tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) + tc.cache_variables["TARGET_FOR_MYSQL"] = ( "mariadb-connector-c::mariadb-connector-c" if self.options.with_mysql == "mariadb-connector-c" else "libmysqlclient::libmysqlclient" ) else: - tc.variables["MYSQL_FOUND"] = False - - tc.variables["GDAL_USE_NETCDF"] = self.options.with_netcdf - if self.options.with_netcdf: - tc.variables["GDAL_CONAN_PACKAGE_FOR_NETCDF"] = "netcdf" - tc.variables["TARGET_FOR_NETCDF"] = self.dependencies["netcdf"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["NetCDF_FOUND"] = False - - tc.variables["GDAL_USE_ODBC"] = self.options.with_odbc - if self.options.with_odbc: - tc.variables["GDAL_CONAN_PACKAGE_FOR_ODBC"] = "odbc" - tc.variables["TARGET_FOR_ODBC"] = self.dependencies["odbc"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["ODBC_FOUND"] = False - - tc.variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg - if self.options.with_openjpeg: - tc.variables["GDAL_CONAN_PACKAGE_FOR_OPENJPEG"] = "openjpeg" - tc.variables["TARGET_FOR_OPENJPEG"] = self.dependencies["openjpeg"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["OPENJPEG_FOUND"] = False - - tc.variables["GDAL_USE_OPENSSL"] = self.options.with_openssl - if self.options.with_openssl: - tc.variables["GDAL_CONAN_PACKAGE_FOR_OPENSSL"] = "openssl" - tc.variables["TARGET_FOR_OPENSSL"] = self.dependencies["openssl"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["OpenSSL_FOUND"] = False - - tc.variables["GDAL_USE_PCRE"] = self.options.with_pcre - if self.options.with_pcre: - tc.variables["GDAL_CONAN_PACKAGE_FOR_PCRE"] = "pcre" - tc.variables["TARGET_FOR_PCRE"] = self.dependencies["pcre"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["PCRE_FOUND"] = False - - tc.variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 - if self.options.with_pcre2: - tc.variables["GDAL_CONAN_PACKAGE_FOR_PCRE2"] = "pcre2" - tc.variables["TARGET_FOR_PCRE2"] = self.dependencies["pcre2"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["PCRE2_FOUND"] = False - - tc.variables["GDAL_USE_PDFIUM"] = False - tc.variables["PDFIUM_FOUND"] = False - - tc.variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg - if self.options.with_pg: - tc.variables["GDAL_CONAN_PACKAGE_FOR_POSTGRESQL"] = "libpq" - tc.variables["TARGET_FOR_POSTGRESQL"] = self.dependencies["libpq"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["PostgreSQL_FOUND"] = False - - tc.variables["GDAL_USE_PNG"] = self.options.with_png - if self.options.with_png: - tc.variables["GDAL_CONAN_PACKAGE_FOR_PNG"] = "libpng" - tc.variables["TARGET_FOR_PNG"] = self.dependencies["libpng"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["PNG_FOUND"] = False - - tc.variables["GDAL_USE_PODOFO"] = self.options.with_podofo - if self.options.with_podofo: - tc.variables["GDAL_CONAN_PACKAGE_FOR_PODOFO"] = "podofo" - tc.variables["TARGET_FOR_PODOFO"] = self.dependencies["podofo"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Podofo_FOUND"] = False - - tc.variables["GDAL_USE_POPPLER"] = self.options.with_poppler - if self.options.with_poppler: - tc.variables["GDAL_CONAN_PACKAGE_FOR_POPPLER"] = "poppler" - tc.variables["TARGET_FOR_POPPLER"] = self.dependencies["poppler"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["Poppler_FOUND"] = False - - tc.variables["GDAL_USE_PROJ"] = self.options.with_proj - if self.options.with_proj: - tc.variables["GDAL_CONAN_PACKAGE_FOR_PROJ"] = "proj" - tc.variables["TARGET_FOR_PROJ"] = self.dependencies["proj"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["PROJ_FOUND"] = False - - tc.variables["GDAL_USE_QHULL"] = self.options.with_qhull - if self.options.with_qhull: - tc.variables["GDAL_CONAN_PACKAGE_FOR_QHULL"] = "qhull" - tc.variables["TARGET_FOR_QHULL"] = self.dependencies["qhull"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["QHULL_FOUND"] = False - - tc.variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 - if self.options.with_sqlite3: - tc.variables["GDAL_CONAN_PACKAGE_FOR_SQLITE3"] = "sqlite3" - tc.variables["TARGET_FOR_SQLITE3"] = self.dependencies["sqlite3"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["SQLite3_FOUND"] = False - - tc.variables["GDAL_USE_WEBP"] = self.options.with_webp - if self.options.with_webp: - tc.variables["GDAL_CONAN_PACKAGE_FOR_WEBP"] = "libwebp" - tc.variables["TARGET_FOR_WEBP"] = self.dependencies["libwebp"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["WebP_FOUND"] = False - - tc.variables["GDAL_USE_XERCESC"] = self.options.with_xerces - if self.options.with_xerces: - tc.variables["GDAL_CONAN_PACKAGE_FOR_XERCESC"] = "xerces-c" - tc.variables["TARGET_FOR_XERCESC"] = self.dependencies["xerces-c"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["XercesC_FOUND"] = False - - tc.variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 - if self.options.with_xml2: - tc.variables["GDAL_CONAN_PACKAGE_FOR_LIBXML2"] = "libxml2" - tc.variables["TARGET_FOR_LIBXML2"] = self.dependencies["libxml2"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["LibXml2_FOUND"] = False - - tc.variables["GDAL_USE_ZLIB"] = self.options.with_zlib - if self.options.with_zlib: - tc.variables["GDAL_CONAN_PACKAGE_FOR_ZLIB"] = "zlib" - tc.variables["TARGET_FOR_ZLIB"] = self.dependencies["zlib"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["ZLIB_FOUND"] = False - - tc.variables["GDAL_USE_ZSTD"] = self.options.with_zstd - if self.options.with_zstd: - tc.variables["GDAL_CONAN_PACKAGE_FOR_ZSTD"] = "zstd" - tc.variables["TARGET_FOR_ZSTD"] = self.dependencies["zstd"].cpp_info.get_property("cmake_target_name") - else: - tc.variables["ZSTD_FOUND"] = False - - # for k, v in tc.variables.items(): + tc.cache_variables["MYSQL_FOUND"] = False + + def _configure_dependency(name, pkg_name=None, param_name=None): + pkg_name = pkg_name or name.lower() + param_name = param_name or name.lower() + available = self.options.get_safe(f"with_{param_name}", False) + tc.cache_variables[f"GDAL_USE_{name.upper()}"] = available + if available: + tc.cache_variables[f"GDAL_CONAN_PACKAGE_FOR_{name.upper()}"] = pkg_name + tc.cache_variables[f"TARGET_FOR_{name.upper()}"] = self.dependencies[pkg_name].cpp_info.get_property("cmake_target_name") + else: + tc.cache_variables[f"{name}_FOUND"] = False + + _configure_dependency("Armadillo") + _configure_dependency("Arrow") + _configure_dependency("Blosc", pkg_name="c-blosc") + _configure_dependency("CFITSIO") + _configure_dependency("CURL") + _configure_dependency("Crnlib", pkg_name="crunch", param_name="dds") + _configure_dependency("CryptoPP") + _configure_dependency("Deflate", pkg_name="libdeflate", param_name="libdeflate") + _configure_dependency("EXPAT") + _configure_dependency("FreeXL") + _configure_dependency("GEOS") + _configure_dependency("GIF", pkg_name="giflib") + _configure_dependency("GTA", pkg_name="libgta") + _configure_dependency("HDF4") + _configure_dependency("HDF5") + _configure_dependency("HEIF", pkg_name="libheif") + _configure_dependency("Iconv", pkg_name="libiconv", param_name="libiconv") + _configure_dependency("KEA", pkg_name="kealib") + _configure_dependency("LZ4") + _configure_dependency("LibKML") + _configure_dependency("LibXml2", pkg_name="libxml2", param_name="xml2") + _configure_dependency("MONGOCXX", pkg_name="mongo-cxx-driver") + _configure_dependency("NetCDF") + _configure_dependency("ODBC") + _configure_dependency("OPENJPEG") + _configure_dependency("OpenEXR", param_name="exr") + _configure_dependency("OpenSSL") + _configure_dependency("PCRE") + _configure_dependency("PCRE2") + _configure_dependency("PNG", pkg_name="libpng") + _configure_dependency("PROJ") + _configure_dependency("Podofo") + _configure_dependency("Poppler") + _configure_dependency("PostgreSQL", pkg_name="libpq", param_name="pg") + _configure_dependency("QHULL") + _configure_dependency("SQLite3") + _configure_dependency("TIFF", pkg_name="libtiff", param_name="libtiff") + _configure_dependency("WebP", pkg_name="libwebp") + _configure_dependency("XercesC", pkg_name="xerces-c", param_name="xerces") + _configure_dependency("ZLIB") + _configure_dependency("ZSTD") + + # for k, v in tc.cache_variables.items(): # print(k, " = ", v) tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) @@ -746,161 +421,119 @@ def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("pkg_config_name", "gdal") - self.cpp_info.names["cmake_find_package"] = "GDAL" - self.cpp_info.names["cmake_find_package_multi"] = "GDAL" - self.cpp_info.filenames["cmake_find_package"] = "GDAL" - self.cpp_info.filenames["cmake_find_package_multi"] = "GDAL" - libname = "gdal" if self.settings.os == "Windows": if self.settings.build_type == "Debug": libname += "d" self.cpp_info.libs = [libname] - self.cpp_info.requires.extend(['json-c::json-c']) - self.cpp_info.requires.extend(['libgeotiff::libgeotiff']) - + self.cpp_info.requires.extend(["json-c::json-c"]) + self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) if self.options.with_armadillo: - self.cpp_info.requires.extend(['armadillo::armadillo']) - + self.cpp_info.requires.extend(["armadillo::armadillo"]) if self.options.with_arrow: - self.cpp_info.requires.extend(['arrow::libarrow']) - + self.cpp_info.requires.extend(["arrow::libarrow"]) if self.options.with_blosc: - self.cpp_info.requires.extend(['c-blosc::c-blosc']) - + self.cpp_info.requires.extend(["c-blosc::c-blosc"]) if self.options.with_cfitsio: - self.cpp_info.requires.extend(['cfitsio::cfitsio']) - + self.cpp_info.requires.extend(["cfitsio::cfitsio"]) if self.options.with_cryptopp: - self.cpp_info.requires.extend(['cryptopp::libcryptopp']) - + self.cpp_info.requires.extend(["cryptopp::libcryptopp"]) if self.options.with_curl: - self.cpp_info.requires.extend(['libcurl::curl']) - + self.cpp_info.requires.extend(["libcurl::curl"]) if self.options.with_dds: - self.cpp_info.requires.extend(['crunch::crunch']) - + self.cpp_info.requires.extend(["crunch::crunch"]) if self.options.with_expat: - self.cpp_info.requires.extend(['expat::expat']) - + self.cpp_info.requires.extend(["expat::expat"]) if self.options.with_exr: - self.cpp_info.requires.extend(['openexr::openexr', 'imath::imath']) - + self.cpp_info.requires.extend(["openexr::openexr", "imath::imath"]) if self.options.with_freexl: - self.cpp_info.requires.extend(['freexl::freexl']) - + self.cpp_info.requires.extend(["freexl::freexl"]) if self.options.with_geos: - self.cpp_info.requires.extend(['geos::geos_c']) - + self.cpp_info.requires.extend(["geos::geos_c"]) if self.options.with_gif: - self.cpp_info.requires.extend(['giflib::giflib']) - + self.cpp_info.requires.extend(["giflib::giflib"]) if self.options.with_gta: - self.cpp_info.requires.extend(['libgta::libgta']) - + self.cpp_info.requires.extend(["libgta::libgta"]) if self.options.with_hdf4: - self.cpp_info.requires.extend(['hdf4::hdf4']) - + self.cpp_info.requires.extend(["hdf4::hdf4"]) if self.options.with_hdf5: - self.cpp_info.requires.extend(['hdf5::hdf5_c']) - + self.cpp_info.requires.extend(["hdf5::hdf5_c"]) if self.options.with_heif: - self.cpp_info.requires.extend(['libheif::libheif']) - + self.cpp_info.requires.extend(["libheif::libheif"]) if self.options.with_kea: - self.cpp_info.requires.extend(['kealib::kealib']) - + self.cpp_info.requires.extend(["kealib::kealib"]) if self.options.with_libdeflate: - self.cpp_info.requires.extend(['libdeflate::libdeflate']) - + self.cpp_info.requires.extend(["libdeflate::libdeflate"]) if self.options.with_libiconv: - self.cpp_info.requires.extend(['libiconv::libiconv']) - + self.cpp_info.requires.extend(["libiconv::libiconv"]) if self.options.with_jpeg == "libjpeg": - self.cpp_info.requires.extend(['libjpeg::libjpeg']) + self.cpp_info.requires.extend(["libjpeg::libjpeg"]) elif self.options.with_jpeg == "libjpeg-turbo": - self.cpp_info.requires.extend(['libjpeg-turbo::turbojpeg']) - + self.cpp_info.requires.extend(["libjpeg-turbo::turbojpeg"]) if self.options.with_libkml: - self.cpp_info.requires.extend(['libkml::kmldom', 'libkml::kmlengine']) - + self.cpp_info.requires.extend(["libkml::kmldom", "libkml::kmlengine"]) if self.options.with_libtiff: - self.cpp_info.requires.extend(['libtiff::libtiff']) - + self.cpp_info.requires.extend(["libtiff::libtiff"]) if self.options.with_lz4: - self.cpp_info.requires.extend(['lz4::lz4']) - + self.cpp_info.requires.extend(["lz4::lz4"]) if self.options.with_mongocxx: - self.cpp_info.requires.extend(['mongo-cxx-driver::mongo-cxx-driver']) - + self.cpp_info.requires.extend(["mongo-cxx-driver::mongo-cxx-driver"]) if self.options.with_mysql == "libmysqlclient": - self.cpp_info.requires.extend(['libmysqlclient::libmysqlclient']) + self.cpp_info.requires.extend(["libmysqlclient::libmysqlclient"]) elif self.options.with_mysql == "mariadb-connector-c": - self.cpp_info.requires.extend(['mariadb-connector-c::mariadb-connector-c']) - + self.cpp_info.requires.extend(["mariadb-connector-c::mariadb-connector-c"]) if self.options.with_netcdf: - self.cpp_info.requires.extend(['netcdf::netcdf']) - + self.cpp_info.requires.extend(["netcdf::netcdf"]) if self.options.with_odbc: - self.cpp_info.requires.extend(['odbc::odbc']) - + self.cpp_info.requires.extend(["odbc::odbc"]) if self.options.with_openjpeg: - self.cpp_info.requires.extend(['openjpeg::openjpeg']) - + self.cpp_info.requires.extend(["openjpeg::openjpeg"]) if self.options.with_openssl: - self.cpp_info.requires.extend(['openssl::ssl']) - + self.cpp_info.requires.extend(["openssl::ssl"]) if self.options.with_pcre: - self.cpp_info.requires.extend(['pcre::pcre']) - + self.cpp_info.requires.extend(["pcre::pcre"]) if self.options.with_pcre2: - self.cpp_info.requires.extend(['pcre2::pcre2-8']) - + self.cpp_info.requires.extend(["pcre2::pcre2-8"]) if self.options.with_pg: - self.cpp_info.requires.extend(['libpq::pq']) - + self.cpp_info.requires.extend(["libpq::pq"]) if self.options.with_png: - self.cpp_info.requires.extend(['libpng::libpng']) - + self.cpp_info.requires.extend(["libpng::libpng"]) if self.options.with_podofo: - self.cpp_info.requires.extend(['podofo::podofo']) - + self.cpp_info.requires.extend(["podofo::podofo"]) if self.options.with_poppler: - self.cpp_info.requires.extend(['poppler::libpoppler']) - + self.cpp_info.requires.extend(["poppler::libpoppler"]) if self.options.with_proj: - self.cpp_info.requires.extend(['proj::projlib']) - + self.cpp_info.requires.extend(["proj::projlib"]) if self.options.with_qhull: - self.cpp_info.requires.extend(['qhull::libqhull']) - + self.cpp_info.requires.extend(["qhull::libqhull"]) if self.options.with_sqlite3: - self.cpp_info.requires.extend(['sqlite3::sqlite']) - + self.cpp_info.requires.extend(["sqlite3::sqlite"]) if self.options.with_webp: - self.cpp_info.requires.extend(['libwebp::libwebp']) - + self.cpp_info.requires.extend(["libwebp::libwebp"]) if self.options.with_xerces: - self.cpp_info.requires.extend(['xerces-c::xerces-c']) - + self.cpp_info.requires.extend(["xerces-c::xerces-c"]) if self.options.with_xml2: - self.cpp_info.requires.extend(['libxml2::libxml2']) - + self.cpp_info.requires.extend(["libxml2::libxml2"]) if self.options.with_zlib: - self.cpp_info.requires.extend(['zlib::zlib']) - + self.cpp_info.requires.extend(["zlib::zlib"]) if self.options.with_zstd: - self.cpp_info.requires.extend(['zstd::zstdlib']) + self.cpp_info.requires.extend(["zstd::zstdlib"]) gdal_data_path = os.path.join(self.package_folder, "res", "gdal") self.output.info(f"Prepending to GDAL_DATA environment variable: {gdal_data_path}") self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) - # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator - self.env_info.GDAL_DATA = gdal_data_path if self.options.tools: self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) + + self.cpp_info.names["cmake_find_package"] = "GDAL" + self.cpp_info.names["cmake_find_package_multi"] = "GDAL" + self.cpp_info.filenames["cmake_find_package"] = "GDAL" + self.cpp_info.filenames["cmake_find_package_multi"] = "GDAL" + if self.options.tools: bin_path = os.path.join(self.package_folder, "bin") self.output.info(f"Appending PATH environment variable: {bin_path}") self.env_info.PATH.append(bin_path) + # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator + self.env_info.GDAL_DATA = gdal_data_path diff --git a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt index fa9f0f5580ed7..356b571fb9c63 100644 --- a/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(test_package LANGUAGES CXX) +project(test_package) find_package(GDAL REQUIRED CONFIG) diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.c b/recipes/gdal/post_3.5.0/test_package/test_package.c index 863d204802b9f..e4faf1b9e561d 100644 --- a/recipes/gdal/post_3.5.0/test_package/test_package.c +++ b/recipes/gdal/post_3.5.0/test_package/test_package.c @@ -4,55 +4,55 @@ #include int main() { - GDALAllRegister(); + GDALAllRegister(); - const char *pszDriverName = "ESRI Shapefile"; - GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); - if (!hDriver) { - printf("%s driver not available.\n", pszDriverName); - exit(1); - } + const char *pszDriverName = "ESRI Shapefile"; + GDALDriverH hDriver = GDALGetDriverByName(pszDriverName); + if (!hDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } - GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); - if (!hDS) { - printf("Creation of output file failed.\n"); - exit(1); - } + GDALDatasetH hDS = GDALCreate(hDriver, "point_out_c.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!hDS) { + printf("Creation of output file failed.\n"); + exit(1); + } - OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); - if (!hLayer) { - printf("Layer creation failed.\n"); - exit(1); - } + OGRLayerH hLayer = GDALDatasetCreateLayer(hDS, "point_out", NULL, wkbPoint, NULL); + if (!hLayer) { + printf("Layer creation failed.\n"); + exit(1); + } - OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); + OGRFieldDefnH hFieldDefn = OGR_Fld_Create("Name", OFTString); - OGR_Fld_SetWidth(hFieldDefn, 32); + OGR_Fld_SetWidth(hFieldDefn, 32); - if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { - printf("Creating Name field failed.\n"); - exit(1); - } + if (OGR_L_CreateField(hLayer, hFieldDefn, TRUE) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } - OGR_Fld_Destroy(hFieldDefn); + OGR_Fld_Destroy(hFieldDefn); - OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); - OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); + OGRFeatureH hFeature = OGR_F_Create(OGR_L_GetLayerDefn(hLayer)); + OGR_F_SetFieldString(hFeature, OGR_F_GetFieldIndex(hFeature, "Name"), "conan"); - OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); - OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); + OGRGeometryH hPt = OGR_G_CreateGeometry(wkbPoint); + OGR_G_SetPoint_2D(hPt, 0, 40.74, -27.891); - OGR_F_SetGeometry(hFeature, hPt); - OGR_G_DestroyGeometry(hPt); + OGR_F_SetGeometry(hFeature, hPt); + OGR_G_DestroyGeometry(hPt); - if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { - printf("Failed to create feature in shapefile.\n"); - exit(1); - } + if (OGR_L_CreateFeature(hLayer, hFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit(1); + } - OGR_F_Destroy(hFeature); + OGR_F_Destroy(hFeature); - GDALClose(hDS); + GDALClose(hDS); - return 0; + return 0; } diff --git a/recipes/gdal/post_3.5.0/test_package/test_package.cpp b/recipes/gdal/post_3.5.0/test_package/test_package.cpp index a556f4a451a72..ec77987bc5ece 100644 --- a/recipes/gdal/post_3.5.0/test_package/test_package.cpp +++ b/recipes/gdal/post_3.5.0/test_package/test_package.cpp @@ -4,51 +4,51 @@ #include int main() { - GDALAllRegister(); + GDALAllRegister(); - const char *pszDriverName = "ESRI Shapefile"; - GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); - if (!poDriver) { - printf("%s driver not available.\n", pszDriverName); - exit(1); - } + const char *pszDriverName = "ESRI Shapefile"; + GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszDriverName); + if (!poDriver) { + printf("%s driver not available.\n", pszDriverName); + exit(1); + } - GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); - if (!poDS) { - printf("Creation of output file failed.\n"); - exit(1); - } + GDALDataset *poDS = poDriver->Create("point_out_cpp.shp", 0, 0, 0, GDT_Unknown, NULL); + if (!poDS) { + printf("Creation of output file failed.\n"); + exit(1); + } - OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); - if (!poLayer) { - printf("Layer creation failed.\n"); - exit(1); - } + OGRLayer *poLayer = poDS->CreateLayer("point_out", NULL, wkbPoint, NULL); + if (!poLayer) { + printf("Layer creation failed.\n"); + exit(1); + } - OGRFieldDefn oField("Name", OFTString); - oField.SetWidth(32); + OGRFieldDefn oField("Name", OFTString); + oField.SetWidth(32); - if (poLayer->CreateField(&oField) != OGRERR_NONE) { - printf("Creating Name field failed.\n"); - exit(1); - } + if (poLayer->CreateField(&oField) != OGRERR_NONE) { + printf("Creating Name field failed.\n"); + exit(1); + } - OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); - poFeature->SetField("Name", "conan"); + OGRFeature *poFeature = OGRFeature::CreateFeature(poLayer->GetLayerDefn()); + poFeature->SetField("Name", "conan"); - OGRPoint pt; - pt.setX(40.74); - pt.setY(-27.891); - poFeature->SetGeometry(&pt); + OGRPoint pt; + pt.setX(40.74); + pt.setY(-27.891); + poFeature->SetGeometry(&pt); - if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { - printf("Failed to create feature in shapefile.\n"); - exit(1); - } + if (poLayer->CreateFeature(poFeature) != OGRERR_NONE) { + printf("Failed to create feature in shapefile.\n"); + exit( 1 ); + } - OGRFeature::DestroyFeature(poFeature); + OGRFeature::DestroyFeature(poFeature); - GDALClose(poDS); + GDALClose(poDS); - return 0; + return 0; } diff --git a/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt b/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt index 91630d79f4abb..b21cc49efde95 100644 --- a/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt +++ b/recipes/gdal/post_3.5.0/test_v1_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) From c4463481cc189ba6d11febb02657d4116b519fd4 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 19 Aug 2023 22:37:03 +0300 Subject: [PATCH 006/105] gdal/post_3.5.0: adapt ConanFindPackage.cmake to make use of deps.set_properties() for renames --- recipes/gdal/post_3.5.0/CMakeLists.txt | 105 ------ .../post_3.5.0/cmake/ConanFindPackage.cmake | 27 ++ recipes/gdal/post_3.5.0/conanfile.py | 299 +++++++++++------- .../3.5.1/0-replace-find-package.patch | 84 ++--- .../3.5.2/0-replace-find-package.patch | 49 --- .../3.7.0/0-replace-find-package.patch | 47 --- 6 files changed, 227 insertions(+), 384 deletions(-) delete mode 100644 recipes/gdal/post_3.5.0/CMakeLists.txt create mode 100644 recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt deleted file mode 100644 index c28eceecbce1a..0000000000000 --- a/recipes/gdal/post_3.5.0/CMakeLists.txt +++ /dev/null @@ -1,105 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(gdal_cmake_wrapper) - -if (GDAL_USE_POPPLER) - find_package(poppler REQUIRED) - set(Poppler_VERSION_STRING ${poppler_VERSION}) - add_library(Poppler::Poppler ALIAS poppler::libpoppler) -endif() - -if (GDAL_USE_ARROW) - find_package(Arrow REQUIRED) - add_library(arrow_shared ALIAS arrow::arrow) -endif() - -if (GDAL_USE_CRYPTOPP) - find_package(cryptopp REQUIRED) - add_library(CRYPTOPP::CRYPTOPP ALIAS ${TARGET_FOR_CRYPTOPP}) -endif() - -if (GDAL_USE_DEFLATE) - find_package(libdeflate REQUIRED) - add_library(Deflate::Deflate ALIAS ${TARGET_FOR_DEFLATE}) -endif() - -if (GDAL_USE_LZ4) - find_package(lz4 REQUIRED) - add_library(LZ4::LZ4 ALIAS lz4::lz4) -endif() - -if (GDAL_USE_BLOSC) - find_package(c-blosc REQUIRED) - add_library(Blosc::Blosc ALIAS c-blosc::c-blosc) -endif() - -if (GDAL_USE_OPENEXR) - find_package(Imath REQUIRED) - find_package(OpenEXR REQUIRED) - add_library(OpenEXR::IlmImf ALIAS OpenEXR::IlmThread) - add_library(OpenEXR::IlmImfUtil ALIAS OpenEXR::OpenEXR) - add_library(OpenEXR::Half ALIAS Imath::Imath) - # gdal includes without "Imath/" folder prefix - target_include_directories(Imath::Imath INTERFACE ${Imath_INCLUDE_DIR}) - # and also without "OpenEXR/" prefix - target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) -endif() - -if (GDAL_USE_FREEXL) - find_package(freexl REQUIRED) - add_library(FREEXL::freexl ALIAS freexl::freexl) -endif() - -if (GDAL_USE_OPENJPEG) - add_library(OPENJPEG::OpenJPEG ALIAS OpenJPEG::OpenJPEG) -endif() - -if (GDAL_USE_GIF) - find_package(GIF REQUIRED) -endif() - -if (GDAL_USE_CFITSIO) - find_package(cfitsio) - add_library(CFITSIO::CFITSIO ALIAS cfitsio::cfitsio) -endif() - -if (GDAL_USE_SQLITE3) - find_package(SQLite3 REQUIRED) -endif() - -if (GDAL_USE_LIBXML2) - find_package(LibXml2 REQUIRED) -endif() - -if (GDAL_USE_POSTGRESQL) - find_package(PostgreSQL REQUIRED) - add_library(PostgreSQL::PostgreSQL ALIAS PostgreSQL::pq) -endif() - -if (GDAL_USE_HDF5) - find_package(HDF5 REQUIRED) - set(HDF5_C_LIBRARIES HDF5::C) -endif() - -if (GDAL_CONAN_PACKAGE_FOR_MYSQL STREQUAL "libmysqlclient") - find_package(mysql REQUIRED) -endif() -if (GDAL_CONAN_PACKAGE_FOR_MYSQL STREQUAL "mariadb-connector-c") - find_package(mariadb-connector-c REQUIRED) -endif() - -if (GDAL_USE_ZLIB) - find_package(ZLIB REQUIRED) -endif() - -if (GDAL_CONAN_PACKAGE_FOR_JPEG STREQUAL "libjpeg-turbo") - find_package(libjpeg-turbo REQUIRED) - add_library(JPEG::JPEG ALIAS ${TARGET_FOR_JPEG}) -endif() - -if (GDAL_USE_PCRE2) - find_package(PCRE2 REQUIRED) - add_library(PCRE2::PCRE2-8 ALIAS PCRE2::8BIT) -endif() - - -add_subdirectory(src) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake new file mode 100644 index 0000000000000..b3671a9169d24 --- /dev/null +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -0,0 +1,27 @@ +function(define_find_package2 pkgname include_file library_name) +endfunction() +function(find_package2 pkgname) + list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MOULE) + find_package(${pkgname} ${ARGN} CONFIG) + # Add variables with upper-case package name in addition to the default ones + string(TOUPPER ${pkgname} key) + set(targets "") + foreach(lib ${${pkgname}_LIBRARIES}) + if(TARGET ${lib}) + list(APPEND targets ${lib}) + endif() + endforeach() + set(${key}_TARGET "${targets}" CACHE STRING "") + set(${pkgname}_TARGET "${targets}" CACHE STRING "") + set(${key}_LIBRARIES "${${pkgname}_LIBRARIES}" CACHE STRING "") + set(${key}_LIBRARY "${${pkgname}_LIBRARIES}" CACHE STRING "") + set(${key}_INCLUDE_DIR "${${pkgname}_INCLUDE_DIR}" CACHE STRING "") + set(${key}_INCLUDE_DIRS "${${pkgname}_INCLUDE_DIRS}" CACHE STRING "") + set(${key}_DEFINITIONS "${${pkgname}_DEFINITIONS}" CACHE STRING "") + set(${key}_FOUND ${${pkgname}_FOUND} CACHE BOOL "") + + message(STATUS "Found ${pkgname}: ${${pkgname}_FOUND}") + message(STATUS " ${key}_TARGET: ${${key}_TARGET}") + message(STATUS " ${key}_LIBRARIES: ${${key}_LIBRARIES}") + message(STATUS " ${key}_INCLUDE_DIRS: ${${key}_INCLUDE_DIRS}") +endfunction() diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 69936d3ab2c12..e2e0e7c88c6e1 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -4,7 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file required_conan_version = ">=1.52.0" @@ -20,13 +20,6 @@ class GdalConan(ConanFile): package_type = "library" settings = "os", "arch", "compiler", "build_type" - - # A list of gdal dependencies can be taken from cmake/helpers/CheckDependentLibraries.cmake - # within gdal sources with the command: - # grep -E '^[ \t]*gdal_check_package\(' cmake/helpers/CheckDependentLibraries.cmake \ - # | sed 's/[ \t]*gdal_check_package(\([a-zA-Z_0-9]\+\) "\(.*\)"\(.*\)/{ 'dep': \'\1\', 'descr': \'\2\' },/' \ - # | sort | uniq - options = { "shared": [True, False], "fPIC": [True, False], @@ -35,8 +28,6 @@ class GdalConan(ConanFile): "with_arrow": [True, False], "with_blosc": [True, False], "with_cfitsio": [True, False], - # with_cypto option has been renamed with_openssl in version 3.5.1 - "with_crypto": [True, False, "deprecated"], "with_cryptopp": [True, False], "with_curl": [True, False], "with_dds": [True, False], @@ -86,7 +77,6 @@ class GdalConan(ConanFile): "with_arrow": False, "with_blosc": False, "with_cfitsio": False, - "with_crypto": "deprecated", "with_cryptopp": False, "with_curl": False, "with_dds": False, @@ -129,17 +119,14 @@ class GdalConan(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) export_conandata_patches(self) + copy(self, "ConanFindPackage.cmake", src=os.path.join(self.recipe_folder, "cmake"), dst=self.export_sources_folder) def config_options(self): if self.settings.os == "Windows": del self.options.fPIC def configure(self): - if self.options.with_crypto != "deprecated": - self.output.error("with_crypto option is deprecated, use with_openssl instead.") - if self.options.shared: self.options.rm_safe("fPIC") @@ -251,17 +238,14 @@ def build_requirements(self): # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 self.tool_requires("cmake/[>=3.18 <4]") - def package_id(self): - del self.info.options.with_crypto - def validate(self): - if self.options.get_safe("with_pcre") and self.options.get_safe("with_pcre2"): + if self.options.with_pcre and self.options.with_pcre2: raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") - if self.options.get_safe("with_sqlite3") and not self.dependencies["sqlite3"].options.enable_column_metadata: + if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: raise ConanInvalidConfiguration("gdql requires sqlite3:enable_column_metadata=True") - if self.options.get_safe("with_libtiff") and self.dependencies["libtiff"].options.jpeg != self.options.get_safe("with_jpeg"): + if self.options.with_libtiff and self.dependencies["libtiff"].options.jpeg != self.options.with_jpeg: msg = "libtiff:jpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." # For some reason, the ConanInvalidConfiguration message is not shown, only # ERROR: At least two recipes provides the same functionality: @@ -270,7 +254,7 @@ def validate(self): self.output.error(msg) raise ConanInvalidConfiguration(msg) - if self.options.get_safe("with_poppler") and self.dependencies["poppler"].options.with_libjpeg != self.options.get_safe("with_jpeg"): + if self.options.with_poppler and self.dependencies["poppler"].options.with_libjpeg != self.options.with_jpeg: msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or" " libjpeg-turbo." self.output.error(msg) raise ConanInvalidConfiguration(msg) @@ -280,15 +264,14 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - - if self.options.get_safe("fPIC", True): - tc.cache_variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = True + tc.cache_variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) tc.cache_variables["BUILD_JAVA_BINDINGS"] = False tc.cache_variables["BUILD_CSHARP_BINDINGS"] = False tc.cache_variables["BUILD_PYTHON_BINDINGS"] = False - + tc.cache_variables["BUILD_APPS"] = self.options.tools tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False @@ -297,113 +280,193 @@ def generate(self): tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = True tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = True - tc.cache_variables["BUILD_APPS"] = self.options.tools - tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata - tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree - tc.cache_variables["GDAL_USE_JSONC"] = True - tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_JSONC"] = "json-c" - + tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo + tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow + tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc + tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio + tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds + tc.cache_variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp + tc.cache_variables["GDAL_USE_CURL"] = self.options.with_curl + tc.cache_variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + tc.cache_variables["GDAL_USE_EXPAT"] = self.options.with_expat + tc.cache_variables["GDAL_USE_FREEXL"] = self.options.with_freexl + tc.cache_variables["GDAL_USE_GEOS"] = self.options.with_geos tc.cache_variables["GDAL_USE_GEOTIFF"] = True - tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_GEOTIFF"] = "libgeotiff" - tc.cache_variables["TARGET_FOR_GEOTIFF"] = "GeoTIFF::GeoTIFF" - + tc.cache_variables["GDAL_USE_GIF"] = self.options.with_gif + tc.cache_variables["GDAL_USE_GTA"] = self.options.with_gta + tc.cache_variables["GDAL_USE_HDF4"] = self.options.with_hdf4 + tc.cache_variables["GDAL_USE_HDF5"] = self.options.with_hdf5 + tc.cache_variables["GDAL_USE_HEIF"] = self.options.with_heif + tc.cache_variables["GDAL_USE_ICONV"] = self.options.with_libiconv + tc.cache_variables["GDAL_USE_JSONC"] = True + tc.cache_variables["GDAL_USE_JPEG"] = self.options.with_jpeg is not None + tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea + tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml + tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 + tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 + tc.cache_variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + tc.cache_variables["GDAL_USE_NETCDF"] = self.options.with_netcdf + tc.cache_variables["GDAL_USE_ODBC"] = self.options.with_odbc + tc.cache_variables["GDAL_USE_OPENEXR"] = self.options.with_exr + tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg + tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl + tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre + tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 tc.cache_variables["GDAL_USE_PDFIUM"] = False - tc.cache_variables["PDFIUM_FOUND"] = False - - if self.options.with_jpeg == "libjpeg" or self.options.with_jpeg == "libjpeg-turbo": - print(f"self.options.with_jpeg: {self.options.with_jpeg}") - tc.cache_variables["GDAL_USE_JPEG"] = True - tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_JPEG"] = self.options.with_jpeg - tc.cache_variables["TARGET_FOR_JPEG"] = ( - "JPEG::JPEG" - if self.options.with_jpeg == "libjpeg" - else self.dependencies["libjpeg-turbo"].cpp_info.components["turbojpeg"].get_property("cmake_target_name") - ) - else: - tc.cache_variables["JPEG_FOUND"] = False - - if self.options.with_mysql == "libmysqlclient" or self.options.with_mysql == "mariadb-connector-c": - tc.cache_variables["GDAL_CONAN_PACKAGE_FOR_MYSQL"] = str(self.options.with_mysql) - tc.cache_variables["TARGET_FOR_MYSQL"] = ( - "mariadb-connector-c::mariadb-connector-c" - if self.options.with_mysql == "mariadb-connector-c" - else "libmysqlclient::libmysqlclient" - ) - else: - tc.cache_variables["MYSQL_FOUND"] = False - - def _configure_dependency(name, pkg_name=None, param_name=None): - pkg_name = pkg_name or name.lower() - param_name = param_name or name.lower() - available = self.options.get_safe(f"with_{param_name}", False) - tc.cache_variables[f"GDAL_USE_{name.upper()}"] = available - if available: - tc.cache_variables[f"GDAL_CONAN_PACKAGE_FOR_{name.upper()}"] = pkg_name - tc.cache_variables[f"TARGET_FOR_{name.upper()}"] = self.dependencies[pkg_name].cpp_info.get_property("cmake_target_name") - else: - tc.cache_variables[f"{name}_FOUND"] = False - - _configure_dependency("Armadillo") - _configure_dependency("Arrow") - _configure_dependency("Blosc", pkg_name="c-blosc") - _configure_dependency("CFITSIO") - _configure_dependency("CURL") - _configure_dependency("Crnlib", pkg_name="crunch", param_name="dds") - _configure_dependency("CryptoPP") - _configure_dependency("Deflate", pkg_name="libdeflate", param_name="libdeflate") - _configure_dependency("EXPAT") - _configure_dependency("FreeXL") - _configure_dependency("GEOS") - _configure_dependency("GIF", pkg_name="giflib") - _configure_dependency("GTA", pkg_name="libgta") - _configure_dependency("HDF4") - _configure_dependency("HDF5") - _configure_dependency("HEIF", pkg_name="libheif") - _configure_dependency("Iconv", pkg_name="libiconv", param_name="libiconv") - _configure_dependency("KEA", pkg_name="kealib") - _configure_dependency("LZ4") - _configure_dependency("LibKML") - _configure_dependency("LibXml2", pkg_name="libxml2", param_name="xml2") - _configure_dependency("MONGOCXX", pkg_name="mongo-cxx-driver") - _configure_dependency("NetCDF") - _configure_dependency("ODBC") - _configure_dependency("OPENJPEG") - _configure_dependency("OpenEXR", param_name="exr") - _configure_dependency("OpenSSL") - _configure_dependency("PCRE") - _configure_dependency("PCRE2") - _configure_dependency("PNG", pkg_name="libpng") - _configure_dependency("PROJ") - _configure_dependency("Podofo") - _configure_dependency("Poppler") - _configure_dependency("PostgreSQL", pkg_name="libpq", param_name="pg") - _configure_dependency("QHULL") - _configure_dependency("SQLite3") - _configure_dependency("TIFF", pkg_name="libtiff", param_name="libtiff") - _configure_dependency("WebP", pkg_name="libwebp") - _configure_dependency("XercesC", pkg_name="xerces-c", param_name="xerces") - _configure_dependency("ZLIB") - _configure_dependency("ZSTD") - - # for k, v in tc.cache_variables.items(): - # print(k, " = ", v) - + tc.cache_variables["GDAL_USE_PNG"] = self.options.with_png + tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo + tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler + tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg + tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj + tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull + tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + tc.cache_variables["GDAL_USE_TIFF"] = self.options.with_libtiff + tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp + tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces + tc.cache_variables["GDAL_USE_ZLIB"] = self.options.with_zlib + tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd tc.generate() + # TODO? + # # gdal includes without "Imath/" folder prefix + # target_include_directories(Imath::Imath INTERFACE ${Imath_INCLUDE_DIR}) + # # and also without "OpenEXR/" prefix + # target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) + # set(HDF5_C_LIBRARIES HDF5::C) + deps = CMakeDeps(self) + # Based on `grep -h 'grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` + conan_to_cmake_pkg_name = { + # "archive": "ARCHIVE", + "armadillo": "Armadillo", + "arrow": "Arrow", + # "brunsli": "BRUNSLI", + "c-blosc": "Blosc", + "cfitsio": "CFITSIO", + "crunch": "Crnlib", + "cryptopp": "CryptoPP", + # "ecw": "ECW", + "expat": "EXPAT", + # "filegdb": "FileGDB", + "freexl": "FreeXL", + # "fyba": "FYBA", + "geos": "GEOS", + "giflib": "GIF", + "hdf4": "HDF4", + "hdf5": "HDF5", + # "hdfs": "HDFS", + # "idb": "IDB", + "json-c": "JSONC", + # "jxl": "JXL", + # "kdu": "KDU", + "kealib": "KEA", + # "lerc": "LERC", + # "libbasisu": "basisu", + # "libcsf": "LIBCSF", + "libcurl": "CURL", + "libdeflate": "Deflate", + "libgeotiff": "GeoTIFF", + "libgta": "GTA", + "libheif": "HEIF", + "libiconv": "Iconv", + "libjpeg": "JPEG", + "libjpeg-turbo": "JPEG", + "libkml": "LibKML", + # "xz_utils": "LibLZMA", + "libmysqlclient": "MySQL", + "libpng": "PNG", + "libpq": "PostgreSQL", + # "libqb3": "libQB3", + "libtiff": "TIFF", + "libwebp": "WebP", + "libxml2": "LibXml2", + # "luratech": "LURATECH", + "lz4": "LZ4", + "mariadb-connector-c": "MySQL", + "mongo-cxx-driver": "MONGOCXX", + # "mrsid": "MRSID", + # "mssql_ncli": "MSSQL_NCLI", + # "mssql_odbc": "MSSQL_ODBC", + "netcdf": "NetCDF", + "odbc": "ODBC", + # "odbccpp": "ODBCCPP", + # "ogdi": "OGDI", + # "opencad": "OpenCAD", + # "opencl": "OpenCL", + "openexr": "OpenEXR", + "openjpeg": "OpenJPEG", + "openssl": "OpenSSL", + # "oracle": "Oracle", + # "parquet": "Parquet", + "pcre": "PCRE", + "pcre2": "PCRE2", + # "pdfium": "PDFIUM", + "podofo": "Podofo", + "poppler": "Poppler", + "proj": "PROJ", + "qhull": "QHULL", + # "rasterlite2": "RASTERLITE2", + # "rdb": "rdb", + # "sfcgal": "SFCGAL", + # "shapelib": "Shapelib", + # "spatialite": "SPATIALITE", + "sqlite3": "SQLite3", + # "teigha": "TEIGHA", + # "tiledb": "TileDB", + "xerces-c": "XercesC", + "zlib": "ZLIB", + "zstd": "ZSTD", + } + for conan_name, cmake_name in conan_to_cmake_pkg_name.items(): + deps.set_property(conan_name, "cmake_find_mode", "config") + deps.set_property(conan_name, "cmake_file_name", cmake_name) + + renamed_targets = { + "arrow": "arrow_shared", + "c-blosc": "Blosc::Blosc", + "cfitsio": "CFITSIO::CFITSIO", + "cryptopp": "CRYPTOPP::CRYPTOPP", + "freexl": "FREEXL::freexl", + "geos": "GEOS::GEOS", + "hdfs": "HDFS::HDFS", + "imath": "OpenEXR::Half", + "libdeflate": "Deflate::Deflate", + "libgeotiff": "GEOTIFF::GEOTIFF", + "lz4": "LZ4::LZ4", + "netcds": "netCDF::netcdf", + "openexr::IlmThread": "OpenEXR::IlmImf", + "openexr::OpenEXR": "OpenEXR::IlmImfUtil", + "openjpeg": "OPENJPEG::OpenJPEG", + "pcre2::pcre2-8": "PCRE2::PCRE2-8", + "poppler": "Poppler::Poppler", + "zstd": "ZSTD::zstd", + } + for component, new_target_name in renamed_targets.items(): + deps.set_property(component, "cmake_target_name", new_target_name) + deps.generate() - def build(self): + def _patch_sources(self): apply_conandata_patches(self) + copy(self, "ConanFindPackage.cmake", + src=self.export_sources_folder, + dst=os.path.join(self.source_folder, "cmake", "helpers")) + # Fix Deflate::Deflate and possibly other linked libs not being propagated internally + replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), + "gdal_target_link_libraries", "target_link_libraries") + replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), + "PRIVATE", "PUBLIC") + + def build(self): + self._patch_sources() cmake = CMake(self) - cmake.configure(build_script_folder=self.export_sources_folder) + cmake.configure() cmake.build() def package(self): diff --git a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch index e790a586d8abd..4b4da340d0053 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch @@ -28,7 +28,7 @@ diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDe index 7fa3b565c7..77a610f223 100644 --- a/cmake/helpers/CheckDependentLibraries.cmake +++ b/cmake/helpers/CheckDependentLibraries.cmake -@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* +@@ -11,7 +11,10 @@ include(CheckFunctionExists) include(CMakeDependentOption) include(FeatureSummary) @@ -40,9 +40,12 @@ index 7fa3b565c7..77a610f223 100644 include(CheckSymbolExists) option( -@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) +@@ -109,49 +112,9 @@ + string(TOUPPER ${name} key) + set(_find_dependency "") set(_find_dependency_args "") - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) +- find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) ++ find_package2(${name} QUIET) if (NOT DEFINED ${key}_FOUND) - set(_find_package_args) - if (_GCP_VERSION) @@ -89,7 +92,7 @@ index 7fa3b565c7..77a610f223 100644 endif () if (${key}_FOUND OR ${name}_FOUND) set(HAVE_${key} ON) -@@ -321,14 +284,15 @@ if (GDAL_USE_CRYPTOPP) +@@ -321,10 +284,7 @@ endif () # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. @@ -97,20 +100,11 @@ index 7fa3b565c7..77a610f223 100644 -if (NOT PROJ_FOUND) - find_package(PROJ 8 CONFIG QUIET) -endif() -+find_package2(PROJ) -+target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) -+#if (NOT PROJ_FOUND) -+# find_package(proj 8 CONFIG QUIET) -+#endif() ++find_package2(PROJ CONFIG QUIET) if (PROJ_FOUND) string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") else() -- find_package(PROJ 6.0 REQUIRED) -+ find_package(proj 6.0 REQUIRED) - string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") - endif () - -@@ -379,15 +343,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE +@@ -379,15 +339,10 @@ TARGETS json-c::json-c JSONC::JSONC ) gdal_internal_library(JSONC REQUIRED) @@ -130,7 +124,7 @@ index 7fa3b565c7..77a610f223 100644 gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) gdal_internal_library(OPENCAD) -@@ -482,7 +441,7 @@ if (GDAL_USE_RASTERLITE2) +@@ -482,7 +437,7 @@ endif () cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) @@ -139,55 +133,15 @@ index 7fa3b565c7..77a610f223 100644 if (GDAL_USE_LIBKML) if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -diff --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake -new file mode 100644 -index 0000000000..9dfa8193a3 ---- /dev/null -+++ b/cmake/helpers/ConanFindPackage.cmake -@@ -0,0 +1,43 @@ -+ -+function(define_find_package2 pkgname include_file library_name) -+endfunction() -+ -+function(find_package2 pkgname) -+ set(_options QUIET REQUIRED) -+ set(_oneValueArgs OUT_DEPENDENCY) -+ set(_multiValueArgs) -+ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) -+ if(arg_QUIET) -+ set(${pkgname}_FIND_QUIETLY TRUE) -+ endif() -+ if(arg_REQUIRED) -+ set(${pkgname}_FIND_REQUIRED TRUE) -+ endif() -+ -+ string(TOUPPER ${pkgname} key) -+ -+ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") -+ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) -+ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") -+ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) -+ string(TOUPPER ${conan_package} conan_package_upper) -+ -+ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) -+ if (NOT TARGET_FOR_${key}) -+ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") -+ endif() -+ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) -+ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) -+ -+ else () -+ message("dependency ${pkgname} has no conan package") -+ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) -+ endif() -+ -+endfunction() +@@ -611,7 +566,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt index e5b7138e91..039cac7361 100644 --- a/frmts/hfa/CMakeLists.txt diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch index b01b5b271034c..d71f3815b5c05 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -139,55 +139,6 @@ index 0a66b44fec..152ff42ff7 100644 if (GDAL_USE_LIBKML) if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -diff --git a/cmake/helpers/ConanFindPackage.cmake b/cmake/helpers/ConanFindPackage.cmake -new file mode 100644 -index 0000000000..9dfa8193a3 ---- /dev/null -+++ b/cmake/helpers/ConanFindPackage.cmake -@@ -0,0 +1,43 @@ -+ -+function(define_find_package2 pkgname include_file library_name) -+endfunction() -+ -+function(find_package2 pkgname) -+ set(_options QUIET REQUIRED) -+ set(_oneValueArgs OUT_DEPENDENCY) -+ set(_multiValueArgs) -+ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) -+ if(arg_QUIET) -+ set(${pkgname}_FIND_QUIETLY TRUE) -+ endif() -+ if(arg_REQUIRED) -+ set(${pkgname}_FIND_REQUIRED TRUE) -+ endif() -+ -+ string(TOUPPER ${pkgname} key) -+ -+ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") -+ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) -+ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") -+ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) -+ string(TOUPPER ${conan_package} conan_package_upper) -+ -+ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) -+ if (NOT TARGET_FOR_${key}) -+ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") -+ endif() -+ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) -+ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) -+ -+ else () -+ message("dependency ${pkgname} has no conan package") -+ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) -+ endif() -+ -+endfunction() diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt index e5b7138e91..039cac7361 100644 --- a/frmts/hfa/CMakeLists.txt diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch index 34401a53eae6d..b15f8d06c60d3 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch @@ -161,53 +161,6 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec if (GDAL_USE_LIBKML) if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -diff -urN ./a/cmake/helpers/ConanFindPackage.cmake ./b/cmake/helpers/ConanFindPackage.cmake ---- ./a/cmake/helpers/ConanFindPackage.cmake 1969-12-31 18:00:00.000000000 -0600 -+++ ./b/cmake/helpers/ConanFindPackage.cmake 2023-06-06 16:26:55.800008000 -0500 -@@ -0,0 +1,43 @@ -+ -+function(define_find_package2 pkgname include_file library_name) -+endfunction() -+ -+function(find_package2 pkgname) -+ set(_options QUIET REQUIRED) -+ set(_oneValueArgs OUT_DEPENDENCY) -+ set(_multiValueArgs) -+ cmake_parse_arguments(arg "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) -+ if(arg_QUIET) -+ set(${pkgname}_FIND_QUIETLY TRUE) -+ endif() -+ if(arg_REQUIRED) -+ set(${pkgname}_FIND_REQUIRED TRUE) -+ endif() -+ -+ string(TOUPPER ${pkgname} key) -+ -+ set(docstring "Configured for conan package ${GDAL_CONAN_PACKAGE_FOR_${key}}") -+ if (DEFINED GDAL_CONAN_PACKAGE_FOR_${key}) -+ message("Using conan package ${GDAL_CONAN_PACKAGE_FOR_${key}} for dependency ${pkgname}") -+ set(conan_package ${GDAL_CONAN_PACKAGE_FOR_${key}}) -+ string(TOUPPER ${conan_package} conan_package_upper) -+ -+ set(${key}_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_${conan_package_upper}}" CACHE STRING ${docstring}) -+ if (NOT TARGET_FOR_${key}) -+ set(TARGET_FOR_${key} "${conan_package}::${conan_package}") -+ endif() -+ set(${key}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_INCLUDE_DIRS "CONAN_INCLUDE_DIRS_${conan_package_upper}" CACHE STRING ${docstring}) -+ set(${pkgname}_LIBRARIES "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_LIBRARY "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${pkgname}_TARGET "${TARGET_FOR_${key}}" CACHE STRING ${docstring}) -+ set(${key}_FOUND TRUE CACHE BOOL ${docstring}) -+ -+ else () -+ message("dependency ${pkgname} has no conan package") -+ set(${key}_FOUND FALSE CACHE BOOL ${docstring}) -+ endif() -+ -+endfunction() diff -urN ./a/frmts/hfa/CMakeLists.txt ./b/frmts/hfa/CMakeLists.txt --- ./a/frmts/hfa/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 +++ ./b/frmts/hfa/CMakeLists.txt 2023-06-06 16:54:31.162043900 -0500 From d93848febc1fd4a312c197aa0f157da7a51e90fc Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 19 Aug 2023 22:52:08 +0300 Subject: [PATCH 007/105] gdal/post_3.5.0: drop v3.5.1 --- recipes/gdal/post_3.5.0/conandata.yml | 5 - .../3.5.1/0-replace-find-package.patch | 220 ------------------ .../3.5.2/0-replace-find-package.patch | 54 +++-- 3 files changed, 32 insertions(+), 247 deletions(-) delete mode 100644 recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index c2e3dc05a4f89..90d9a67727070 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -5,13 +5,8 @@ sources: "3.5.2": url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" - "3.5.1": - url: "https://github.com/OSGeo/gdal/releases/download/v3.5.1/gdal-3.5.1.tar.gz" - sha256: "7c4406ca010dc8632703a0a326f39e9db25d9f1f6ebaaeca64a963e3fac123d1" patches: "3.7.0": - patch_file: "patches/3.7.0/0-replace-find-package.patch" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" - "3.5.1": - - patch_file: "patches/3.5.1/0-replace-find-package.patch" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch deleted file mode 100644 index 4b4da340d0053..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.5.1/0-replace-find-package.patch +++ /dev/null @@ -1,220 +0,0 @@ -diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt -index edf75158c7..4200309ca8 100644 ---- a/alg/CMakeLists.txt -+++ b/alg/CMakeLists.txt -@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) - target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) - endif () - --gdal_target_link_libraries(alg PRIVATE PROJ::proj) -+target_link_libraries(alg PUBLIC PROJ::proj) - - if (GDAL_USE_QHULL_INTERNAL) - target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) -diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt -index a49165d14a..91d6170067 100644 ---- a/apps/CMakeLists.txt -+++ b/apps/CMakeLists.txt -@@ -25,7 +25,7 @@ target_include_directories( - appslib PRIVATE $ $ - $ $) - --gdal_target_link_libraries(appslib PRIVATE PROJ::proj) -+target_link_libraries(appslib PUBLIC PROJ::proj) - - set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) -diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake -index 7fa3b565c7..77a610f223 100644 ---- a/cmake/helpers/CheckDependentLibraries.cmake -+++ b/cmake/helpers/CheckDependentLibraries.cmake -@@ -11,7 +11,10 @@ - include(CheckFunctionExists) - include(CMakeDependentOption) - include(FeatureSummary) --include(DefineFindPackage2) -+ -+# Conan recipes should rely on config files from generators so let's just disble GDAL's -+include(ConanFindPackage) -+ - include(CheckSymbolExists) - - option( -@@ -109,49 +112,9 @@ - string(TOUPPER ${name} key) - set(_find_dependency "") - set(_find_dependency_args "") -- find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) -+ find_package2(${name} QUIET) - if (NOT DEFINED ${key}_FOUND) -- set(_find_package_args) -- if (_GCP_VERSION) -- list(APPEND _find_package_args ${_GCP_VERSION}) -- endif () -- if (_GCP_CONFIG) -- list(APPEND _find_package_args CONFIG) -- endif () -- if (_GCP_COMPONENTS) -- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) -- endif () -- if (_GCP_PATHS) -- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) -- endif () -- if (_GCP_NAMES) -- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") -- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) -- endif () -- if (_GCP_TARGETS) -- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") -- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) -- endif () -- if (GDAL_CHECK_PACKAGE_${name}_NAMES) -- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) -- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) -- if (${name}_FOUND) -- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) -- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") -- endif () -- endif () -- if (NOT ${name}_FOUND) -- find_package(${name} ${_find_package_args}) -- if (${name}_FOUND) -- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) -- elseif (${key}_FOUND) # Some find modules do not set _FOUND -- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) -- set(${name}_FOUND "${key}_FOUND") -- endif () -- if (${name}_FOUND) -- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") -- endif() -- endif () -+ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") - endif () - if (${key}_FOUND OR ${name}_FOUND) - set(HAVE_${key} ON) -@@ -321,10 +284,7 @@ - endif () - - # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. --find_package(PROJ 9 CONFIG QUIET) --if (NOT PROJ_FOUND) -- find_package(PROJ 8 CONFIG QUIET) --endif() -+find_package2(PROJ CONFIG QUIET) - if (PROJ_FOUND) - string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") - else() -@@ -379,15 +339,10 @@ - TARGETS json-c::json-c JSONC::JSONC - ) - gdal_internal_library(JSONC REQUIRED) --if(TARGET json-c::json-c) -- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) -- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) -- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") -- list(REMOVE_DUPLICATES include_dirs) -- set_target_properties(json-c::json-c PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" -- ) --endif() -+get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) -+list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") -+set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") -+message("Setting include for json-c: ${include_dirs}") - - gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) - gdal_internal_library(OPENCAD) -@@ -482,7 +437,7 @@ - endif () - cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) - --find_package(LibKML COMPONENTS DOM ENGINE) -+find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) - if (GDAL_USE_LIBKML) - if (NOT LibKML_FOUND) - message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -@@ -611,7 +566,7 @@ - gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) - - # OpenJPEG's cmake-CONFIG is broken, so call module explicitly --find_package(OpenJPEG MODULE) -+find_package2(OpenJPEG MODULE) - if (GDAL_USE_OPENJPEG) - if (NOT OPENJPEG_FOUND) - message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") -diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt -index e5b7138e91..039cac7361 100644 ---- a/frmts/hfa/CMakeLists.txt -+++ b/frmts/hfa/CMakeLists.txt -@@ -15,7 +15,8 @@ add_gdal_driver( - hfa_overviews.cpp - BUILTIN) - gdal_standard_includes(gdal_HFA) --target_include_directories(gdal_HFA PRIVATE $) -+target_link_libraries(gdal_HFA INTERFACE PROJ::proj) -+target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) - target_compile_definitions(gdal_HFA PRIVATE $) - - if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) -diff --git a/gdal.cmake b/gdal.cmake -index ff1ca7e6f6..e98875f1b9 100644 ---- a/gdal.cmake -+++ b/gdal.cmake -@@ -795,25 +795,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) - ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) - -- # Generate gdal-config utility command and pkg-config module gdal.pc -- include(GdalGenerateConfig) -- gdal_generate_config( -- TARGET -- "${GDAL_LIB_TARGET_NAME}" -- GLOBAL_PROPERTY -- "gdal_private_link_libraries" -- GDAL_CONFIG -- "${PROJECT_BINARY_DIR}/apps/gdal-config" -- PKG_CONFIG -- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") -- install( -- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config -- DESTINATION ${CMAKE_INSTALL_BINDIR} -- COMPONENT applications) -- install( -- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig -- COMPONENT libraries) - endif () - - configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) -diff --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt -index 19ba4e12fe..87cd123c54 100644 ---- a/ogr/CMakeLists.txt -+++ b/ogr/CMakeLists.txt -@@ -88,12 +88,12 @@ endif () - - target_compile_definitions(ogr PRIVATE HAVE_MITAB) - --gdal_target_link_libraries(ogr PRIVATE PROJ::proj) -+target_link_libraries(ogr PUBLIC PROJ::proj) - - # External libs then - if (GDAL_USE_GEOS) - target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) -- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) -+ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) - endif () - - if (GDAL_USE_SFCGAL) -diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h -index 88928ad1ad..7cdd587db7 100644 ---- a/ogr/ogr_proj_p.h -+++ b/ogr/ogr_proj_p.h -@@ -29,7 +29,7 @@ - #ifndef OGR_PROJ_P_H_INCLUDED - #define OGR_PROJ_P_H_INCLUDED - --#include "proj.h" -+#include - - #include "cpl_mem_cache.h" - diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch index d71f3815b5c05..a15875847c340 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -28,7 +28,7 @@ diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDe index 0a66b44fec..152ff42ff7 100644 --- a/cmake/helpers/CheckDependentLibraries.cmake +++ b/cmake/helpers/CheckDependentLibraries.cmake -@@ -11,7 +11,10 @@ Detect GDAL dependencies and set variable HAVE_* +@@ -11,7 +11,10 @@ include(CheckFunctionExists) include(CMakeDependentOption) include(FeatureSummary) @@ -40,9 +40,12 @@ index 0a66b44fec..152ff42ff7 100644 include(CheckSymbolExists) option( -@@ -111,47 +114,7 @@ macro (gdal_check_package name purpose) +@@ -109,49 +112,9 @@ + string(TOUPPER ${name} key) + set(_find_dependency "") set(_find_dependency_args "") - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) +- find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) ++ find_package2(${name} QUIET) if (NOT DEFINED ${key}_FOUND) - set(_find_package_args) - if (_GCP_VERSION) @@ -89,7 +92,7 @@ index 0a66b44fec..152ff42ff7 100644 endif () if (${key}_FOUND OR ${name}_FOUND) set(HAVE_${key} ON) -@@ -345,14 +308,15 @@ if (GDAL_USE_CRYPTOPP) +@@ -345,10 +308,7 @@ endif () # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. @@ -97,23 +100,15 @@ index 0a66b44fec..152ff42ff7 100644 -if (NOT PROJ_FOUND) - find_package(PROJ 8 CONFIG QUIET) -endif() -+find_package2(PROJ) -+target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) -+#if (NOT PROJ_FOUND) -+# find_package(proj 8 CONFIG QUIET) -+#endif() ++find_package2(PROJ CONFIG QUIET) if (PROJ_FOUND) string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") else() -- find_package(PROJ 6.0 REQUIRED) -+ find_package(proj 6.0 REQUIRED) - string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") - endif () - -@@ -412,15 +376,10 @@ gdal_check_package(JSONC "json-c library (external)" CAN_DISABLE +@@ -411,16 +371,7 @@ + NAMES json-c TARGETS json-c::json-c JSONC::JSONC ) - gdal_internal_library(JSONC REQUIRED) +-gdal_internal_library(JSONC REQUIRED) -if(TARGET json-c::json-c) - get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) - find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) @@ -123,22 +118,37 @@ index 0a66b44fec..152ff42ff7 100644 - INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" - ) -endif() -+get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) -+list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") -+set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") -+message("Setting include for json-c: ${include_dirs}") ++find_package2(JSONC REQUIRED) gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) gdal_internal_library(OPENCAD) -@@ -517,7 +476,7 @@ if (GDAL_USE_RASTERLITE2) +@@ -517,7 +468,7 @@ endif () cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) -find_package(LibKML COMPONENTS DOM ENGINE) -+find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) ++find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) if (GDAL_USE_LIBKML) if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +@@ -561,7 +512,7 @@ + unset(CMAKE_TRY_COMPILE_CONFIGURATION) + cmake_pop_check_state() + if (NOT ARMADILLO_TEST_PROGRAM_WITHOUT_LAPACK_COMPILES) +- find_package(LAPACK) ++ find_package2(LAPACK) + if (LAPACK_FOUND) + list(APPEND ARMADILLO_LIBRARIES ${LAPACK_LIBRARIES}) + cmake_push_check_state(RESET) +@@ -646,7 +597,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt index e5b7138e91..039cac7361 100644 --- a/frmts/hfa/CMakeLists.txt From 4b27ef1045a186ff83d22d1053a4092b1aae7960 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 19 Aug 2023 23:10:33 +0300 Subject: [PATCH 008/105] gdal/post_3.5.0: fix external json-c not being used --- recipes/gdal/post_3.5.0/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index e2e0e7c88c6e1..ab3dc30613829 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -340,6 +340,9 @@ def generate(self): # target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) # set(HDF5_C_LIBRARIES HDF5::C) + jsonc = self.dependencies["json-c"] + jsonc.cpp_info.includedirs.append(os.path.join(jsonc.package_folder, "include", "json-c")) + deps = CMakeDeps(self) # Based on `grep -h 'grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` conan_to_cmake_pkg_name = { From 1e570c9d21ce5433da93efefa0024b2e6dea1fc0 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 19 Aug 2023 23:40:52 +0300 Subject: [PATCH 009/105] gdal/post_3.5.0: update v3.7.0, replace gdal_target_link_libraries everywhere --- .../post_3.5.0/cmake/ConanFindPackage.cmake | 5 +- recipes/gdal/post_3.5.0/conanfile.py | 12 ++- .../3.5.2/0-replace-find-package.patch | 54 ------------ .../3.7.0/0-replace-find-package.patch | 84 +++++-------------- 4 files changed, 33 insertions(+), 122 deletions(-) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake index b3671a9169d24..78437412696ac 100644 --- a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -1,7 +1,10 @@ function(define_find_package2 pkgname include_file library_name) endfunction() function(find_package2 pkgname) - list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MOULE) + # Remove args unsupported by find_package() + list(REMOVE_ITEM ARGN OUT_DEPENDENCY _find_dependency) + # Force CONFIG mode + list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MODULE) find_package(${pkgname} ${ARGN} CONFIG) # Add variables with upper-case package name in addition to the default ones string(TOUPPER ${pkgname} key) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index ab3dc30613829..4688b39705244 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -460,11 +460,15 @@ def _patch_sources(self): copy(self, "ConanFindPackage.cmake", src=self.export_sources_folder, dst=os.path.join(self.source_folder, "cmake", "helpers")) - # Fix Deflate::Deflate and possibly other linked libs not being propagated internally + # Use standard target_link_libraries instead of gdal_target_link_libraries. + # GDAL version does not allow PUBLIC and got stuck in an infinite recursion for some Conan deps. + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "GdalDriverHelper.cmake"), + "function(gdal_target_link_libraries target)", + "function(gdal_target_link_libraries target)\ntarget_link_libraries(${target} ${ARGN})\nreturn()\n") + # Fix Deflate::Deflate not being correctly propagated internally. replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), - "gdal_target_link_libraries", "target_link_libraries") - replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), - "PRIVATE", "PUBLIC") + "PRIVATE Deflate::Deflate", + "PUBLIC Deflate::Deflate") def build(self): self._patch_sources() diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch index a15875847c340..1693f6be74fd3 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -1,29 +1,3 @@ -diff --git a/alg/CMakeLists.txt b/alg/CMakeLists.txt -index edf75158c7..4200309ca8 100644 ---- a/alg/CMakeLists.txt -+++ b/alg/CMakeLists.txt -@@ -72,7 +72,7 @@ if (GDAL_USE_OPENCL) - target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) - endif () - --gdal_target_link_libraries(alg PRIVATE PROJ::proj) -+target_link_libraries(alg PUBLIC PROJ::proj) - - if (GDAL_USE_QHULL_INTERNAL) - target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) -diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt -index 8b02cea456..ad4adbfc9e 100644 ---- a/apps/CMakeLists.txt -+++ b/apps/CMakeLists.txt -@@ -25,7 +25,7 @@ target_include_directories( - appslib PRIVATE $ $ - $ $) - --gdal_target_link_libraries(appslib PRIVATE PROJ::proj) -+target_link_libraries(appslib PUBLIC PROJ::proj) - - set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake index 0a66b44fec..152ff42ff7 100644 --- a/cmake/helpers/CheckDependentLibraries.cmake @@ -131,15 +105,6 @@ index 0a66b44fec..152ff42ff7 100644 if (GDAL_USE_LIBKML) if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -@@ -561,7 +512,7 @@ - unset(CMAKE_TRY_COMPILE_CONFIGURATION) - cmake_pop_check_state() - if (NOT ARMADILLO_TEST_PROGRAM_WITHOUT_LAPACK_COMPILES) -- find_package(LAPACK) -+ find_package2(LAPACK) - if (LAPACK_FOUND) - list(APPEND ARMADILLO_LIBRARIES ${LAPACK_LIBRARIES}) - cmake_push_check_state(RESET) @@ -646,7 +597,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) @@ -193,25 +158,6 @@ index 4bae2e2760..7695df40c8 100644 endif () configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) -diff --git a/ogr/CMakeLists.txt b/ogr/CMakeLists.txt -index 19ba4e12fe..87cd123c54 100644 ---- a/ogr/CMakeLists.txt -+++ b/ogr/CMakeLists.txt -@@ -88,12 +88,12 @@ endif () - - target_compile_definitions(ogr PRIVATE HAVE_MITAB) - --gdal_target_link_libraries(ogr PRIVATE PROJ::proj) -+target_link_libraries(ogr PUBLIC PROJ::proj) - - # External libs then - if (GDAL_USE_GEOS) - target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) -- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) -+ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) - endif () - - if (GDAL_USE_SFCGAL) diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h index 88928ad1ad..7cdd587db7 100644 --- a/ogr/ogr_proj_p.h diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch index b15f8d06c60d3..c0e9add80b2d0 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch @@ -1,41 +1,16 @@ -diff -urN ./a/alg/CMakeLists.txt ./b/alg/CMakeLists.txt ---- ./a/alg/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 -+++ ./b/alg/CMakeLists.txt 2023-06-06 16:47:02.784509800 -0500 -@@ -73,7 +73,7 @@ - target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp) - endif () - --gdal_target_link_libraries(alg PRIVATE PROJ::proj) -+target_link_libraries(alg PUBLIC PROJ::proj) - - if (GDAL_USE_QHULL_INTERNAL) - target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL) -diff -urN ./a/apps/CMakeLists.txt ./b/apps/CMakeLists.txt ---- ./a/apps/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 -+++ ./b/apps/CMakeLists.txt 2023-06-06 16:46:55.380690700 -0500 -@@ -26,7 +26,7 @@ - appslib PRIVATE $ $ - $ $) - --gdal_target_link_libraries(appslib PRIVATE PROJ::proj) -+target_link_libraries(appslib PUBLIC PROJ::proj) - - set_property(TARGET appslib PROPERTY POSITION_INDEPENDENT_CODE ${GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/CheckDependentLibraries.cmake --- ./a/cmake/helpers/CheckDependentLibraries.cmake 2023-06-07 09:33:06.599777700 -0500 +++ ./b/cmake/helpers/CheckDependentLibraries.cmake 2023-06-07 13:38:51.722872200 -0500 -@@ -11,7 +11,8 @@ +@@ -11,7 +11,7 @@ include(CheckFunctionExists) include(CMakeDependentOption) include(FeatureSummary) -include(DefineFindPackage2) -+#include(DefineFindPackage2) +include(ConanFindPackage) include(CheckSymbolExists) option( -@@ -109,51 +110,8 @@ +@@ -109,51 +109,8 @@ string(TOUPPER ${name} key) set(_find_dependency "") set(_find_dependency_args "") @@ -85,11 +60,11 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec - endif () - endif () + -+ find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) ++ find_package2(${name} QUIET) if (${key}_FOUND OR ${name}_FOUND) if(_GCP_MINIMUM_VERSION) -@@ -368,14 +326,12 @@ +@@ -368,10 +325,7 @@ endif () # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. @@ -97,20 +72,15 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec -if (NOT PROJ_FOUND) - find_package(PROJ 8 CONFIG QUIET) -endif() -+find_package2(PROJ) -+target_include_directories(PROJ::proj INTERFACE ${PROJ_INCLUDE_DIRS}) ++find_package2(PROJ CONFIG QUIET) if (PROJ_FOUND) string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") else() -- find_package(PROJ 6.0 REQUIRED) -+ find_package(proj 6.0 REQUIRED) - string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ 6.0)\n") - endif () - -@@ -458,15 +414,10 @@ +@@ -457,16 +411,7 @@ + NAMES json-c TARGETS json-c::json-c JSONC::JSONC ) - gdal_internal_library(JSONC REQUIRED) +-gdal_internal_library(JSONC REQUIRED) -if(TARGET json-c::json-c) - get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) - find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) @@ -120,14 +90,11 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec - INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" - ) -endif() -+get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) -+list(APPEND include_dirs "${JSONC_INCLUDE_DIRS}/json-c") -+set_target_properties(json-c::json-c PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${include_dirs}") -+message("Setting include for json-c: ${include_dirs}") ++find_package2(JSONC REQUIRED) gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) gdal_internal_library(OPENCAD) -@@ -527,6 +478,24 @@ +@@ -527,6 +472,24 @@ gdal_check_package(SQLite3 "Enable SQLite3 support (used by SQLite/Spatialite, GPKG, Rasterlite, MBTiles, etc.)" CAN_DISABLE RECOMMENDED) if (SQLite3_FOUND) @@ -152,15 +119,24 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec if (NOT DEFINED SQLite3_HAS_COLUMN_METADATA) message(FATAL_ERROR "missing SQLite3_HAS_COLUMN_METADATA") endif () -@@ -566,7 +535,7 @@ +@@ -566,7 +529,7 @@ gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE) gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE) -find_package(LibKML COMPONENTS DOM ENGINE) -+find_package(LibKML COMPONENTS kmlengine kmldom kmlbase) ++find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) if (GDAL_USE_LIBKML) if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") +@@ -729,7 +692,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") diff -urN ./a/frmts/hfa/CMakeLists.txt ./b/frmts/hfa/CMakeLists.txt --- ./a/frmts/hfa/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 +++ ./b/frmts/hfa/CMakeLists.txt 2023-06-06 16:54:31.162043900 -0500 @@ -203,24 +179,6 @@ diff -urN ./a/gdal.cmake ./b/gdal.cmake endif () configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) -diff -urN ./a/ogr/CMakeLists.txt ./b/ogr/CMakeLists.txt ---- ./a/ogr/CMakeLists.txt 2023-05-02 08:47:12.000000000 -0500 -+++ ./b/ogr/CMakeLists.txt 2023-06-06 16:56:18.682151700 -0500 -@@ -89,12 +89,12 @@ - - target_compile_definitions(ogr PRIVATE HAVE_MITAB) - --gdal_target_link_libraries(ogr PRIVATE PROJ::proj) -+target_link_libraries(ogr PUBLIC PROJ::proj) - - # External libs then - if (GDAL_USE_GEOS) - target_compile_definitions(ogr PRIVATE -DHAVE_GEOS=1) -- gdal_target_link_libraries(ogr PRIVATE ${GEOS_TARGET}) -+ target_link_libraries(ogr PUBLIC ${GEOS_TARGET}) - endif () - - if (GDAL_USE_SFCGAL) diff -urN ./a/ogr/ogr_proj_p.h ./b/ogr/ogr_proj_p.h --- ./a/ogr/ogr_proj_p.h 2023-05-02 08:47:12.000000000 -0500 +++ ./b/ogr/ogr_proj_p.h 2023-06-06 16:56:30.772908800 -0500 From d0a7da57a94b8eed856c41990e1f890cd667877d Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 01:19:15 +0300 Subject: [PATCH 010/105] gdal/post_3.5.0: always use zlib --- recipes/gdal/post_3.5.0/conanfile.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 4688b39705244..15c2487e1f986 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -65,7 +65,6 @@ class GdalConan(ConanFile): "with_webp": [True, False], "with_xerces": [True, False], "with_xml2": [True, False], - "with_zlib": [True, False], "with_zstd": [True, False], } @@ -114,7 +113,6 @@ class GdalConan(ConanFile): "with_webp": False, "with_xerces": False, "with_xml2": False, - "with_zlib": True, "with_zstd": False, } @@ -142,6 +140,9 @@ def layout(self): def requirements(self): self.requires("json-c/0.16") self.requires("libgeotiff/1.7.1") + # Used in a public header here: + # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 + self.requires("zlib/1.2.13", transitive_headers=True) if self.options.with_armadillo: self.requires("armadillo/12.2.0") if self.options.with_arrow: @@ -229,8 +230,6 @@ def requirements(self): self.requires("xerces-c/3.2.4") if self.options.with_xml2: self.requires("libxml2/2.11.4") - if self.options.with_zlib: - self.requires("zlib/1.2.13") if self.options.with_zstd: self.requires("zstd/1.5.5") @@ -329,7 +328,7 @@ def generate(self): tc.cache_variables["GDAL_USE_TIFF"] = self.options.with_libtiff tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces - tc.cache_variables["GDAL_USE_ZLIB"] = self.options.with_zlib + tc.cache_variables["GDAL_USE_ZLIB"] = True tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd tc.generate() @@ -499,6 +498,7 @@ def package_info(self): self.cpp_info.requires.extend(["json-c::json-c"]) self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) + self.cpp_info.requires.extend(["zlib::zlib"]) if self.options.with_armadillo: self.cpp_info.requires.extend(["armadillo::armadillo"]) if self.options.with_arrow: @@ -585,8 +585,6 @@ def package_info(self): self.cpp_info.requires.extend(["xerces-c::xerces-c"]) if self.options.with_xml2: self.cpp_info.requires.extend(["libxml2::libxml2"]) - if self.options.with_zlib: - self.cpp_info.requires.extend(["zlib::zlib"]) if self.options.with_zstd: self.cpp_info.requires.extend(["zstd::zstdlib"]) From 1e4c3e9203d6acc365ed71fe9bcdc76d83229e87 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 00:46:41 +0300 Subject: [PATCH 011/105] gdal/post_3.5.0: fix OpenEXR, HDF4, Arrow support --- recipes/gdal/post_3.5.0/CMakeLists.txt | 16 +++++++++++++++ .../post_3.5.0/cmake/ConanFindPackage.cmake | 2 ++ recipes/gdal/post_3.5.0/conanfile.py | 20 +++++++------------ 3 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 recipes/gdal/post_3.5.0/CMakeLists.txt diff --git a/recipes/gdal/post_3.5.0/CMakeLists.txt b/recipes/gdal/post_3.5.0/CMakeLists.txt new file mode 100644 index 0000000000000..1a526ad3ffa0e --- /dev/null +++ b/recipes/gdal/post_3.5.0/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.15) +project(gdal_cmake_wrapper) + +if (GDAL_USE_OPENEXR) + find_package(Imath REQUIRED) + find_package(OpenEXR REQUIRED) + add_library(OpenEXR::IlmImf ALIAS OpenEXR::IlmThread) + add_library(OpenEXR::IlmImfUtil ALIAS OpenEXR::OpenEXR) + add_library(OpenEXR::Half ALIAS Imath::Imath) + # gdal includes without "Imath/" folder prefix + target_include_directories(Imath::Imath INTERFACE ${Imath_INCLUDE_DIR}) + # and also without "OpenEXR/" prefix + target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) +endif() + +add_subdirectory(src) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake index 78437412696ac..021164f4316ef 100644 --- a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -22,6 +22,8 @@ function(find_package2 pkgname) set(${key}_INCLUDE_DIRS "${${pkgname}_INCLUDE_DIRS}" CACHE STRING "") set(${key}_DEFINITIONS "${${pkgname}_DEFINITIONS}" CACHE STRING "") set(${key}_FOUND ${${pkgname}_FOUND} CACHE BOOL "") + set(${pkgname}_VERSION ${${pkgname}_VERSION_STRING} CACHE BOOL "") + set(${key}_VERSION ${${pkgname}_VERSION} CACHE BOOL "") message(STATUS "Found ${pkgname}: ${${pkgname}_FOUND}") message(STATUS " ${key}_TARGET: ${${key}_TARGET}") diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 15c2487e1f986..4e0f86892115d 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -117,6 +117,7 @@ class GdalConan(ConanFile): } def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) export_conandata_patches(self) copy(self, "ConanFindPackage.cmake", src=os.path.join(self.recipe_folder, "cmake"), dst=self.export_sources_folder) @@ -154,7 +155,7 @@ def requirements(self): if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_curl: - self.requires("libcurl/8.2.1") + self.requires("libcurl/8.2.0") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_expat: @@ -287,6 +288,7 @@ def generate(self): tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow + tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds @@ -332,13 +334,6 @@ def generate(self): tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd tc.generate() - # TODO? - # # gdal includes without "Imath/" folder prefix - # target_include_directories(Imath::Imath INTERFACE ${Imath_INCLUDE_DIR}) - # # and also without "OpenEXR/" prefix - # target_include_directories(OpenEXR::OpenEXR INTERFACE ${OpenEXR_INCLUDE_DIR}) - # set(HDF5_C_LIBRARIES HDF5::C) - jsonc = self.dependencies["json-c"] jsonc.cpp_info.includedirs.append(os.path.join(jsonc.package_folder, "include", "json-c")) @@ -430,20 +425,19 @@ def generate(self): deps.set_property(conan_name, "cmake_file_name", cmake_name) renamed_targets = { - "arrow": "arrow_shared", + "arrow": "Arrow::arrow_shared", "c-blosc": "Blosc::Blosc", "cfitsio": "CFITSIO::CFITSIO", + "crunch": "CRNLIB::Crnlib", "cryptopp": "CRYPTOPP::CRYPTOPP", "freexl": "FREEXL::freexl", "geos": "GEOS::GEOS", "hdfs": "HDFS::HDFS", - "imath": "OpenEXR::Half", + "hdf4": "HDF4::HDF4", "libdeflate": "Deflate::Deflate", "libgeotiff": "GEOTIFF::GEOTIFF", "lz4": "LZ4::LZ4", "netcds": "netCDF::netcdf", - "openexr::IlmThread": "OpenEXR::IlmImf", - "openexr::OpenEXR": "OpenEXR::IlmImfUtil", "openjpeg": "OPENJPEG::OpenJPEG", "pcre2::pcre2-8": "PCRE2::PCRE2-8", "poppler": "Poppler::Poppler", @@ -472,7 +466,7 @@ def _patch_sources(self): def build(self): self._patch_sources() cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): From be7e1fab5fc0dc75f37215d88938226dce27197d Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 00:48:03 +0300 Subject: [PATCH 012/105] gdal/post_3.5.0: more deps fixes --- recipes/gdal/post_3.5.0/conanfile.py | 41 +++++++++++-------- .../3.5.2/0-replace-find-package.patch | 3 +- .../3.7.0/0-replace-find-package.patch | 3 +- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 4e0f86892115d..15c095711cc13 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -425,23 +425,30 @@ def generate(self): deps.set_property(conan_name, "cmake_file_name", cmake_name) renamed_targets = { - "arrow": "Arrow::arrow_shared", - "c-blosc": "Blosc::Blosc", - "cfitsio": "CFITSIO::CFITSIO", - "crunch": "CRNLIB::Crnlib", - "cryptopp": "CRYPTOPP::CRYPTOPP", - "freexl": "FREEXL::freexl", - "geos": "GEOS::GEOS", - "hdfs": "HDFS::HDFS", - "hdf4": "HDF4::HDF4", - "libdeflate": "Deflate::Deflate", - "libgeotiff": "GEOTIFF::GEOTIFF", - "lz4": "LZ4::LZ4", - "netcds": "netCDF::netcdf", - "openjpeg": "OPENJPEG::OpenJPEG", - "pcre2::pcre2-8": "PCRE2::PCRE2-8", - "poppler": "Poppler::Poppler", - "zstd": "ZSTD::zstd", + "arrow": "Arrow::arrow_shared", + "c-blosc": "Blosc::Blosc", + "cfitsio": "CFITSIO::CFITSIO", + "crunch": "CRNLIB::Crnlib", + "cryptopp": "CRYPTOPP::CRYPTOPP", + "freexl": "FREEXL::freexl", + "geos": "GEOS::GEOS", + "hdf4": "HDF4::HDF4", + "hdfs": "HDFS::HDFS", + "kealib": "KEA::KEA", + "libdeflate": "Deflate::Deflate", + "libgeotiff": "GEOTIFF::GEOTIFF", + "libheif": "HEIF::HEIF", + "libwebp": "WEBP::WebP", + "lz4": "LZ4::LZ4", + "mongo-cxx-driver::bsoncxx": "MONGOCXX::BSONCXX", + "mongo-cxx-driver::mongocxx": "MONGOCXX::MONGOCXX", + "netcds": "netCDF::netcdf", + "openjpeg": "OPENJPEG::OpenJPEG", + "pcre": "PCRE::PCRE", + "pcre2::pcre2-8": "PCRE2::PCRE2-8", + "podofo": "PODOFO::Podofo", + "poppler": "Poppler::Poppler", + "zstd": "ZSTD::zstd", } for component, new_target_name in renamed_targets.items(): deps.set_property(component, "cmake_target_name", new_target_name) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch index 1693f6be74fd3..106f76dde313e 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -103,7 +103,8 @@ index 0a66b44fec..152ff42ff7 100644 -find_package(LibKML COMPONENTS DOM ENGINE) +find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) if (GDAL_USE_LIBKML) - if (NOT LibKML_FOUND) +- if (NOT LibKML_FOUND) ++ if (FALSE) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") @@ -646,7 +597,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch index c0e9add80b2d0..b378bc2e663b1 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch @@ -126,7 +126,8 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec -find_package(LibKML COMPONENTS DOM ENGINE) +find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) if (GDAL_USE_LIBKML) - if (NOT LibKML_FOUND) +- if (NOT LibKML_FOUND) ++ if (FALSE) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") @@ -729,7 +692,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) From fba2a27187828490e57d5d9a209dd12b9a5f5f4b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:01:40 +0300 Subject: [PATCH 013/105] gdal/post_3.5.0: add libarchive support --- recipes/gdal/post_3.5.0/conanfile.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 15c095711cc13..8bf5d19ee9190 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -40,10 +40,11 @@ class GdalConan(ConanFile): "with_hdf4": [True, False], "with_hdf5": [True, False], "with_heif": [True, False], + "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], "with_kea": [True, False], + "with_libarchive": [True, False], "with_libdeflate": [True, False], "with_libiconv": [True, False], - "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], "with_libkml": [True, False], "with_libtiff": [True, False], "with_lz4": [True, False], @@ -88,10 +89,11 @@ class GdalConan(ConanFile): "with_hdf4": False, "with_hdf5": False, "with_heif": False, + "with_jpeg": "libjpeg", "with_kea": False, + "with_libarchive": False, "with_libdeflate": True, "with_libiconv": True, - "with_jpeg": "libjpeg", "with_libkml": False, "with_libtiff": True, "with_lz4": False, @@ -183,6 +185,8 @@ def requirements(self): self.requires("libjpeg-turbo/3.0.0") if self.options.with_kea: self.requires("kealib/1.4.14") + if self.options.with_libarchive: + self.requires("libarchive/3.6.2") if self.options.with_libdeflate: self.requires("libdeflate/1.18") if self.options.with_libiconv: @@ -286,6 +290,7 @@ def generate(self): tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree + tc.cache_variables["GDAL_USE_ARCHIVE"] = self.options.with_libarchive tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow @@ -340,7 +345,6 @@ def generate(self): deps = CMakeDeps(self) # Based on `grep -h 'grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` conan_to_cmake_pkg_name = { - # "archive": "ARCHIVE", "armadillo": "Armadillo", "arrow": "Arrow", # "brunsli": "BRUNSLI", @@ -364,6 +368,7 @@ def generate(self): # "kdu": "KDU", "kealib": "KEA", # "lerc": "LERC", + "libarchive": "ARCHIVE", # "libbasisu": "basisu", # "libcsf": "LIBCSF", "libcurl": "CURL", @@ -435,6 +440,7 @@ def generate(self): "hdf4": "HDF4::HDF4", "hdfs": "HDFS::HDFS", "kealib": "KEA::KEA", + "libarchive": "ARCHIVE::ARCHIVE", "libdeflate": "Deflate::Deflate", "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", @@ -500,6 +506,8 @@ def package_info(self): self.cpp_info.requires.extend(["json-c::json-c"]) self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) self.cpp_info.requires.extend(["zlib::zlib"]) + if self.options.with_libarchive: + self.cpp_info.requires.extend(["libarchive::libarchive"]) if self.options.with_armadillo: self.cpp_info.requires.extend(["armadillo::armadillo"]) if self.options.with_arrow: From 035711073985897052686d2a8b41207739ff01c1 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:10:08 +0300 Subject: [PATCH 014/105] gdal/post_3.5.0: add libjxl support --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 8bf5d19ee9190..a489476d48aac 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -41,6 +41,7 @@ class GdalConan(ConanFile): "with_hdf5": [True, False], "with_heif": [True, False], "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], + "with_jxl": [True, False], "with_kea": [True, False], "with_libarchive": [True, False], "with_libdeflate": [True, False], @@ -90,6 +91,7 @@ class GdalConan(ConanFile): "with_hdf5": False, "with_heif": False, "with_jpeg": "libjpeg", + "with_jxl": False, "with_kea": False, "with_libarchive": False, "with_libdeflate": True, @@ -183,6 +185,8 @@ def requirements(self): self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": self.requires("libjpeg-turbo/3.0.0") + if self.options.with_jxl: + self.requires("libjxl/0.6.1") if self.options.with_kea: self.requires("kealib/1.4.14") if self.options.with_libarchive: @@ -312,6 +316,7 @@ def generate(self): tc.cache_variables["GDAL_USE_ICONV"] = self.options.with_libiconv tc.cache_variables["GDAL_USE_JSONC"] = True tc.cache_variables["GDAL_USE_JPEG"] = self.options.with_jpeg is not None + tc.cache_variables["GDAL_USE_JXL"] = self.options.with_jxl tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 @@ -364,7 +369,6 @@ def generate(self): # "hdfs": "HDFS", # "idb": "IDB", "json-c": "JSONC", - # "jxl": "JXL", # "kdu": "KDU", "kealib": "KEA", # "lerc": "LERC", @@ -379,6 +383,7 @@ def generate(self): "libiconv": "Iconv", "libjpeg": "JPEG", "libjpeg-turbo": "JPEG", + "libjxl": "JXL", "libkml": "LibKML", # "xz_utils": "LibLZMA", "libmysqlclient": "MySQL", @@ -444,6 +449,7 @@ def generate(self): "libdeflate": "Deflate::Deflate", "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", + "libjxl": "JXL::JXL", "libwebp": "WEBP::WebP", "lz4": "LZ4::LZ4", "mongo-cxx-driver::bsoncxx": "MONGOCXX::BSONCXX", @@ -540,6 +546,8 @@ def package_info(self): self.cpp_info.requires.extend(["hdf5::hdf5_c"]) if self.options.with_heif: self.cpp_info.requires.extend(["libheif::libheif"]) + if self.options.with_jxl: + self.cpp_info.requires.extend(["libjxl::libjxl"]) if self.options.with_kea: self.cpp_info.requires.extend(["kealib::kealib"]) if self.options.with_libdeflate: From 592390725ca8b39d2921b7649bdd8a507830d481 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:13:19 +0300 Subject: [PATCH 015/105] gdal/post_3.5.0: add lerc support --- recipes/gdal/post_3.5.0/conanfile.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index a489476d48aac..50c1c060b4463 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -43,6 +43,7 @@ class GdalConan(ConanFile): "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], "with_jxl": [True, False], "with_kea": [True, False], + "with_lerc": [True, False], "with_libarchive": [True, False], "with_libdeflate": [True, False], "with_libiconv": [True, False], @@ -93,6 +94,7 @@ class GdalConan(ConanFile): "with_jpeg": "libjpeg", "with_jxl": False, "with_kea": False, + "with_lerc": False, "with_libarchive": False, "with_libdeflate": True, "with_libiconv": True, @@ -189,6 +191,8 @@ def requirements(self): self.requires("libjxl/0.6.1") if self.options.with_kea: self.requires("kealib/1.4.14") + if self.options.with_lerc: + self.requires("lerc/4.0.0") if self.options.with_libarchive: self.requires("libarchive/3.6.2") if self.options.with_libdeflate: @@ -288,7 +292,7 @@ def generate(self): tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = True + tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = True tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata @@ -318,6 +322,7 @@ def generate(self): tc.cache_variables["GDAL_USE_JPEG"] = self.options.with_jpeg is not None tc.cache_variables["GDAL_USE_JXL"] = self.options.with_jxl tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea + tc.cache_variables["GDAL_USE_LERC"] = self.options.with_lerc tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 @@ -371,7 +376,7 @@ def generate(self): "json-c": "JSONC", # "kdu": "KDU", "kealib": "KEA", - # "lerc": "LERC", + "lerc": "LERC", "libarchive": "ARCHIVE", # "libbasisu": "basisu", # "libcsf": "LIBCSF", @@ -445,6 +450,7 @@ def generate(self): "hdf4": "HDF4::HDF4", "hdfs": "HDFS::HDFS", "kealib": "KEA::KEA", + "lerc": "LERC::LERC", "libarchive": "ARCHIVE::ARCHIVE", "libdeflate": "Deflate::Deflate", "libgeotiff": "GEOTIFF::GEOTIFF", @@ -550,6 +556,8 @@ def package_info(self): self.cpp_info.requires.extend(["libjxl::libjxl"]) if self.options.with_kea: self.cpp_info.requires.extend(["kealib::kealib"]) + if self.options.with_lerc: + self.cpp_info.requires.extend(["lerc::lerc"]) if self.options.with_libdeflate: self.cpp_info.requires.extend(["libdeflate::libdeflate"]) if self.options.with_libiconv: From 0924559825faa67b374d62472a99b11d70b8afe0 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:18:16 +0300 Subject: [PATCH 016/105] gdal/post_3.5.0: add basisu support --- recipes/gdal/post_3.5.0/conanfile.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 50c1c060b4463..1c9c0cb02dc8d 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -26,6 +26,7 @@ class GdalConan(ConanFile): "tools": [True, False], "with_armadillo": [True, False], "with_arrow": [True, False], + "with_basisu": [True, False], "with_blosc": [True, False], "with_cfitsio": [True, False], "with_cryptopp": [True, False], @@ -77,6 +78,7 @@ class GdalConan(ConanFile): "tools": False, "with_armadillo": False, "with_arrow": False, + "with_basisu": False, "with_blosc": False, "with_cfitsio": False, "with_cryptopp": False, @@ -154,6 +156,8 @@ def requirements(self): self.requires("armadillo/12.2.0") if self.options.with_arrow: self.requires("arrow/12.0.0") + if self.options.with_basisu: + self.requires("libbasisu/1.15.0") if self.options.with_blosc: self.requires("c-blosc/1.21.4") if self.options.with_cfitsio: @@ -302,6 +306,7 @@ def generate(self): tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow + tc.cache_variables["GDAL_USE_BASISU"] = self.options.with_basisu tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds @@ -378,7 +383,7 @@ def generate(self): "kealib": "KEA", "lerc": "LERC", "libarchive": "ARCHIVE", - # "libbasisu": "basisu", + "libbasisu": "basisu", # "libcsf": "LIBCSF", "libcurl": "CURL", "libdeflate": "Deflate", @@ -452,6 +457,7 @@ def generate(self): "kealib": "KEA::KEA", "lerc": "LERC::LERC", "libarchive": "ARCHIVE::ARCHIVE", + "libbasisu": "basisu::basisu_lib", "libdeflate": "Deflate::Deflate", "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", @@ -518,12 +524,12 @@ def package_info(self): self.cpp_info.requires.extend(["json-c::json-c"]) self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) self.cpp_info.requires.extend(["zlib::zlib"]) - if self.options.with_libarchive: - self.cpp_info.requires.extend(["libarchive::libarchive"]) if self.options.with_armadillo: self.cpp_info.requires.extend(["armadillo::armadillo"]) if self.options.with_arrow: self.cpp_info.requires.extend(["arrow::libarrow"]) + if self.options.with_basisu: + self.cpp_info.requires.extend(["libbasisu::libbasisu"]) if self.options.with_blosc: self.cpp_info.requires.extend(["c-blosc::c-blosc"]) if self.options.with_cfitsio: @@ -558,6 +564,8 @@ def package_info(self): self.cpp_info.requires.extend(["kealib::kealib"]) if self.options.with_lerc: self.cpp_info.requires.extend(["lerc::lerc"]) + if self.options.with_libarchive: + self.cpp_info.requires.extend(["libarchive::libarchive"]) if self.options.with_libdeflate: self.cpp_info.requires.extend(["libdeflate::libdeflate"]) if self.options.with_libiconv: From 811547070dda54c87df1fa497bd9666c3bd51dc4 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:22:54 +0300 Subject: [PATCH 017/105] gdal/post_3.5.0: add LZMA support --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 1c9c0cb02dc8d..ddb9ba3c64d66 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -50,6 +50,7 @@ class GdalConan(ConanFile): "with_libiconv": [True, False], "with_libkml": [True, False], "with_libtiff": [True, False], + "with_lzma": [True, False], "with_lz4": [True, False], "with_mongocxx": [True, False], "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], @@ -102,6 +103,7 @@ class GdalConan(ConanFile): "with_libiconv": True, "with_libkml": False, "with_libtiff": True, + "with_lzma": False, "with_lz4": False, "with_mongocxx": False, "with_mysql": None, @@ -207,6 +209,8 @@ def requirements(self): self.requires("libkml/1.3.0") if self.options.with_libtiff: self.requires("libtiff/4.5.1") + if self.options.with_lzma: + self.requires("xz_utils/5.4.2") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_mongocxx: @@ -330,6 +334,7 @@ def generate(self): tc.cache_variables["GDAL_USE_LERC"] = self.options.with_lerc tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 + tc.cache_variables["GDAL_USE_LZMA"] = self.options.with_lzma tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 tc.cache_variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx tc.cache_variables["GDAL_USE_NETCDF"] = self.options.with_netcdf @@ -395,7 +400,6 @@ def generate(self): "libjpeg-turbo": "JPEG", "libjxl": "JXL", "libkml": "LibKML", - # "xz_utils": "LibLZMA", "libmysqlclient": "MySQL", "libpng": "PNG", "libpq": "PostgreSQL", @@ -437,6 +441,7 @@ def generate(self): # "teigha": "TEIGHA", # "tiledb": "TileDB", "xerces-c": "XercesC", + "xz_utils": "LibLZMA", "zlib": "ZLIB", "zstd": "ZSTD", } @@ -472,6 +477,7 @@ def generate(self): "pcre2::pcre2-8": "PCRE2::PCRE2-8", "podofo": "PODOFO::Podofo", "poppler": "Poppler::Poppler", + "xz_utils": "LibLZMA::LibLZMA", "zstd": "ZSTD::zstd", } for component, new_target_name in renamed_targets.items(): @@ -578,6 +584,8 @@ def package_info(self): self.cpp_info.requires.extend(["libkml::kmldom", "libkml::kmlengine"]) if self.options.with_libtiff: self.cpp_info.requires.extend(["libtiff::libtiff"]) + if self.options.with_lzma: + self.cpp_info.requires.extend(["xz_utils::xz_utils"]) if self.options.with_lz4: self.cpp_info.requires.extend(["lz4::lz4"]) if self.options.with_mongocxx: From ad7b9e0c5da082185708da98909a1b2496d0ef2e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:26:05 +0300 Subject: [PATCH 018/105] gdal/post_3.5.0: add pdfium support --- recipes/gdal/post_3.5.0/conanfile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index ddb9ba3c64d66..19eb6a2cfd564 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -60,6 +60,7 @@ class GdalConan(ConanFile): "with_openssl": [True, False], "with_pcre": [True, False], "with_pcre2": [True, False], + "with_pdfium": [True, False], "with_pg": [True, False], "with_png": [True, False], "with_podofo": [True, False], @@ -113,6 +114,7 @@ class GdalConan(ConanFile): "with_openssl": False, "with_pcre": False, "with_pcre2": False, + "with_pdfium": False, "with_pg": False, "with_png": True, "with_podofo": False, @@ -231,6 +233,8 @@ def requirements(self): self.requires("pcre/8.45") if self.options.with_pcre2: self.requires("pcre2/10.42") + if self.options.with_pdfium: + self.requires("pdfium/cci.20210730") if self.options.with_pg: self.requires("libpq/15.3") if self.options.with_png: @@ -344,7 +348,7 @@ def generate(self): tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 - tc.cache_variables["GDAL_USE_PDFIUM"] = False + tc.cache_variables["GDAL_USE_PDFIUM"] = self.options.with_pdfium tc.cache_variables["GDAL_USE_PNG"] = self.options.with_png tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler @@ -427,7 +431,7 @@ def generate(self): # "parquet": "Parquet", "pcre": "PCRE", "pcre2": "PCRE2", - # "pdfium": "PDFIUM", + "pdfium": "PDFIUM", "podofo": "Podofo", "poppler": "Poppler", "proj": "PROJ", @@ -475,6 +479,7 @@ def generate(self): "openjpeg": "OPENJPEG::OpenJPEG", "pcre": "PCRE::PCRE", "pcre2::pcre2-8": "PCRE2::PCRE2-8", + "pdfium": "PDFIUM::PDFIUM", "podofo": "PODOFO::Podofo", "poppler": "Poppler::Poppler", "xz_utils": "LibLZMA::LibLZMA", @@ -606,6 +611,8 @@ def package_info(self): self.cpp_info.requires.extend(["pcre::pcre"]) if self.options.with_pcre2: self.cpp_info.requires.extend(["pcre2::pcre2-8"]) + if self.options.with_pdfium: + self.cpp_info.requires.extend(["pdfium::pdfium"]) if self.options.with_pg: self.cpp_info.requires.extend(["libpq::pq"]) if self.options.with_png: From e96617345fd97b4d0c711f9dfc8fae0509064747 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 02:28:45 +0300 Subject: [PATCH 019/105] gdal/post_3.5.0: add rasterlite2 support --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 19eb6a2cfd564..07c3ed12f36e5 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -67,6 +67,7 @@ class GdalConan(ConanFile): "with_poppler": [True, False], "with_proj": [True, False], "with_qhull": [True, False], + "with_rasterlite2": [True, False], "with_sqlite3": [True, False], "with_webp": [True, False], "with_xerces": [True, False], @@ -121,6 +122,7 @@ class GdalConan(ConanFile): "with_poppler": False, "with_proj": True, "with_qhull": True, + "with_rasterlite2": True, "with_sqlite3": True, "with_webp": False, "with_xerces": False, @@ -247,6 +249,8 @@ def requirements(self): self.requires("proj/9.2.1") if self.options.with_qhull: self.requires("qhull/8.0.1") + if self.options.with_rasterlite2: + self.requires("librasterlite2/1.1.0-beta1") if self.options.with_sqlite3: self.requires("sqlite3/3.42.0") if self.options.with_webp: @@ -355,6 +359,7 @@ def generate(self): tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull + tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 tc.cache_variables["GDAL_USE_TIFF"] = self.options.with_libtiff tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp @@ -408,6 +413,7 @@ def generate(self): "libpng": "PNG", "libpq": "PostgreSQL", # "libqb3": "libQB3", + "librasterlite2": "RASTERLITE2", "libtiff": "TIFF", "libwebp": "WebP", "libxml2": "LibXml2", @@ -436,7 +442,6 @@ def generate(self): "poppler": "Poppler", "proj": "PROJ", "qhull": "QHULL", - # "rasterlite2": "RASTERLITE2", # "rdb": "rdb", # "sfcgal": "SFCGAL", # "shapelib": "Shapelib", @@ -471,6 +476,7 @@ def generate(self): "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", "libjxl": "JXL::JXL", + "librasterlite2": "RASTERLITE2::RASTERLITE2", "libwebp": "WEBP::WebP", "lz4": "LZ4::LZ4", "mongo-cxx-driver::bsoncxx": "MONGOCXX::BSONCXX", @@ -623,6 +629,8 @@ def package_info(self): self.cpp_info.requires.extend(["poppler::libpoppler"]) if self.options.with_proj: self.cpp_info.requires.extend(["proj::projlib"]) + if self.options.with_rasterlite2: + self.cpp_info.requires.extend(["rasterlite2::rasterlite2"]) if self.options.with_qhull: self.cpp_info.requires.extend(["qhull::libqhull"]) if self.options.with_sqlite3: From c77c183312ef3b3ae59bd560c157ae756e57fade Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 09:33:09 +0300 Subject: [PATCH 020/105] gdal/post_3.5.0: add missing GDAL_USE_*_INTERNAL vars --- recipes/gdal/post_3.5.0/conanfile.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 07c3ed12f36e5..6acb70bab95e4 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -300,15 +300,19 @@ def generate(self): tc.cache_variables["BUILD_APPS"] = self.options.tools tc.cache_variables["BUILD_TESTING"] = False - tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False - tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False + tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False + tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False + + tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = True + tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = True tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = True tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata From 674de8f75b5341c216460381f340acead37016b0 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 09:34:06 +0300 Subject: [PATCH 021/105] gdal/post_3.5.0: did not mean to enable rasterlite2 by default --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 6acb70bab95e4..6b8ab906ea04a 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -122,7 +122,7 @@ class GdalConan(ConanFile): "with_poppler": False, "with_proj": True, "with_qhull": True, - "with_rasterlite2": True, + "with_rasterlite2": False, "with_sqlite3": True, "with_webp": False, "with_xerces": False, From a44f68c0a598fadfa1305c8414b7ce221011ff4d Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 10:40:59 +0300 Subject: [PATCH 022/105] gdal/post_3.5.0: fix rasterlite2 issue --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 6b8ab906ea04a..5f172e720b367 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -634,7 +634,7 @@ def package_info(self): if self.options.with_proj: self.cpp_info.requires.extend(["proj::projlib"]) if self.options.with_rasterlite2: - self.cpp_info.requires.extend(["rasterlite2::rasterlite2"]) + self.cpp_info.requires.extend(["librasterlite2::librasterlite2"]) if self.options.with_qhull: self.cpp_info.requires.extend(["qhull::libqhull"]) if self.options.with_sqlite3: From c9c954c816721547a2c931de10051e47ffc55c43 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 10:44:49 +0300 Subject: [PATCH 023/105] gdal/post_3.5.0: add spatialite support --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 5f172e720b367..4d351d31aa5bc 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -68,6 +68,7 @@ class GdalConan(ConanFile): "with_proj": [True, False], "with_qhull": [True, False], "with_rasterlite2": [True, False], + "with_spatialite": [True, False], "with_sqlite3": [True, False], "with_webp": [True, False], "with_xerces": [True, False], @@ -123,6 +124,7 @@ class GdalConan(ConanFile): "with_proj": True, "with_qhull": True, "with_rasterlite2": False, + "with_spatialite": False, "with_sqlite3": True, "with_webp": False, "with_xerces": False, @@ -251,6 +253,8 @@ def requirements(self): self.requires("qhull/8.0.1") if self.options.with_rasterlite2: self.requires("librasterlite2/1.1.0-beta1") + if self.options.with_spatialite: + self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: self.requires("sqlite3/3.42.0") if self.options.with_webp: @@ -364,6 +368,7 @@ def generate(self): tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 + tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 tc.cache_variables["GDAL_USE_TIFF"] = self.options.with_libtiff tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp @@ -418,6 +423,7 @@ def generate(self): "libpq": "PostgreSQL", # "libqb3": "libQB3", "librasterlite2": "RASTERLITE2", + "libspatialite": "SPATIALITE", "libtiff": "TIFF", "libwebp": "WebP", "libxml2": "LibXml2", @@ -449,7 +455,6 @@ def generate(self): # "rdb": "rdb", # "sfcgal": "SFCGAL", # "shapelib": "Shapelib", - # "spatialite": "SPATIALITE", "sqlite3": "SQLite3", # "teigha": "TEIGHA", # "tiledb": "TileDB", @@ -481,6 +486,7 @@ def generate(self): "libheif": "HEIF::HEIF", "libjxl": "JXL::JXL", "librasterlite2": "RASTERLITE2::RASTERLITE2", + "libspatialite": "SPATIALITE::SPATIALITE", "libwebp": "WEBP::WebP", "lz4": "LZ4::LZ4", "mongo-cxx-driver::bsoncxx": "MONGOCXX::BSONCXX", @@ -637,6 +643,8 @@ def package_info(self): self.cpp_info.requires.extend(["librasterlite2::librasterlite2"]) if self.options.with_qhull: self.cpp_info.requires.extend(["qhull::libqhull"]) + if self.options.with_spatialite: + self.cpp_info.requires.extend(["libspatialite::libspatialite"]) if self.options.with_sqlite3: self.cpp_info.requires.extend(["sqlite3::sqlite"]) if self.options.with_webp: From 647c444600ece46ebdd9c0b67e999d90b1417cf4 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 10:54:17 +0300 Subject: [PATCH 024/105] gdal/post_3.5.0: add external shapelib support --- recipes/gdal/post_3.5.0/conanfile.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 4d351d31aa5bc..de4c654026333 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -68,6 +68,7 @@ class GdalConan(ConanFile): "with_proj": [True, False], "with_qhull": [True, False], "with_rasterlite2": [True, False], + "with_shapelib": [True, False], "with_spatialite": [True, False], "with_sqlite3": [True, False], "with_webp": [True, False], @@ -124,6 +125,7 @@ class GdalConan(ConanFile): "with_proj": True, "with_qhull": True, "with_rasterlite2": False, + "with_shapelib": False, "with_spatialite": False, "with_sqlite3": True, "with_webp": False, @@ -253,6 +255,8 @@ def requirements(self): self.requires("qhull/8.0.1") if self.options.with_rasterlite2: self.requires("librasterlite2/1.1.0-beta1") + if self.options.with_shapelib: + self.requires("shapelib/1.5.0") if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: @@ -317,7 +321,7 @@ def generate(self): tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = True tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = True - tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = True + tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = not self.options.with_shapelib tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree @@ -368,6 +372,7 @@ def generate(self): tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 + tc.cache_variables["GDAL_USE_SHAPELIB"] = self.options.with_shapelib tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 tc.cache_variables["GDAL_USE_TIFF"] = self.options.with_libtiff @@ -454,7 +459,7 @@ def generate(self): "qhull": "QHULL", # "rdb": "rdb", # "sfcgal": "SFCGAL", - # "shapelib": "Shapelib", + "shapelib": "Shapelib", "sqlite3": "SQLite3", # "teigha": "TEIGHA", # "tiledb": "TileDB", @@ -498,6 +503,7 @@ def generate(self): "pdfium": "PDFIUM::PDFIUM", "podofo": "PODOFO::Podofo", "poppler": "Poppler::Poppler", + "shapelib": "SHAPELIB::shp", "xz_utils": "LibLZMA::LibLZMA", "zstd": "ZSTD::zstd", } @@ -643,6 +649,8 @@ def package_info(self): self.cpp_info.requires.extend(["librasterlite2::librasterlite2"]) if self.options.with_qhull: self.cpp_info.requires.extend(["qhull::libqhull"]) + if self.options.with_shapelib: + self.cpp_info.requires.extend(["shapelib::shapelib"]) if self.options.with_spatialite: self.cpp_info.requires.extend(["libspatialite::libspatialite"]) if self.options.with_sqlite3: From 8b7145396889a7305bcf8db503773a0da611bada Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 10:57:47 +0300 Subject: [PATCH 025/105] gdal/post_3.5.0: fix typo --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index de4c654026333..6313df29aaa03 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -386,7 +386,7 @@ def generate(self): jsonc.cpp_info.includedirs.append(os.path.join(jsonc.package_folder, "include", "json-c")) deps = CMakeDeps(self) - # Based on `grep -h 'grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` + # Based on `grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` conan_to_cmake_pkg_name = { "armadillo": "Armadillo", "arrow": "Arrow", From 6691538cfb8910a1cb53dd14030f632044c9d812 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:22:26 +0300 Subject: [PATCH 026/105] gdal/post_3.5.0: make libtiff a required dependency GDAL always requires either an external or internal version of it, so might as well always use the non-vendored one. --- recipes/gdal/post_3.5.0/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 6313df29aaa03..1ec691c84472c 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -49,7 +49,7 @@ class GdalConan(ConanFile): "with_libdeflate": [True, False], "with_libiconv": [True, False], "with_libkml": [True, False], - "with_libtiff": [True, False], + "with_libtiff": ["deprecated", True, False], "with_lzma": [True, False], "with_lz4": [True, False], "with_mongocxx": [True, False], @@ -74,6 +74,7 @@ class GdalConan(ConanFile): "with_webp": [True, False], "with_xerces": [True, False], "with_xml2": [True, False], + "with_zlib": ["deprecated", True, False], "with_zstd": [True, False], } @@ -106,7 +107,7 @@ class GdalConan(ConanFile): "with_libdeflate": True, "with_libiconv": True, "with_libkml": False, - "with_libtiff": True, + "with_libtiff": "deprecated", "with_lzma": False, "with_lz4": False, "with_mongocxx": False, @@ -131,6 +132,7 @@ class GdalConan(ConanFile): "with_webp": False, "with_xerces": False, "with_xml2": False, + "with_zlib": "deprecated", "with_zstd": False, } @@ -159,6 +161,7 @@ def layout(self): def requirements(self): self.requires("json-c/0.16") self.requires("libgeotiff/1.7.1") + self.requires("libtiff/4.5.1") # Used in a public header here: # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 self.requires("zlib/1.2.13", transitive_headers=True) @@ -215,8 +218,6 @@ def requirements(self): self.requires("libiconv/1.17") if self.options.with_libkml: self.requires("libkml/1.3.0") - if self.options.with_libtiff: - self.requires("libtiff/4.5.1") if self.options.with_lzma: self.requires("xz_utils/5.4.2") if self.options.with_lz4: @@ -281,7 +282,7 @@ def validate(self): if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: raise ConanInvalidConfiguration("gdql requires sqlite3:enable_column_metadata=True") - if self.options.with_libtiff and self.dependencies["libtiff"].options.jpeg != self.options.with_jpeg: + if self.dependencies["libtiff"].options.jpeg != self.options.with_jpeg: msg = "libtiff:jpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." # For some reason, the ConanInvalidConfiguration message is not shown, only # ERROR: At least two recipes provides the same functionality: @@ -375,7 +376,7 @@ def generate(self): tc.cache_variables["GDAL_USE_SHAPELIB"] = self.options.with_shapelib tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 - tc.cache_variables["GDAL_USE_TIFF"] = self.options.with_libtiff + tc.cache_variables["GDAL_USE_TIFF"] = True tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces tc.cache_variables["GDAL_USE_ZLIB"] = True @@ -556,6 +557,7 @@ def package_info(self): self.cpp_info.requires.extend(["json-c::json-c"]) self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) + self.cpp_info.requires.extend(["libtiff::libtiff"]) self.cpp_info.requires.extend(["zlib::zlib"]) if self.options.with_armadillo: self.cpp_info.requires.extend(["armadillo::armadillo"]) @@ -609,8 +611,6 @@ def package_info(self): self.cpp_info.requires.extend(["libjpeg-turbo::turbojpeg"]) if self.options.with_libkml: self.cpp_info.requires.extend(["libkml::kmldom", "libkml::kmlengine"]) - if self.options.with_libtiff: - self.cpp_info.requires.extend(["libtiff::libtiff"]) if self.options.with_lzma: self.cpp_info.requires.extend(["xz_utils::xz_utils"]) if self.options.with_lz4: From 2d919b9bc96b7e3bfde0c7bb1b37cd1f0f34b4a0 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:28:32 +0300 Subject: [PATCH 027/105] gdal/post_3.5.0: make internal-only deps configurable, don't use external shapelib --- recipes/gdal/post_3.5.0/conanfile.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 1ec691c84472c..d3f8b26539bbc 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -46,6 +46,7 @@ class GdalConan(ConanFile): "with_kea": [True, False], "with_lerc": [True, False], "with_libarchive": [True, False], + "with_libcsf": [True, False], "with_libdeflate": [True, False], "with_libiconv": [True, False], "with_libkml": [True, False], @@ -56,6 +57,7 @@ class GdalConan(ConanFile): "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], "with_netcdf": [True, False], "with_odbc": [True, False], + "with_opencad": [True, False], "with_openjpeg": [True, False], "with_openssl": [True, False], "with_pcre": [True, False], @@ -104,6 +106,7 @@ class GdalConan(ConanFile): "with_kea": False, "with_lerc": False, "with_libarchive": False, + "with_libcsf": True, "with_libdeflate": True, "with_libiconv": True, "with_libkml": False, @@ -114,6 +117,7 @@ class GdalConan(ConanFile): "with_mysql": None, "with_netcdf": False, "with_odbc": False, + "with_opencad": True, "with_openjpeg": False, "with_openssl": False, "with_pcre": False, @@ -126,7 +130,7 @@ class GdalConan(ConanFile): "with_proj": True, "with_qhull": True, "with_rasterlite2": False, - "with_shapelib": False, + "with_shapelib": True, "with_spatialite": False, "with_sqlite3": True, "with_webp": False, @@ -256,8 +260,6 @@ def requirements(self): self.requires("qhull/8.0.1") if self.options.with_rasterlite2: self.requires("librasterlite2/1.1.0-beta1") - if self.options.with_shapelib: - self.requires("shapelib/1.5.0") if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: @@ -270,6 +272,10 @@ def requirements(self): self.requires("libxml2/2.11.4") if self.options.with_zstd: self.requires("zstd/1.5.5") + # Use of external shapelib is not recommended and is currently broken. + # https://github.com/OSGeo/gdal/issues/5711 + # if self.options.with_shapelib: + # self.requires("shapelib/1.5.0") def build_requirements(self): # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 @@ -320,9 +326,9 @@ def generate(self): tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False - tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = True - tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = True - tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = not self.options.with_shapelib + tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf + tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad + tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree @@ -649,8 +655,6 @@ def package_info(self): self.cpp_info.requires.extend(["librasterlite2::librasterlite2"]) if self.options.with_qhull: self.cpp_info.requires.extend(["qhull::libqhull"]) - if self.options.with_shapelib: - self.cpp_info.requires.extend(["shapelib::shapelib"]) if self.options.with_spatialite: self.cpp_info.requires.extend(["libspatialite::libspatialite"]) if self.options.with_sqlite3: From d7feef10aeee77e258bbc779b88af9eabe01e14a Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:32:31 +0300 Subject: [PATCH 028/105] gdal/post_3.5.0: ignore deprecated options in package_id --- recipes/gdal/post_3.5.0/conanfile.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index d3f8b26539bbc..c776f55005687 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -29,6 +29,8 @@ class GdalConan(ConanFile): "with_basisu": [True, False], "with_blosc": [True, False], "with_cfitsio": [True, False], + # with_cypto option has been renamed with_openssl in version 3.5.1 + "with_crypto": ["deprecated", True, False], "with_cryptopp": [True, False], "with_curl": [True, False], "with_dds": [True, False], @@ -89,6 +91,7 @@ class GdalConan(ConanFile): "with_basisu": False, "with_blosc": False, "with_cfitsio": False, + "with_crypto": "deprecated", "with_cryptopp": False, "with_curl": False, "with_dds": False, @@ -281,6 +284,12 @@ def build_requirements(self): # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 self.tool_requires("cmake/[>=3.18 <4]") + def package_id(self): + # Ignore deprecated options + del self.info.options.with_crypto + del self.info.options.with_libtiff + del self.info.options.with_zlib + def validate(self): if self.options.with_pcre and self.options.with_pcre2: raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") From 6829c2d4f9c550194fa0b0964b0e35a960e29fe1 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:41:28 +0300 Subject: [PATCH 029/105] gdal/post_3.5.0: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index c776f55005687..343af978b68c8 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -166,7 +166,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("json-c/0.16") + self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") self.requires("libtiff/4.5.1") # Used in a public header here: @@ -185,7 +185,7 @@ def requirements(self): if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_curl: - self.requires("libcurl/8.2.0") + self.requires("libcurl/8.2.1") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_expat: @@ -194,7 +194,7 @@ def requirements(self): self.requires("openexr/3.1.9") self.requires("imath/3.1.9") if self.options.with_freexl: - self.requires("freexl/1.0.6") + self.requires("freexl/2.0.0") if self.options.with_geos: self.requires("geos/3.11.2") if self.options.with_gif: @@ -230,7 +230,7 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_mongocxx: - self.requires("mongo-cxx-driver/3.7.2") + self.requires("mongo-cxx-driver/3.8.0") if self.options.with_mysql == "libmysqlclient": self.requires("libmysqlclient/8.1.0") elif self.options.with_mysql == "mariadb-connector-c": @@ -242,7 +242,7 @@ def requirements(self): if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_openssl: - self.requires("openssl/1.1.1v") + self.requires("openssl/[>=1.1 <4]") if self.options.with_pcre: self.requires("pcre/8.45") if self.options.with_pcre2: @@ -250,7 +250,7 @@ def requirements(self): if self.options.with_pdfium: self.requires("pdfium/cci.20210730") if self.options.with_pg: - self.requires("libpq/15.3") + self.requires("libpq/15.4") if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_podofo: From a76be9f3c5433ccc522924b4d19feaae983ef281 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:42:28 +0300 Subject: [PATCH 030/105] gdal/post_3.5.0: merge and sort external/internal cmake settings --- recipes/gdal/post_3.5.0/conanfile.py | 33 +++++++++++++--------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 343af978b68c8..0672e909dbc71 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -324,21 +324,6 @@ def generate(self): tc.cache_variables["BUILD_APPS"] = self.options.tools tc.cache_variables["BUILD_TESTING"] = False - tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False - tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False - tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False - tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False - - tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf - tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad - tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib - tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree @@ -357,24 +342,31 @@ def generate(self): tc.cache_variables["GDAL_USE_FREEXL"] = self.options.with_freexl tc.cache_variables["GDAL_USE_GEOS"] = self.options.with_geos tc.cache_variables["GDAL_USE_GEOTIFF"] = True + tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_GIF"] = self.options.with_gif + tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False tc.cache_variables["GDAL_USE_GTA"] = self.options.with_gta tc.cache_variables["GDAL_USE_HDF4"] = self.options.with_hdf4 tc.cache_variables["GDAL_USE_HDF5"] = self.options.with_hdf5 tc.cache_variables["GDAL_USE_HEIF"] = self.options.with_heif tc.cache_variables["GDAL_USE_ICONV"] = self.options.with_libiconv - tc.cache_variables["GDAL_USE_JSONC"] = True tc.cache_variables["GDAL_USE_JPEG"] = self.options.with_jpeg is not None + tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False + tc.cache_variables["GDAL_USE_JSONC"] = True + tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False tc.cache_variables["GDAL_USE_JXL"] = self.options.with_jxl tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea tc.cache_variables["GDAL_USE_LERC"] = self.options.with_lerc + tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False + tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 - tc.cache_variables["GDAL_USE_LZMA"] = self.options.with_lzma tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 tc.cache_variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx tc.cache_variables["GDAL_USE_NETCDF"] = self.options.with_netcdf tc.cache_variables["GDAL_USE_ODBC"] = self.options.with_odbc + tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad tc.cache_variables["GDAL_USE_OPENEXR"] = self.options.with_exr tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl @@ -382,19 +374,24 @@ def generate(self): tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 tc.cache_variables["GDAL_USE_PDFIUM"] = self.options.with_pdfium tc.cache_variables["GDAL_USE_PNG"] = self.options.with_png + tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull + tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 - tc.cache_variables["GDAL_USE_SHAPELIB"] = self.options.with_shapelib + tc.cache_variables["GDAL_USE_SHAPELIB"] = False + tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 tc.cache_variables["GDAL_USE_TIFF"] = True + tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces tc.cache_variables["GDAL_USE_ZLIB"] = True + tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd tc.generate() From a6c22cc2953386f467a501c3e71d5ceb4db69971 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:53:50 +0300 Subject: [PATCH 031/105] gdal/post_3.5.0: set GDAL_SET_INSTALL_RELATIVE_RPATH=True --- recipes/gdal/post_3.5.0/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 0672e909dbc71..0f52b0fc22585 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -2,7 +2,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import fix_apple_shared_install_name from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file @@ -317,6 +316,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.cache_variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["GDAL_SET_INSTALL_RELATIVE_RPATH"] = True tc.cache_variables["BUILD_JAVA_BINDINGS"] = False tc.cache_variables["BUILD_CSHARP_BINDINGS"] = False @@ -553,7 +553,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - fix_apple_shared_install_name(self) def package_info(self): self.cpp_info.set_property("cmake_file_name", "GDAL") From 944bcff242c3ba82d278707d1b8a08971fe7f63e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 11:58:55 +0300 Subject: [PATCH 032/105] gdal/post_3.5.0: add with_publicdecompwt option --- recipes/gdal/post_3.5.0/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 0f52b0fc22585..f8baad9ad1f84 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -69,6 +69,7 @@ class GdalConan(ConanFile): "with_podofo": [True, False], "with_poppler": [True, False], "with_proj": [True, False], + "with_publicdecompwt": [True, False], "with_qhull": [True, False], "with_rasterlite2": [True, False], "with_shapelib": [True, False], @@ -130,6 +131,7 @@ class GdalConan(ConanFile): "with_podofo": False, "with_poppler": False, "with_proj": True, + "with_publicdecompwt": False, "with_qhull": True, "with_rasterlite2": False, "with_shapelib": True, @@ -379,6 +381,7 @@ def generate(self): tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj + tc.cache_variables["GDAL_USE_PUBLICDECOMPWT"] = self.options.with_publicdecompwt tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 From f14312571d3f77b601e75ad6c6f3f64309249d1e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 12:06:25 +0300 Subject: [PATCH 033/105] gdal/post_3.5.0: set all recommended and required options to True --- recipes/gdal/post_3.5.0/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index f8baad9ad1f84..41c0717b0bbb2 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -93,9 +93,9 @@ class GdalConan(ConanFile): "with_cfitsio": False, "with_crypto": "deprecated", "with_cryptopp": False, - "with_curl": False, + "with_curl": True, "with_dds": False, - "with_expat": False, + "with_expat": True, "with_exr": False, "with_freexl": False, "with_geos": True, @@ -107,7 +107,7 @@ class GdalConan(ConanFile): "with_jpeg": "libjpeg", "with_jxl": False, "with_kea": False, - "with_lerc": False, + "with_lerc": True, "with_libarchive": False, "with_libcsf": True, "with_libdeflate": True, @@ -120,7 +120,7 @@ class GdalConan(ConanFile): "with_mysql": None, "with_netcdf": False, "with_odbc": False, - "with_opencad": True, + "with_opencad": False, "with_openjpeg": False, "with_openssl": False, "with_pcre": False, From 6f552f33ea9561932d2eed2e06c183804aee9367 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 12:45:16 +0300 Subject: [PATCH 034/105] gdal/post_3.5.0: proj is not really an optional dependency --- recipes/gdal/post_3.5.0/conanfile.py | 13 ++++----- .../3.5.2/0-replace-find-package.patch | 29 +------------------ .../3.7.0/0-replace-find-package.patch | 27 +---------------- 3 files changed, 8 insertions(+), 61 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 41c0717b0bbb2..f0f3a91839fbd 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -68,7 +68,7 @@ class GdalConan(ConanFile): "with_png": [True, False], "with_podofo": [True, False], "with_poppler": [True, False], - "with_proj": [True, False], + "with_proj": ["deprecated", True, False], "with_publicdecompwt": [True, False], "with_qhull": [True, False], "with_rasterlite2": [True, False], @@ -130,7 +130,7 @@ class GdalConan(ConanFile): "with_png": True, "with_podofo": False, "with_poppler": False, - "with_proj": True, + "with_proj": "deprecated", "with_publicdecompwt": False, "with_qhull": True, "with_rasterlite2": False, @@ -170,6 +170,7 @@ def requirements(self): self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") self.requires("libtiff/4.5.1") + self.requires("proj/9.2.1") # Used in a public header here: # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 self.requires("zlib/1.2.13", transitive_headers=True) @@ -258,8 +259,6 @@ def requirements(self): self.requires("podofo/0.9.7") if self.options.with_poppler: self.requires("poppler/21.07.0") - if self.options.with_proj: - self.requires("proj/9.2.1") if self.options.with_qhull: self.requires("qhull/8.0.1") if self.options.with_rasterlite2: @@ -289,6 +288,7 @@ def package_id(self): # Ignore deprecated options del self.info.options.with_crypto del self.info.options.with_libtiff + del self.info.options.with_proj del self.info.options.with_zlib def validate(self): @@ -380,7 +380,7 @@ def generate(self): tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg - tc.cache_variables["GDAL_USE_PROJ"] = self.options.with_proj + tc.cache_variables["GDAL_USE_PROJ"] = True tc.cache_variables["GDAL_USE_PUBLICDECOMPWT"] = self.options.with_publicdecompwt tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False @@ -572,6 +572,7 @@ def package_info(self): self.cpp_info.requires.extend(["json-c::json-c"]) self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) self.cpp_info.requires.extend(["libtiff::libtiff"]) + self.cpp_info.requires.extend(["proj::projlib"]) self.cpp_info.requires.extend(["zlib::zlib"]) if self.options.with_armadillo: self.cpp_info.requires.extend(["armadillo::armadillo"]) @@ -657,8 +658,6 @@ def package_info(self): self.cpp_info.requires.extend(["podofo::podofo"]) if self.options.with_poppler: self.cpp_info.requires.extend(["poppler::libpoppler"]) - if self.options.with_proj: - self.cpp_info.requires.extend(["proj::projlib"]) if self.options.with_rasterlite2: self.cpp_info.requires.extend(["librasterlite2::librasterlite2"]) if self.options.with_qhull: diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch index 106f76dde313e..b9670cb65cd4d 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -74,7 +74,7 @@ index 0a66b44fec..152ff42ff7 100644 -if (NOT PROJ_FOUND) - find_package(PROJ 8 CONFIG QUIET) -endif() -+find_package2(PROJ CONFIG QUIET) ++find_package2(PROJ CONFIG REQUIRED) if (PROJ_FOUND) string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") else() @@ -115,20 +115,6 @@ index 0a66b44fec..152ff42ff7 100644 if (GDAL_USE_OPENJPEG) if (NOT OPENJPEG_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") -diff --git a/frmts/hfa/CMakeLists.txt b/frmts/hfa/CMakeLists.txt -index e5b7138e91..039cac7361 100644 ---- a/frmts/hfa/CMakeLists.txt -+++ b/frmts/hfa/CMakeLists.txt -@@ -15,7 +15,8 @@ add_gdal_driver( - hfa_overviews.cpp - BUILTIN) - gdal_standard_includes(gdal_HFA) --target_include_directories(gdal_HFA PRIVATE $) -+target_link_libraries(gdal_HFA INTERFACE PROJ::proj) -+target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) - target_compile_definitions(gdal_HFA PRIVATE $) - - if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) diff --git a/gdal.cmake b/gdal.cmake index 4bae2e2760..7695df40c8 100644 --- a/gdal.cmake @@ -159,16 +145,3 @@ index 4bae2e2760..7695df40c8 100644 endif () configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) -diff --git a/ogr/ogr_proj_p.h b/ogr/ogr_proj_p.h -index 88928ad1ad..7cdd587db7 100644 ---- a/ogr/ogr_proj_p.h -+++ b/ogr/ogr_proj_p.h -@@ -29,7 +29,7 @@ - #ifndef OGR_PROJ_P_H_INCLUDED - #define OGR_PROJ_P_H_INCLUDED - --#include "proj.h" -+#include - - #include "cpl_mem_cache.h" - diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch index b378bc2e663b1..a55184914dc11 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch @@ -72,7 +72,7 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec -if (NOT PROJ_FOUND) - find_package(PROJ 8 CONFIG QUIET) -endif() -+find_package2(PROJ CONFIG QUIET) ++find_package2(PROJ CONFIG REQUIRED) if (PROJ_FOUND) string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") else() @@ -138,19 +138,6 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec if (GDAL_USE_OPENJPEG) if (NOT OPENJPEG_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") -diff -urN ./a/frmts/hfa/CMakeLists.txt ./b/frmts/hfa/CMakeLists.txt ---- ./a/frmts/hfa/CMakeLists.txt 2023-05-02 08:47:11.000000000 -0500 -+++ ./b/frmts/hfa/CMakeLists.txt 2023-06-06 16:54:31.162043900 -0500 -@@ -15,7 +15,8 @@ - hfa_overviews.cpp - BUILTIN) - gdal_standard_includes(gdal_HFA) --target_include_directories(gdal_HFA PRIVATE $) -+target_link_libraries(gdal_HFA INTERFACE PROJ::proj) -+target_include_directories(gdal_HFA PRIVATE ${PROJ_INCLUDE_DIRS}) - target_compile_definitions(gdal_HFA PRIVATE $) - - if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) diff -urN ./a/gdal.cmake ./b/gdal.cmake --- ./a/gdal.cmake 2023-05-02 08:47:12.000000000 -0500 +++ ./b/gdal.cmake 2023-06-06 16:55:34.252830900 -0500 @@ -180,15 +167,3 @@ diff -urN ./a/gdal.cmake ./b/gdal.cmake endif () configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) -diff -urN ./a/ogr/ogr_proj_p.h ./b/ogr/ogr_proj_p.h ---- ./a/ogr/ogr_proj_p.h 2023-05-02 08:47:12.000000000 -0500 -+++ ./b/ogr/ogr_proj_p.h 2023-06-06 16:56:30.772908800 -0500 -@@ -29,7 +29,7 @@ - #ifndef OGR_PROJ_P_H_INCLUDED - #define OGR_PROJ_P_H_INCLUDED - --#include "proj.h" -+#include - - #include "cpl_mem_cache.h" - From 55fde09ceaa17ec416f37af07d26765233f40318 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 13:06:37 +0300 Subject: [PATCH 035/105] gdal/post_3.5.0: separate commercial libs in pkg list --- recipes/gdal/post_3.5.0/conanfile.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index f0f3a91839fbd..b9e13a82f39ca 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -411,7 +411,6 @@ def generate(self): "cfitsio": "CFITSIO", "crunch": "Crnlib", "cryptopp": "CryptoPP", - # "ecw": "ECW", "expat": "EXPAT", # "filegdb": "FileGDB", "freexl": "FreeXL", @@ -421,9 +420,7 @@ def generate(self): "hdf4": "HDF4", "hdf5": "HDF5", # "hdfs": "HDFS", - # "idb": "IDB", "json-c": "JSONC", - # "kdu": "KDU", "kealib": "KEA", "lerc": "LERC", "libarchive": "ARCHIVE", @@ -448,11 +445,9 @@ def generate(self): "libtiff": "TIFF", "libwebp": "WebP", "libxml2": "LibXml2", - # "luratech": "LURATECH", "lz4": "LZ4", "mariadb-connector-c": "MySQL", "mongo-cxx-driver": "MONGOCXX", - # "mrsid": "MRSID", # "mssql_ncli": "MSSQL_NCLI", # "mssql_odbc": "MSSQL_ODBC", "netcdf": "NetCDF", @@ -473,16 +468,22 @@ def generate(self): "poppler": "Poppler", "proj": "PROJ", "qhull": "QHULL", - # "rdb": "rdb", # "sfcgal": "SFCGAL", "shapelib": "Shapelib", "sqlite3": "SQLite3", - # "teigha": "TEIGHA", # "tiledb": "TileDB", "xerces-c": "XercesC", "xz_utils": "LibLZMA", "zlib": "ZLIB", "zstd": "ZSTD", + # Closed-source/proprietary libraries + # "ecw": "ECW", + # "idb": "IDB", + # "kdu": "KDU", + # "luratech": "LURATECH", + # "mrsid": "MRSID", + # "rdb": "rdb", + # "teigha": "TEIGHA", } for conan_name, cmake_name in conan_to_cmake_pkg_name.items(): deps.set_property(conan_name, "cmake_find_mode", "config") From d060c6c8731cd002a965558ea89d21f6d3767795 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 13:39:41 +0300 Subject: [PATCH 036/105] gdal/post_3.5.0: add v3.7.1, simplify patches --- recipes/gdal/post_3.5.0/conandata.yml | 11 ++ .../3.5.2/0-replace-find-package.patch | 125 +++-------------- .../3.7.0/0-replace-find-package.patch | 131 +++--------------- .../3.7.1/0-replace-find-package.patch | 82 +++++++++++ 4 files changed, 136 insertions(+), 213 deletions(-) create mode 100644 recipes/gdal/post_3.5.0/patches/3.7.1/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 90d9a67727070..1a19c86f2f9de 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.7.1": + url: "https://github.com/OSGeo/gdal/releases/download/v3.7.1/gdal-3.7.1.tar.gz" + sha256: "c131a39d0f7c2a76f02dd648f2906179ddb38958673461eee1da4f9c9a166e76" "3.7.0": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.0/gdal-3.7.0.tar.gz" sha256: "5a806d759f403a15bbbf8a14ecc6947071afc5ab91e5abaef0d11d1d2d16bf94" @@ -6,7 +9,15 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" patches: + "3.7.1": + - patch_file: "patches/3.7.1/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" "3.7.0": - patch_file: "patches/3.7.0/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" + patch_description: "Use custom version of find_package() for Conan deps" + patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch index b9670cb65cd4d..a17686e020af0 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch @@ -1,102 +1,47 @@ diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDependentLibraries.cmake -index 0a66b44fec..152ff42ff7 100644 --- a/cmake/helpers/CheckDependentLibraries.cmake +++ b/cmake/helpers/CheckDependentLibraries.cmake -@@ -11,7 +11,10 @@ +@@ -11,7 +11,7 @@ include(CheckFunctionExists) include(CMakeDependentOption) include(FeatureSummary) -include(DefineFindPackage2) -+ -+# Conan recipes should rely on config files from generators so let's just disble GDAL's +include(ConanFindPackage) -+ include(CheckSymbolExists) option( -@@ -109,49 +112,9 @@ +@@ -109,8 +109,8 @@ string(TOUPPER ${name} key) set(_find_dependency "") set(_find_dependency_args "") - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) +- if (NOT DEFINED ${key}_FOUND) + find_package2(${name} QUIET) - if (NOT DEFINED ${key}_FOUND) -- set(_find_package_args) -- if (_GCP_VERSION) -- list(APPEND _find_package_args ${_GCP_VERSION}) -- endif () -- if (_GCP_CONFIG) -- list(APPEND _find_package_args CONFIG) -- endif () -- if (_GCP_COMPONENTS) -- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) -- endif () -- if (_GCP_PATHS) -- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) -- endif () -- if (_GCP_NAMES) -- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") -- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) -- endif () -- if (_GCP_TARGETS) -- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") -- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) -- endif () -- if (GDAL_CHECK_PACKAGE_${name}_NAMES) -- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) -- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) -- if (${name}_FOUND) -- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) -- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") -- endif () -- endif () -- if (NOT ${name}_FOUND) -- find_package(${name} ${_find_package_args}) -- if (${name}_FOUND) -- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) -- elseif (${key}_FOUND) # Some find modules do not set _FOUND -- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) -- set(${name}_FOUND "${key}_FOUND") -- endif () -- if (${name}_FOUND) -- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") -- endif() -- endif () -+ message(FATAL_ERROR "Conan recipes should rely on config files from generators so let's just disble GDAL's") - endif () - if (${key}_FOUND OR ${name}_FOUND) - set(HAVE_${key} ON) -@@ -345,10 +308,7 @@ ++ if (FALSE) + set(_find_package_args) + if (_GCP_VERSION) + list(APPEND _find_package_args ${_GCP_VERSION}) +@@ -345,7 +345,7 @@ endif () # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. -find_package(PROJ 9 CONFIG QUIET) --if (NOT PROJ_FOUND) -- find_package(PROJ 8 CONFIG QUIET) --endif() -+find_package2(PROJ CONFIG REQUIRED) - if (PROJ_FOUND) - string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") - else() -@@ -411,16 +371,7 @@ ++find_package2(PROJ 9 CONFIG REQUIRED) + if (NOT PROJ_FOUND) + find_package(PROJ 8 CONFIG QUIET) + endif() +@@ -411,8 +411,8 @@ NAMES json-c TARGETS json-c::json-c JSONC::JSONC ) -gdal_internal_library(JSONC REQUIRED) -if(TARGET json-c::json-c) -- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) -- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) -- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") -- list(REMOVE_DUPLICATES include_dirs) -- set_target_properties(json-c::json-c PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" -- ) --endif() +find_package2(JSONC REQUIRED) - - gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) - gdal_internal_library(OPENCAD) -@@ -517,7 +468,7 @@ ++if(FALSE) + get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) + find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) + list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +@@ -517,9 +517,9 @@ endif () cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) @@ -106,7 +51,9 @@ index 0a66b44fec..152ff42ff7 100644 - if (NOT LibKML_FOUND) + if (FALSE) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -@@ -646,7 +597,7 @@ + endif () + endif () +@@ -646,7 +646,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) # OpenJPEG's cmake-CONFIG is broken, so call module explicitly @@ -115,33 +62,3 @@ index 0a66b44fec..152ff42ff7 100644 if (GDAL_USE_OPENJPEG) if (NOT OPENJPEG_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") -diff --git a/gdal.cmake b/gdal.cmake -index 4bae2e2760..7695df40c8 100644 ---- a/gdal.cmake -+++ b/gdal.cmake -@@ -787,25 +787,6 @@ if (NOT GDAL_ENABLE_MACOSX_FRAMEWORK) - ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) - -- # Generate gdal-config utility command and pkg-config module gdal.pc -- include(GdalGenerateConfig) -- gdal_generate_config( -- TARGET -- "${GDAL_LIB_TARGET_NAME}" -- GLOBAL_PROPERTY -- "gdal_private_link_libraries" -- GDAL_CONFIG -- "${PROJECT_BINARY_DIR}/apps/gdal-config" -- PKG_CONFIG -- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") -- install( -- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config -- DESTINATION ${CMAKE_INSTALL_BINDIR} -- COMPONENT applications) -- install( -- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig -- COMPONENT libraries) - endif () - - configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch index a55184914dc11..24028dfe69c39 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch @@ -1,6 +1,6 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/CheckDependentLibraries.cmake ---- ./a/cmake/helpers/CheckDependentLibraries.cmake 2023-06-07 09:33:06.599777700 -0500 -+++ ./b/cmake/helpers/CheckDependentLibraries.cmake 2023-06-07 13:38:51.722872200 -0500 +--- ./a/cmake/helpers/CheckDependentLibraries.cmake ++++ ./b/cmake/helpers/CheckDependentLibraries.cmake @@ -11,7 +11,7 @@ include(CheckFunctionExists) include(CMakeDependentOption) @@ -10,91 +10,39 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec include(CheckSymbolExists) option( -@@ -109,51 +109,8 @@ +@@ -109,9 +109,8 @@ string(TOUPPER ${name} key) set(_find_dependency "") set(_find_dependency_args "") - if(FIND_PACKAGE2_${name}_ENABLED) - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) - else() -- set(_find_package_args) -- if (_GCP_VERSION) -- list(APPEND _find_package_args ${_GCP_VERSION}) -- endif () -- if (_GCP_CONFIG) -- list(APPEND _find_package_args CONFIG) -- endif () -- if (_GCP_COMPONENTS) -- list(APPEND _find_package_args COMPONENTS ${_GCP_COMPONENTS}) -- endif () -- if (_GCP_PATHS) -- list(APPEND _find_package_args PATHS ${_GCP_PATHS}) -- endif () -- if (_GCP_NAMES) -- set(GDAL_CHECK_PACKAGE_${name}_NAMES "${_GCP_NAMES}" CACHE STRING "Config file name for ${name}") -- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_NAMES) -- endif () -- if (_GCP_TARGETS) -- set(GDAL_CHECK_PACKAGE_${name}_TARGETS "${_GCP_TARGETS}" CACHE STRING "Target name candidates for ${name}") -- mark_as_advanced(GDAL_CHECK_PACKAGE_${name}_TARGETS) -- endif () -- if (GDAL_CHECK_PACKAGE_${name}_NAMES) -- find_package(${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} ${_find_package_args}) -- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS} REQUIRED) -- if (${name}_FOUND) -- get_filename_component(_find_dependency_args "${${name}_CONFIG}" NAME) -- string(REPLACE ";" " " _find_dependency_args "${name} NAMES ${GDAL_CHECK_PACKAGE_${name}_NAMES} CONFIGS ${_find_dependency_args} ${_find_package_args}") -- endif () -- endif () -- if (NOT ${name}_FOUND) -- find_package(${name} ${_find_package_args}) -- if (${name}_FOUND) -- gdal_check_package_target(${name} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) -- elseif (${key}_FOUND) # Some find modules do not set _FOUND -- gdal_check_package_target(${key} ${GDAL_CHECK_PACKAGE_${name}_TARGETS}) -- set(${name}_FOUND "${key}_FOUND") -- endif () -- if (${name}_FOUND) -- string(REPLACE ";" " " _find_dependency_args "${name} ${_find_package_args}") -- endif() -- endif () -- endif () -+ + find_package2(${name} QUIET) - if (${key}_FOUND OR ${name}_FOUND) - if(_GCP_MINIMUM_VERSION) - -@@ -368,10 +325,7 @@ ++ if (FALSE) + set(_find_package_args) + if (_GCP_VERSION) + list(APPEND _find_package_args ${_GCP_VERSION}) +@@ -368,7 +367,7 @@ endif () # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. -find_package(PROJ 9 CONFIG QUIET) --if (NOT PROJ_FOUND) -- find_package(PROJ 8 CONFIG QUIET) --endif() -+find_package2(PROJ CONFIG REQUIRED) - if (PROJ_FOUND) - string(APPEND GDAL_IMPORT_DEPENDENCIES "find_dependency(PROJ ${PROJ_VERSION_MAJOR} CONFIG)\n") - else() -@@ -457,16 +411,7 @@ ++find_package2(PROJ 9 CONFIG REQUIRED) + if (NOT PROJ_FOUND) + find_package(PROJ 8 CONFIG QUIET) + endif() +@@ -457,8 +456,8 @@ NAMES json-c TARGETS json-c::json-c JSONC::JSONC ) -gdal_internal_library(JSONC REQUIRED) -if(TARGET json-c::json-c) -- get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) -- find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) -- list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") -- list(REMOVE_DUPLICATES include_dirs) -- set_target_properties(json-c::json-c PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${GDAL_JSON_INCLUDE_DIR}" -- ) --endif() +find_package2(JSONC REQUIRED) - - gdal_check_package(OpenCAD "libopencad (external, used by OpenCAD driver)" CAN_DISABLE) - gdal_internal_library(OPENCAD) -@@ -527,6 +472,24 @@ ++if(FALSE) + get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) + find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) + list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +@@ -527,6 +526,16 @@ gdal_check_package(SQLite3 "Enable SQLite3 support (used by SQLite/Spatialite, GPKG, Rasterlite, MBTiles, etc.)" CAN_DISABLE RECOMMENDED) if (SQLite3_FOUND) @@ -107,19 +55,11 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec + # "for applications that are able to use them"... This is sometimes wrongly + # understood as recommended in all situations. + check_symbol_exists(sqlite3_progress_handler sqlite3.h SQLite3_HAS_PROGRESS_HANDLER) -+ -+ #if(NOT TARGET SQLite::SQLite3) -+ # add_library(SQLite::SQLite3 UNKNOWN IMPORTED) -+ # set_target_properties(SQLite::SQLite3 PROPERTIES -+ # INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIRS}" -+ # IMPORTED_LINK_INTERFACE_LANGUAGES "C" -+ # IMPORTED_LOCATION "${SQLite3_LIBRARY}") -+ #endif() + if (NOT DEFINED SQLite3_HAS_COLUMN_METADATA) message(FATAL_ERROR "missing SQLite3_HAS_COLUMN_METADATA") endif () -@@ -566,7 +529,7 @@ +@@ -566,9 +575,9 @@ gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE) gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE) @@ -129,7 +69,9 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec - if (NOT LibKML_FOUND) + if (FALSE) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") -@@ -729,7 +692,7 @@ + endif () + endif () +@@ -729,7 +738,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) # OpenJPEG's cmake-CONFIG is broken, so call module explicitly @@ -138,32 +80,3 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec if (GDAL_USE_OPENJPEG) if (NOT OPENJPEG_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") -diff -urN ./a/gdal.cmake ./b/gdal.cmake ---- ./a/gdal.cmake 2023-05-02 08:47:12.000000000 -0500 -+++ ./b/gdal.cmake 2023-06-06 16:55:34.252830900 -0500 -@@ -859,25 +859,6 @@ - ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GDALConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gdal/) - -- # Generate gdal-config utility command and pkg-config module gdal.pc -- include(GdalGenerateConfig) -- gdal_generate_config( -- TARGET -- "${GDAL_LIB_TARGET_NAME}" -- GLOBAL_PROPERTY -- "gdal_private_link_libraries" -- GDAL_CONFIG -- "${PROJECT_BINARY_DIR}/apps/gdal-config" -- PKG_CONFIG -- "${CMAKE_CURRENT_BINARY_DIR}/gdal.pc") -- install( -- PROGRAMS ${PROJECT_BINARY_DIR}/apps/gdal-config -- DESTINATION ${CMAKE_INSTALL_BINDIR} -- COMPONENT applications) -- install( -- FILES ${CMAKE_CURRENT_BINARY_DIR}/gdal.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig -- COMPONENT libraries) - endif () - - configure_file(${GDAL_CMAKE_TEMPLATE_PATH}/uninstall.cmake.in ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake @ONLY) diff --git a/recipes/gdal/post_3.5.0/patches/3.7.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.1/0-replace-find-package.patch new file mode 100644 index 0000000000000..3df39bda78985 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.1/0-replace-find-package.patch @@ -0,0 +1,82 @@ +diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/CheckDependentLibraries.cmake +--- ./a/cmake/helpers/CheckDependentLibraries.cmake ++++ ./b/cmake/helpers/CheckDependentLibraries.cmake +@@ -11,7 +11,7 @@ + include(CheckFunctionExists) + include(CMakeDependentOption) + include(FeatureSummary) +-include(DefineFindPackage2) ++include(ConanFindPackage) + include(CheckSymbolExists) + + option( +@@ -109,9 +109,8 @@ + string(TOUPPER ${name} key) + set(_find_dependency "") + set(_find_dependency_args "") +- if(FIND_PACKAGE2_${name}_ENABLED) +- find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) +- else() ++ find_package2(${name} QUIET) ++ if (FALSE) + set(_find_package_args) + if (_GCP_VERSION) + list(APPEND _find_package_args ${_GCP_VERSION}) +@@ -368,7 +367,7 @@ + endif () + + # First check with CMake config files (starting at version 8, due to issues with earlier ones), and then fallback to the FindPROJ module. +-find_package(PROJ 9 CONFIG QUIET) ++find_package2(PROJ 9 CONFIG REQUIRED) + if (NOT PROJ_FOUND) + find_package(PROJ 8 CONFIG QUIET) + endif() +@@ -457,8 +456,8 @@ + NAMES json-c + TARGETS json-c::json-c JSONC::JSONC + ) +-gdal_internal_library(JSONC REQUIRED) +-if(TARGET json-c::json-c) ++find_package2(JSONC REQUIRED) ++if(FALSE) + get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) + find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) + list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") +@@ -527,6 +526,16 @@ + gdal_check_package(SQLite3 "Enable SQLite3 support (used by SQLite/Spatialite, GPKG, Rasterlite, MBTiles, etc.)" + CAN_DISABLE RECOMMENDED) + if (SQLite3_FOUND) ++ set(CMAKE_REQUIRED_INCLUDES ${SQLite3_INCLUDE_DIRS}) ++ check_symbol_exists(sqlite3_mutex_alloc sqlite3ext.h SQLite3_HAS_MUTEX_ALLOC) ++ check_symbol_exists(sqlite3_column_table_name sqlite3ext.h SQLite3_HAS_COLUMN_METADATA) ++ check_symbol_exists(sqlite3_rtree_query_callback sqlite3.h SQLite3_HAS_RTREE) ++ check_symbol_exists(sqlite3_load_extension sqlite3ext.h SQLite3_HAS_LOAD_EXTENSION) ++ # https://www.sqlite.org/compile.html recommends to build with -DSQLITE_OMIT_PROGRESS_CALLBACK ++ # "for applications that are able to use them"... This is sometimes wrongly ++ # understood as recommended in all situations. ++ check_symbol_exists(sqlite3_progress_handler sqlite3.h SQLite3_HAS_PROGRESS_HANDLER) ++ + if (NOT DEFINED SQLite3_HAS_COLUMN_METADATA) + message(FATAL_ERROR "missing SQLite3_HAS_COLUMN_METADATA") + endif () +@@ -566,9 +575,9 @@ + gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE) + gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE) + +-find_package(LibKML COMPONENTS DOM ENGINE) ++find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) + if (GDAL_USE_LIBKML) +- if (NOT LibKML_FOUND) ++ if (FALSE) + message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") + endif () + endif () +@@ -733,7 +742,7 @@ + gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) + + # OpenJPEG's cmake-CONFIG is broken, so call module explicitly +-find_package(OpenJPEG MODULE) ++find_package2(OpenJPEG MODULE) + if (GDAL_USE_OPENJPEG) + if (NOT OPENJPEG_FOUND) + message(FATAL_ERROR "Configured to use GDAL_USE_OPENJPEG, but not found") From 8b0834dcc121d3d025125d8183391e9f07cb9207 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 20 Aug 2023 13:41:44 +0300 Subject: [PATCH 037/105] gdal/post_3.5.0: downgrade libpq --- recipes/gdal/post_3.5.0/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index b9e13a82f39ca..304055c95b763 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -252,7 +252,8 @@ def requirements(self): if self.options.with_pdfium: self.requires("pdfium/cci.20210730") if self.options.with_pg: - self.requires("libpq/15.4") + # libpq 15+ is not supported + self.requires("libpq/14.7") if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_podofo: From 0f9a2009a2acea74e3f699896074f3a8f6cae128 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 21 Aug 2023 08:49:42 +0300 Subject: [PATCH 038/105] gdal/post_3.5.0: configure all available GDAL_USE_* variables --- recipes/gdal/post_3.5.0/conanfile.py | 36 ++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 304055c95b763..835c129e6a5bf 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -42,7 +42,7 @@ class GdalConan(ConanFile): "with_hdf4": [True, False], "with_hdf5": [True, False], "with_heif": [True, False], - "with_jpeg": [None, "libjpeg", "libjpeg-turbo"], + "with_jpeg": [False, "libjpeg", "libjpeg-turbo"], "with_jxl": [True, False], "with_kea": [True, False], "with_lerc": [True, False], @@ -55,7 +55,7 @@ class GdalConan(ConanFile): "with_lzma": [True, False], "with_lz4": [True, False], "with_mongocxx": [True, False], - "with_mysql": [None, "libmysqlclient", "mariadb-connector-c"], + "with_mysql": [False, "libmysqlclient", "mariadb-connector-c"], "with_netcdf": [True, False], "with_odbc": [True, False], "with_opencad": [True, False], @@ -81,7 +81,6 @@ class GdalConan(ConanFile): "with_zlib": ["deprecated", True, False], "with_zstd": [True, False], } - default_options = { "shared": False, "fPIC": True, @@ -117,7 +116,7 @@ class GdalConan(ConanFile): "with_lzma": False, "with_lz4": False, "with_mongocxx": False, - "with_mysql": None, + "with_mysql": False, "with_netcdf": False, "with_odbc": False, "with_opencad": False, @@ -336,13 +335,17 @@ def generate(self): tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow tc.cache_variables["GDAL_USE_BASISU"] = self.options.with_basisu tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc + tc.cache_variables["GDAL_USE_BRUNSLI"] = False tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds tc.cache_variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp tc.cache_variables["GDAL_USE_CURL"] = self.options.with_curl tc.cache_variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + tc.cache_variables["GDAL_USE_ECW"] = False tc.cache_variables["GDAL_USE_EXPAT"] = self.options.with_expat + tc.cache_variables["GDAL_USE_FILEGDB"] = False tc.cache_variables["GDAL_USE_FREEXL"] = self.options.with_freexl + tc.cache_variables["GDAL_USE_FYBA"] = False tc.cache_variables["GDAL_USE_GEOS"] = self.options.with_geos tc.cache_variables["GDAL_USE_GEOTIFF"] = True tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False @@ -351,28 +354,46 @@ def generate(self): tc.cache_variables["GDAL_USE_GTA"] = self.options.with_gta tc.cache_variables["GDAL_USE_HDF4"] = self.options.with_hdf4 tc.cache_variables["GDAL_USE_HDF5"] = self.options.with_hdf5 + tc.cache_variables["GDAL_USE_HDFS"] = False tc.cache_variables["GDAL_USE_HEIF"] = self.options.with_heif tc.cache_variables["GDAL_USE_ICONV"] = self.options.with_libiconv - tc.cache_variables["GDAL_USE_JPEG"] = self.options.with_jpeg is not None + tc.cache_variables["GDAL_USE_IDB"] = False + tc.cache_variables["GDAL_USE_JPEG"] = bool(self.options.with_jpeg) tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False tc.cache_variables["GDAL_USE_JSONC"] = True tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False tc.cache_variables["GDAL_USE_JXL"] = self.options.with_jxl + tc.cache_variables["GDAL_USE_JXL_THREADS"] = self.options.with_jxl + tc.cache_variables["GDAL_USE_KDU"] = False tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea tc.cache_variables["GDAL_USE_LERC"] = self.options.with_lerc tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False + tc.cache_variables["GDAL_USE_LIBCSF"] = False tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml + tc.cache_variables["GDAL_USE_LIBLZMA"] = self.options.with_lzma + tc.cache_variables["GDAL_USE_LIBQB3"] = False tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 + tc.cache_variables["GDAL_USE_LURATECH"] = False tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 tc.cache_variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + tc.cache_variables["GDAL_USE_MRSID"] = False + tc.cache_variables["GDAL_USE_MSSQL_NCLI"] = False + tc.cache_variables["GDAL_USE_MSSQL_ODBC"] = False + tc.cache_variables["GDAL_USE_MYSQL"] = bool(self.options.with_mysql) tc.cache_variables["GDAL_USE_NETCDF"] = self.options.with_netcdf tc.cache_variables["GDAL_USE_ODBC"] = self.options.with_odbc + tc.cache_variables["GDAL_USE_ODBCCPP"] = False + tc.cache_variables["GDAL_USE_OGDI"] = False + tc.cache_variables["GDAL_USE_OPENCAD"] = False tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad + tc.cache_variables["GDAL_USE_OPENCL"] = False tc.cache_variables["GDAL_USE_OPENEXR"] = self.options.with_exr tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl + tc.cache_variables["GDAL_USE_ORACLE"] = False + tc.cache_variables["GDAL_USE_PARQUET"] = False tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 tc.cache_variables["GDAL_USE_PDFIUM"] = self.options.with_pdfium @@ -381,17 +402,18 @@ def generate(self): tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg - tc.cache_variables["GDAL_USE_PROJ"] = True tc.cache_variables["GDAL_USE_PUBLICDECOMPWT"] = self.options.with_publicdecompwt tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 + tc.cache_variables["GDAL_USE_SFCGAL"] = False tc.cache_variables["GDAL_USE_SHAPELIB"] = False tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 - tc.cache_variables["GDAL_USE_TIFF"] = True + tc.cache_variables["GDAL_USE_TEIGHA"] = False tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False + tc.cache_variables["GDAL_USE_TILEDB"] = False tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces tc.cache_variables["GDAL_USE_ZLIB"] = True From 9b8e5b67527a00761f7c819abdf1dbae92151448 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 21 Aug 2023 09:03:49 +0300 Subject: [PATCH 039/105] gdal/post_3.5.0: prevent any accidental use of system libs --- recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake index 021164f4316ef..02c9bc6c8e90b 100644 --- a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -5,7 +5,12 @@ function(find_package2 pkgname) list(REMOVE_ITEM ARGN OUT_DEPENDENCY _find_dependency) # Force CONFIG mode list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MODULE) - find_package(${pkgname} ${ARGN} CONFIG) + find_package(${pkgname} ${ARGN} + CONFIG + # Forbid the use of system libs entirely + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) # Add variables with upper-case package name in addition to the default ones string(TOUPPER ${pkgname} key) set(targets "") From fd041831ea96ff1599b7fe56b009ed7e956c3d05 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 21 Aug 2023 09:31:24 +0300 Subject: [PATCH 040/105] gdal/post_3.5.0: add QUIET to find_package2() --- recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake index 02c9bc6c8e90b..cf7f3e489702c 100644 --- a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -6,6 +6,7 @@ function(find_package2 pkgname) # Force CONFIG mode list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MODULE) find_package(${pkgname} ${ARGN} + QUIET CONFIG # Forbid the use of system libs entirely NO_DEFAULT_PATH From 919cd334620febe402457f4df6efb8eb734422e3 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 21 Aug 2023 09:37:16 +0300 Subject: [PATCH 041/105] gdal/post_3.5.0: fix libjpeg-turbo support --- recipes/gdal/post_3.5.0/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 835c129e6a5bf..1f908e26883bb 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -530,6 +530,8 @@ def generate(self): "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", "libjxl": "JXL::JXL", + "libjpeg": "JPEG::JPEG", + "libjpeg-turbo::jpeg": "JPEG::JPEG", "librasterlite2": "RASTERLITE2::RASTERLITE2", "libspatialite": "SPATIALITE::SPATIALITE", "libwebp": "WEBP::WebP", From 1a9469e98851cf141e922a2dcea91a4282da3ab4 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 21 Aug 2023 10:05:34 +0300 Subject: [PATCH 042/105] gdal/post_3.5.0: fix jxl_threads support --- recipes/gdal/post_3.5.0/conanfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 1f908e26883bb..33baef25e07cd 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -529,7 +529,8 @@ def generate(self): "libdeflate": "Deflate::Deflate", "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", - "libjxl": "JXL::JXL", + "libjxl::jxl": "JXL::JXL", + "libjxl::jxl_threads": "JXL_THREADS::JXL_THREADS", "libjpeg": "JPEG::JPEG", "libjpeg-turbo::jpeg": "JPEG::JPEG", "librasterlite2": "RASTERLITE2::RASTERLITE2", @@ -568,6 +569,9 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), "PRIVATE Deflate::Deflate", "PUBLIC Deflate::Deflate") + # JXL_THREADS is provided under the JXL package in Conan. + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "JXL_THREADS", "JXL", strict=False) def build(self): self._patch_sources() From 8f232a52f6bee89328b25d0e36d6e58b33b52058 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 7 Sep 2023 15:08:07 +0300 Subject: [PATCH 043/105] gdal: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 33baef25e07cd..df4bd532bf822 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -176,11 +176,11 @@ def requirements(self): if self.options.with_armadillo: self.requires("armadillo/12.2.0") if self.options.with_arrow: - self.requires("arrow/12.0.0") + self.requires("arrow/13.0.0") if self.options.with_basisu: self.requires("libbasisu/1.15.0") if self.options.with_blosc: - self.requires("c-blosc/1.21.4") + self.requires("c-blosc/1.21.5") if self.options.with_cfitsio: self.requires("cfitsio/4.2.0") if self.options.with_cryptopp: @@ -207,7 +207,7 @@ def requirements(self): if self.options.with_hdf5: self.requires("hdf5/1.14.1") if self.options.with_heif: - self.requires("libheif/1.13.0") + self.requires("libheif/1.16.2") if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": @@ -252,7 +252,7 @@ def requirements(self): self.requires("pdfium/cci.20210730") if self.options.with_pg: # libpq 15+ is not supported - self.requires("libpq/14.7") + self.requires("libpq/14.9") if self.options.with_png: self.requires("libpng/1.6.40") if self.options.with_podofo: From 4e3989387e00603d8b665ef4d91a695c7021434f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 7 Sep 2023 20:41:13 +0300 Subject: [PATCH 044/105] gdal: fix shared builds Reverted back to using gdal_target_link_libraries() and fixed a number of issues caused by recursive CMakeDeps targets. --- recipes/gdal/post_3.5.0/conandata.yml | 9 +++ recipes/gdal/post_3.5.0/conanfile.py | 5 -- .../3.5.2/1-fix-recursive-targets.patch | 57 +++++++++++++++ .../3.7.1/1-fix-recursive-targets.patch | 69 +++++++++++++++++++ 4 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch create mode 100644 recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 1a19c86f2f9de..e09876c174a93 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -13,11 +13,20 @@ patches: - patch_file: "patches/3.7.1/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" + - patch_file: "patches/3.7.1/1-fix-recursive-targets.patch" + patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" + patch_type: "conan" "3.7.0": - patch_file: "patches/3.7.0/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" + - patch_file: "patches/3.7.1/1-fix-recursive-targets.patch" + patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" + patch_type: "conan" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" + - patch_file: "patches/3.5.2/1-fix-recursive-targets.patch" + patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" + patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index df4bd532bf822..f348680f8549c 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -560,11 +560,6 @@ def _patch_sources(self): copy(self, "ConanFindPackage.cmake", src=self.export_sources_folder, dst=os.path.join(self.source_folder, "cmake", "helpers")) - # Use standard target_link_libraries instead of gdal_target_link_libraries. - # GDAL version does not allow PUBLIC and got stuck in an infinite recursion for some Conan deps. - replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "GdalDriverHelper.cmake"), - "function(gdal_target_link_libraries target)", - "function(gdal_target_link_libraries target)\ntarget_link_libraries(${target} ${ARGN})\nreturn()\n") # Fix Deflate::Deflate not being correctly propagated internally. replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), "PRIVATE Deflate::Deflate", diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch new file mode 100644 index 0000000000000..404dbe59eada8 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch @@ -0,0 +1,57 @@ +diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake +--- a/cmake/helpers/GdalGenerateConfig.cmake ++++ b/cmake/helpers/GdalGenerateConfig.cmake +@@ -44,6 +44,10 @@ + elseif(_lib STREQUAL "general") + continue() + endif() ++ if(_lib IN_LIST _seen_libs) ++ continue() ++ endif() ++ list(APPEND _seen_libs "${_lib}") + gdal_resolve_link_genex(_lib "${_lib}") + if(_lib) + list(APPEND _libs "${_lib}") +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -233,9 +233,9 @@ + endif () + endfunction() + +-function(gdal_target_interfaces _TARGET) ++function(gdal_target_interfaces _TARGET _seen_libs) + foreach (_LIB IN ITEMS ${ARGN}) +- if (TARGET ${_LIB}) ++ if (TARGET ${_LIB} AND NOT ${_LIB} IN_LIST _seen_libs) + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + if (_res) + target_include_directories(${_TARGET} PRIVATE ${_res}) +@@ -247,6 +247,10 @@ + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_COMPILE_OPTIONS) + if (_res) + target_compile_options(${_TARGET} PRIVATE ${_res}) ++ endif () ++ get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) ++ if (_res) ++ gdal_target_interfaces(${_TARGET} "${_seen_libs};${ARGN}" ${_res}) + endif () + endif () + endforeach () +@@ -283,7 +287,7 @@ + if (RES) + target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) + endif () + endfunction() +@@ -310,6 +314,7 @@ + endif() + endif() + endforeach() ++ + endmacro() + + # gdal_dependent_format(format desc depend) do followings: diff --git a/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch new file mode 100644 index 0000000000000..a6d6f749650a6 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch @@ -0,0 +1,69 @@ +diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake +--- a/cmake/helpers/GdalGenerateConfig.cmake ++++ b/cmake/helpers/GdalGenerateConfig.cmake +@@ -44,6 +44,10 @@ + elseif(_lib STREQUAL "general") + continue() + endif() ++ if(_lib IN_LIST _seen) ++ continue() ++ endif() ++ list(APPEND _seen "${_lib}") + gdal_resolve_link_genex(_lib "${_lib}") + if(_lib) + list(APPEND _libs "${_lib}") +@@ -64,7 +68,10 @@ + while(_input MATCHES "^(.*)\\\$<([^:>]*):*([^>]*)>") + set(_match "${CMAKE_MATCH_0}") + set(_first "${CMAKE_MATCH_1}") +- gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") ++ if(NOT _first IN_LIST _genex_seen) ++ gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") ++ endif() ++ list(APPEND _genex_seen "${_first}") + string(REPLACE "${_match}" "${_first}${_second}" _input "${_input}") + endwhile() + set("${_result}" "${_input}" PARENT_SCOPE) +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -233,9 +233,9 @@ + endif () + endfunction() + +-function(gdal_target_interfaces _TARGET) ++function(gdal_target_interfaces _TARGET _seen_libs) + foreach (_LIB IN ITEMS ${ARGN}) +- if (TARGET ${_LIB}) ++ if (TARGET ${_LIB} AND NOT ${_LIB} IN_LIST _seen_libs) + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + if (_res) + target_include_directories(${_TARGET} PRIVATE ${_res}) +@@ -250,7 +250,7 @@ + endif () + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) + if (_res) +- gdal_target_interfaces(${_TARGET} ${_res}) ++ gdal_target_interfaces(${_TARGET} "${_seen_libs};${ARGN}" ${_res}) + endif () + endif () + endforeach () +@@ -280,9 +280,6 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) +- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") +- endif () + is_plugin(RES ${target}) + if (RES) + target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) +@@ -295,7 +292,7 @@ + endif() + endforeach() + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) + endif () + From 040aa8203902e57bff4d966e3964f6f818c915c3 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 7 Sep 2023 20:56:38 +0300 Subject: [PATCH 045/105] gdal: use version ranges for libcurl and zlib --- recipes/gdal/post_3.5.0/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index f348680f8549c..1d38252d12629 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -172,7 +172,7 @@ def requirements(self): self.requires("proj/9.2.1") # Used in a public header here: # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 - self.requires("zlib/1.2.13", transitive_headers=True) + self.requires("zlib/[>=1.2.10 <2]", transitive_headers=True) if self.options.with_armadillo: self.requires("armadillo/12.2.0") if self.options.with_arrow: @@ -186,7 +186,7 @@ def requirements(self): if self.options.with_cryptopp: self.requires("cryptopp/8.7.0") if self.options.with_curl: - self.requires("libcurl/8.2.1") + self.requires("libcurl/[>=7.78 <9]") if self.options.with_dds: self.requires("crunch/cci.20190615") if self.options.with_expat: From 367641c12711e70d20ccc6a825da48d27ba2ce89 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 11 Sep 2023 15:57:27 +0300 Subject: [PATCH 046/105] gdal: fix v5.3.2 patch --- .../patches/3.5.2/1-fix-recursive-targets.patch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch index 404dbe59eada8..89199c2686fbb 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch @@ -38,7 +38,14 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -283,7 +287,7 @@ +@@ -276,14 +280,11 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) +- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") +- endif () + is_plugin(RES ${target}) if (RES) target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) else () @@ -47,11 +54,3 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) endif () endfunction() -@@ -310,6 +314,7 @@ - endif() - endif() - endforeach() -+ - endmacro() - - # gdal_dependent_format(format desc depend) do followings: From f6fa4dee9001d84237054bda2d898c048b8539db Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 11 Sep 2023 16:28:21 +0300 Subject: [PATCH 047/105] gdal: fix includes not being propagated correctly --- .../post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch | 3 ++- .../post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch index 89199c2686fbb..06fa307f1f3c5 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch @@ -38,7 +38,7 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -276,14 +280,11 @@ +@@ -276,15 +280,12 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) @@ -52,5 +52,6 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp - gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) + gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) endif () endfunction() diff --git a/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch index a6d6f749650a6..478850c9c335e 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch @@ -58,12 +58,13 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp is_plugin(RES ${target}) if (RES) target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) -@@ -295,7 +292,7 @@ +@@ -295,7 +292,8 @@ endif() endforeach() else () - gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) + gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) endif () From 8bebf40e5e2a2a3478487a501a0940371dbf7074 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 11 Sep 2023 18:48:38 +0300 Subject: [PATCH 048/105] gdal: Conan v1 issue --- recipes/gdal/post_3.5.0/test_package/conanfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/test_package/conanfile.py b/recipes/gdal/post_3.5.0/test_package/conanfile.py index cf27fad652610..9ae9dd1c61f74 100644 --- a/recipes/gdal/post_3.5.0/test_package/conanfile.py +++ b/recipes/gdal/post_3.5.0/test_package/conanfile.py @@ -1,6 +1,6 @@ import os -from conan import ConanFile +from conan import ConanFile, conan_version from conan.tools.build import can_run from conan.tools.cmake import cmake_layout, CMake @@ -23,7 +23,8 @@ def build(self): def test(self): if can_run(self): - if self.dependencies["gdal"].options.tools: + gdal_options = self.options["gdal"] if conan_version < "2" else self.dependencies["gdal"].options + if gdal_options.tools: self.run("gdal_translate --formats", env="conanrun") bin_path = os.path.join(self.cpp.build.bindir, "test_package") self.run(bin_path, env="conanrun") From 035e2375107ee9d326824eacde0cb2aa41ec6f8f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 11 Sep 2023 19:40:36 +0300 Subject: [PATCH 049/105] gdal: fix linter warnings --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 1d38252d12629..97275c4da0511 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -308,7 +308,7 @@ def validate(self): raise ConanInvalidConfiguration(msg) if self.options.with_poppler and self.dependencies["poppler"].options.with_libjpeg != self.options.with_jpeg: - msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or" " libjpeg-turbo." + msg = "poppler:with_libjpeg and gdal:with_jpeg must be set to the same value, either libjpeg or libjpeg-turbo." self.output.error(msg) raise ConanInvalidConfiguration(msg) From f279eab853d29e882b39cbf1ff5eb85aa40ab95e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 12 Sep 2023 07:47:23 +0300 Subject: [PATCH 050/105] gdal: fix patch issue --- .../gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch index 06fa307f1f3c5..41a5c1ce7e58a 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch @@ -38,7 +38,7 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -276,15 +280,12 @@ +@@ -276,14 +280,12 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) From 3de211f1bce1a135530c676262ccc4cb26f1b404 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 18 Sep 2023 11:01:45 +0300 Subject: [PATCH 051/105] gdal: bump to 3.7.2 --- recipes/gdal/config.yml | 4 ++-- recipes/gdal/post_3.5.0/conandata.yml | 14 +++++++------- .../{3.7.1 => 3.7.2}/0-replace-find-package.patch | 0 .../{3.7.1 => 3.7.2}/1-fix-recursive-targets.patch | 0 4 files changed, 9 insertions(+), 9 deletions(-) rename recipes/gdal/post_3.5.0/patches/{3.7.1 => 3.7.2}/0-replace-find-package.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.7.1 => 3.7.2}/1-fix-recursive-targets.patch (100%) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index a2ce278d92965..c142b01c1e04e 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,10 +1,10 @@ versions: + "3.7.2": + folder: "post_3.5.0" "3.7.0": folder: "post_3.5.0" "3.5.2": folder: "post_3.5.0" - "3.5.1": - folder: "post_3.5.0" "3.4.3": folder: "pre_3.5.0" "3.4.1": diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index e09876c174a93..f9aba34577ab1 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,7 +1,7 @@ sources: - "3.7.1": - url: "https://github.com/OSGeo/gdal/releases/download/v3.7.1/gdal-3.7.1.tar.gz" - sha256: "c131a39d0f7c2a76f02dd648f2906179ddb38958673461eee1da4f9c9a166e76" + "3.7.2": + url: "https://github.com/OSGeo/gdal/releases/download/v3.7.2/gdal-3.7.2.tar.gz" + sha256: "fd8aabc63e02bcce2aecc0234af58171b91f478b6111f75b4b236919dac369a5" "3.7.0": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.0/gdal-3.7.0.tar.gz" sha256: "5a806d759f403a15bbbf8a14ecc6947071afc5ab91e5abaef0d11d1d2d16bf94" @@ -9,18 +9,18 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" patches: - "3.7.1": - - patch_file: "patches/3.7.1/0-replace-find-package.patch" + "3.7.2": + - patch_file: "patches/3.7.2/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.7.1/1-fix-recursive-targets.patch" + - patch_file: "patches/3.7.2/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" "3.7.0": - patch_file: "patches/3.7.0/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.7.1/1-fix-recursive-targets.patch" + - patch_file: "patches/3.7.2/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" "3.5.2": diff --git a/recipes/gdal/post_3.5.0/patches/3.7.1/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.2/0-replace-find-package.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.7.1/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.7.2/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.2/1-fix-recursive-targets.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.7.1/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.7.2/1-fix-recursive-targets.patch From cb5dd246cc783eef1ec9b7716ca388f5d7e58755 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 1 Nov 2023 15:09:22 +0200 Subject: [PATCH 052/105] gdal/post_3.5.0: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 97275c4da0511..b76df44053e9b 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -168,13 +168,13 @@ def layout(self): def requirements(self): self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") - self.requires("libtiff/4.5.1") - self.requires("proj/9.2.1") + self.requires("libtiff/4.6.0") + self.requires("proj/9.3.0") # Used in a public header here: # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 - self.requires("zlib/[>=1.2.10 <2]", transitive_headers=True) + self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) if self.options.with_armadillo: - self.requires("armadillo/12.2.0") + self.requires("armadillo/12.6.4") if self.options.with_arrow: self.requires("arrow/13.0.0") if self.options.with_basisu: @@ -182,9 +182,9 @@ def requirements(self): if self.options.with_blosc: self.requires("c-blosc/1.21.5") if self.options.with_cfitsio: - self.requires("cfitsio/4.2.0") + self.requires("cfitsio/4.3.0") if self.options.with_cryptopp: - self.requires("cryptopp/8.7.0") + self.requires("cryptopp/8.8.0") if self.options.with_curl: self.requires("libcurl/[>=7.78 <9]") if self.options.with_dds: @@ -197,7 +197,7 @@ def requirements(self): if self.options.with_freexl: self.requires("freexl/2.0.0") if self.options.with_geos: - self.requires("geos/3.11.2") + self.requires("geos/3.12.0") if self.options.with_gif: self.requires("giflib/5.2.1") if self.options.with_gta: @@ -217,17 +217,17 @@ def requirements(self): if self.options.with_kea: self.requires("kealib/1.4.14") if self.options.with_lerc: - self.requires("lerc/4.0.0") + self.requires("lerc/4.0.1") if self.options.with_libarchive: - self.requires("libarchive/3.6.2") + self.requires("libarchive/3.7.1") if self.options.with_libdeflate: - self.requires("libdeflate/1.18") + self.requires("libdeflate/1.19") if self.options.with_libiconv: self.requires("libiconv/1.17") if self.options.with_libkml: self.requires("libkml/1.3.0") if self.options.with_lzma: - self.requires("xz_utils/5.4.2") + self.requires("xz_utils/5.4.4") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_mongocxx: @@ -266,13 +266,13 @@ def requirements(self): if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.42.0") + self.requires("sqlite3/3.43.2") if self.options.with_webp: - self.requires("libwebp/1.3.1") + self.requires("libwebp/1.3.2") if self.options.with_xerces: self.requires("xerces-c/3.2.4") if self.options.with_xml2: - self.requires("libxml2/2.11.4") + self.requires("libxml2/2.11.5") if self.options.with_zstd: self.requires("zstd/1.5.5") # Use of external shapelib is not recommended and is currently broken. From c2042c2be8a4aa2f7f5124f8b13123133aec20de Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 2 Nov 2023 17:35:44 +0200 Subject: [PATCH 053/105] gdal/post_3.5.0: add missing system libs --- recipes/gdal/post_3.5.0/conanfile.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index b76df44053e9b..e930cda2440b6 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -4,6 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc required_conan_version = ">=1.52.0" @@ -588,8 +589,10 @@ def package_info(self): self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("pkg_config_name", "gdal") + # https://github.com/OSGeo/gdal/blob/v3.7.2/gdal.cmake#L384-L392 + # FIXME: set the correct postfix for MinGW shared builds libname = "gdal" - if self.settings.os == "Windows": + if is_msvc(self): if self.settings.build_type == "Debug": libname += "d" self.cpp_info.libs = [libname] @@ -700,20 +703,24 @@ def package_info(self): if self.options.with_zstd: self.cpp_info.requires.extend(["zstd::zstdlib"]) + # Based on https://github.com/OSGeo/gdal/blob/v3.7.2/port/CMakeLists.txt + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs += ["pthread"] + elif self.settings.os == "Windows": + if is_msvc(self): + self.cpp_info.system_libs += ["wbemuuid"] + if self.options.with_openssl: + self.cpp_info.system_libs += ["crypt32"] + gdal_data_path = os.path.join(self.package_folder, "res", "gdal") - self.output.info(f"Prepending to GDAL_DATA environment variable: {gdal_data_path}") self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) if self.options.tools: self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) + # TODO: remove in conan v2 self.cpp_info.names["cmake_find_package"] = "GDAL" self.cpp_info.names["cmake_find_package_multi"] = "GDAL" self.cpp_info.filenames["cmake_find_package"] = "GDAL" self.cpp_info.filenames["cmake_find_package_multi"] = "GDAL" - if self.options.tools: - bin_path = os.path.join(self.package_folder, "bin") - self.output.info(f"Appending PATH environment variable: {bin_path}") - self.env_info.PATH.append(bin_path) - # TODO: to remove after conan v2, it allows to not break consumers still relying on virtualenv generator self.env_info.GDAL_DATA = gdal_data_path From 343b691df1615b9ec5f56a9a6e885a1bd014f9b5 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 18 Nov 2023 10:22:28 +0200 Subject: [PATCH 054/105] gdal: add v3.8.0, v3.7.3, v3.5.3, drop old versions --- recipes/gdal/post_3.5.0/conandata.yml | 32 ++++----- .../0-replace-find-package.patch | 0 .../1-fix-recursive-targets.patch | 0 .../0-replace-find-package.patch | 0 .../1-fix-recursive-targets.patch | 0 .../0-replace-find-package.patch | 7 +- .../3.8.0/1-fix-recursive-targets.patch | 70 +++++++++++++++++++ 7 files changed, 89 insertions(+), 20 deletions(-) rename recipes/gdal/post_3.5.0/patches/{3.5.2 => 3.5.3}/0-replace-find-package.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.5.2 => 3.5.3}/1-fix-recursive-targets.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.7.2 => 3.7.3}/0-replace-find-package.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.7.2 => 3.7.3}/1-fix-recursive-targets.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.7.0 => 3.8.0}/0-replace-find-package.patch (93%) create mode 100644 recipes/gdal/post_3.5.0/patches/3.8.0/1-fix-recursive-targets.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index f9aba34577ab1..604c3b6f57ae4 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,32 +1,32 @@ sources: - "3.7.2": - url: "https://github.com/OSGeo/gdal/releases/download/v3.7.2/gdal-3.7.2.tar.gz" - sha256: "fd8aabc63e02bcce2aecc0234af58171b91f478b6111f75b4b236919dac369a5" - "3.7.0": - url: "https://github.com/OSGeo/gdal/releases/download/v3.7.0/gdal-3.7.0.tar.gz" - sha256: "5a806d759f403a15bbbf8a14ecc6947071afc5ab91e5abaef0d11d1d2d16bf94" - "3.5.2": + "3.8.0": + url: "https://github.com/OSGeo/gdal/releases/download/v3.8.0/gdal-3.8.0.tar.gz" + sha256: "69d881cf6e883623bd18e2a6e02ac34ef27db1a9ee68b09961d13703c0862002" + "3.7.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" + sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" + "3.5.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" patches: - "3.7.2": - - patch_file: "patches/3.7.2/0-replace-find-package.patch" + "3.8.0": + - patch_file: "patches/3.8.0/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.7.2/1-fix-recursive-targets.patch" + - patch_file: "patches/3.8.0/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" - "3.7.0": - - patch_file: "patches/3.7.0/0-replace-find-package.patch" + "3.7.3": + - patch_file: "patches/3.7.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.7.2/1-fix-recursive-targets.patch" + - patch_file: "patches/3.7.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" - "3.5.2": - - patch_file: "patches/3.5.2/0-replace-find-package.patch" + "3.5.3": + - patch_file: "patches/3.5.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.5.2/1-fix-recursive-targets.patch" + - patch_file: "patches/3.5.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.7.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.7.2/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.7.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/1-fix-recursive-targets.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.7.2/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.7.3/1-fix-recursive-targets.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.8.0/0-replace-find-package.patch similarity index 93% rename from recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.8.0/0-replace-find-package.patch index 24028dfe69c39..f3bd7f40faeb8 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.8.0/0-replace-find-package.patch @@ -1,6 +1,5 @@ -diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/CheckDependentLibraries.cmake ---- ./a/cmake/helpers/CheckDependentLibraries.cmake -+++ ./b/cmake/helpers/CheckDependentLibraries.cmake +--- cmake/helpers/CheckDependentLibraries.cmake ++++ cmake/helpers/CheckDependentLibraries.cmake @@ -11,7 +11,7 @@ include(CheckFunctionExists) include(CMakeDependentOption) @@ -71,7 +70,7 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") endif () endif () -@@ -729,7 +738,7 @@ +@@ -736,7 +745,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) # OpenJPEG's cmake-CONFIG is broken, so call module explicitly diff --git a/recipes/gdal/post_3.5.0/patches/3.8.0/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.8.0/1-fix-recursive-targets.patch new file mode 100644 index 0000000000000..478850c9c335e --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.8.0/1-fix-recursive-targets.patch @@ -0,0 +1,70 @@ +diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake +--- a/cmake/helpers/GdalGenerateConfig.cmake ++++ b/cmake/helpers/GdalGenerateConfig.cmake +@@ -44,6 +44,10 @@ + elseif(_lib STREQUAL "general") + continue() + endif() ++ if(_lib IN_LIST _seen) ++ continue() ++ endif() ++ list(APPEND _seen "${_lib}") + gdal_resolve_link_genex(_lib "${_lib}") + if(_lib) + list(APPEND _libs "${_lib}") +@@ -64,7 +68,10 @@ + while(_input MATCHES "^(.*)\\\$<([^:>]*):*([^>]*)>") + set(_match "${CMAKE_MATCH_0}") + set(_first "${CMAKE_MATCH_1}") +- gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") ++ if(NOT _first IN_LIST _genex_seen) ++ gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") ++ endif() ++ list(APPEND _genex_seen "${_first}") + string(REPLACE "${_match}" "${_first}${_second}" _input "${_input}") + endwhile() + set("${_result}" "${_input}" PARENT_SCOPE) +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -233,9 +233,9 @@ + endif () + endfunction() + +-function(gdal_target_interfaces _TARGET) ++function(gdal_target_interfaces _TARGET _seen_libs) + foreach (_LIB IN ITEMS ${ARGN}) +- if (TARGET ${_LIB}) ++ if (TARGET ${_LIB} AND NOT ${_LIB} IN_LIST _seen_libs) + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + if (_res) + target_include_directories(${_TARGET} PRIVATE ${_res}) +@@ -250,7 +250,7 @@ + endif () + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) + if (_res) +- gdal_target_interfaces(${_TARGET} ${_res}) ++ gdal_target_interfaces(${_TARGET} "${_seen_libs};${ARGN}" ${_res}) + endif () + endif () + endforeach () +@@ -280,9 +280,6 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) +- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") +- endif () + is_plugin(RES ${target}) + if (RES) + target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) +@@ -295,7 +292,8 @@ + endif() + endforeach() + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) + endif () + From 100e3fdb6d6b7d100c972cd29fe9afb4ba600b5c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 18 Nov 2023 10:24:23 +0200 Subject: [PATCH 055/105] gdal: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index e930cda2440b6..644d1b42b22b3 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -177,7 +177,7 @@ def requirements(self): if self.options.with_armadillo: self.requires("armadillo/12.6.4") if self.options.with_arrow: - self.requires("arrow/13.0.0") + self.requires("arrow/14.0.1") if self.options.with_basisu: self.requires("libbasisu/1.15.0") if self.options.with_blosc: @@ -193,7 +193,7 @@ def requirements(self): if self.options.with_expat: self.requires("expat/2.5.0") if self.options.with_exr: - self.requires("openexr/3.1.9") + self.requires("openexr/3.2.1") self.requires("imath/3.1.9") if self.options.with_freexl: self.requires("freexl/2.0.0") @@ -206,13 +206,13 @@ def requirements(self): if self.options.with_hdf4: self.requires("hdf4/4.2.15") if self.options.with_hdf5: - self.requires("hdf5/1.14.1") + self.requires("hdf5/1.14.2") if self.options.with_heif: self.requires("libheif/1.16.2") if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.0") + self.requires("libjpeg-turbo/3.0.1") if self.options.with_jxl: self.requires("libjxl/0.6.1") if self.options.with_kea: @@ -220,7 +220,7 @@ def requirements(self): if self.options.with_lerc: self.requires("lerc/4.0.1") if self.options.with_libarchive: - self.requires("libarchive/3.7.1") + self.requires("libarchive/3.7.2") if self.options.with_libdeflate: self.requires("libdeflate/1.19") if self.options.with_libiconv: @@ -232,7 +232,7 @@ def requirements(self): if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_mongocxx: - self.requires("mongo-cxx-driver/3.8.0") + self.requires("mongo-cxx-driver/3.8.1") if self.options.with_mysql == "libmysqlclient": self.requires("libmysqlclient/8.1.0") elif self.options.with_mysql == "mariadb-connector-c": @@ -250,7 +250,7 @@ def requirements(self): if self.options.with_pcre2: self.requires("pcre2/10.42") if self.options.with_pdfium: - self.requires("pdfium/cci.20210730") + self.requires("pdfium/95.0.4629") if self.options.with_pg: # libpq 15+ is not supported self.requires("libpq/14.9") @@ -267,7 +267,7 @@ def requirements(self): if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.43.2") + self.requires("sqlite3/3.44.0") if self.options.with_webp: self.requires("libwebp/1.3.2") if self.options.with_xerces: From 7540a257e55cd61e5779692614929c2c01995d76 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 18 Nov 2023 10:27:53 +0200 Subject: [PATCH 056/105] gdal: disable pdfium --- recipes/gdal/post_3.5.0/conanfile.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 644d1b42b22b3..f8cd9e5d290b2 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -64,7 +64,7 @@ class GdalConan(ConanFile): "with_openssl": [True, False], "with_pcre": [True, False], "with_pcre2": [True, False], - "with_pdfium": [True, False], + # "with_pdfium": [True, False], "with_pg": [True, False], "with_png": [True, False], "with_podofo": [True, False], @@ -125,7 +125,7 @@ class GdalConan(ConanFile): "with_openssl": False, "with_pcre": False, "with_pcre2": False, - "with_pdfium": False, + # "with_pdfium": False, "with_pg": False, "with_png": True, "with_podofo": False, @@ -249,8 +249,9 @@ def requirements(self): self.requires("pcre/8.45") if self.options.with_pcre2: self.requires("pcre2/10.42") - if self.options.with_pdfium: - self.requires("pdfium/95.0.4629") + # TODO: pdfium recipe needs to be compatible with https://github.com/rouault/pdfium_build_gdal_3_8 + # if self.options.with_pdfium: + # self.requires("pdfium/95.0.4629") if self.options.with_pg: # libpq 15+ is not supported self.requires("libpq/14.9") @@ -397,7 +398,7 @@ def generate(self): tc.cache_variables["GDAL_USE_PARQUET"] = False tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 - tc.cache_variables["GDAL_USE_PDFIUM"] = self.options.with_pdfium + tc.cache_variables["GDAL_USE_PDFIUM"] = False # self.options.with_pdfium tc.cache_variables["GDAL_USE_PNG"] = self.options.with_png tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo @@ -676,8 +677,8 @@ def package_info(self): self.cpp_info.requires.extend(["pcre::pcre"]) if self.options.with_pcre2: self.cpp_info.requires.extend(["pcre2::pcre2-8"]) - if self.options.with_pdfium: - self.cpp_info.requires.extend(["pdfium::pdfium"]) + # if self.options.with_pdfium: + # self.cpp_info.requires.extend(["pdfium::pdfium"]) if self.options.with_pg: self.cpp_info.requires.extend(["libpq::pq"]) if self.options.with_png: From 4767bd3fe72cd82d5fbb51b25c51763f3e6d918a Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 18 Nov 2023 18:28:58 +0200 Subject: [PATCH 057/105] gdal: update config.yml --- recipes/gdal/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index c142b01c1e04e..c33434e96c652 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,9 +1,9 @@ versions: - "3.7.2": + "3.8.0": folder: "post_3.5.0" - "3.7.0": + "3.7.3": folder: "post_3.5.0" - "3.5.2": + "3.5.3": folder: "post_3.5.0" "3.4.3": folder: "pre_3.5.0" From b4b10a4323a4e08a3ebbb800fe90c43ddeddca01 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 00:43:11 +0200 Subject: [PATCH 058/105] gdal: fix failing compilation checks on MSVC --- recipes/gdal/post_3.5.0/conanfile.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index f8cd9e5d290b2..471ee752031b2 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -5,6 +5,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version required_conan_version = ">=1.52.0" @@ -421,6 +422,26 @@ def generate(self): tc.cache_variables["GDAL_USE_ZLIB"] = True tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd + # https://github.com/OSGeo/gdal/blob/v3.8.0/cmake/helpers/CheckDependentLibraries.cmake#L419-L450 + tc.cache_variables["HAVE_JPEGTURBO_DUAL_MODE_8_12"] = ( + self.options.with_jpeg == "libjpeg-turbo" and + bool(self.dependencies["libjpeg-turbo"].options.get_safe("enable12bit")) + ) + # https://github.com/OSGeo/gdal/blob/v3.8.0/port/CMakeLists.txt + tc.cache_variables["BLOSC_HAS_BLOSC_CBUFFER_VALIDATE"] = ( + self.options.with_blosc and + Version(self.dependencies["c-blosc"].ref.version) >= "1.21.5" + ) + # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf5/CMakeLists.txt#L61-L64 + tc.cache_variables["GDAL_ENABLE_HDF5_GLOBAL_LOCK"] = ( + self.dependencies.get("hdf5", False) and + bool(self.dependencies["hdf5"].options.get_safe("threadsafe")) + ) + # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf4/CMakeLists.txt#L28-L46 + tc.cache_variables["HDF4_HAS_MAXOPENFILES"] = ( + self.dependencies.get("hdf4", False) and + Version(self.dependencies["hdf4"].ref.version) >= "4.2.5" + ) tc.generate() jsonc = self.dependencies["json-c"] From 1b6b4212a41ad7e4a885b7a517dfdcda2f25c50b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 00:56:59 +0200 Subject: [PATCH 059/105] gdal: downgrade sqlite3 for proj --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 471ee752031b2..cd223d37d8eb9 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -269,7 +269,7 @@ def requirements(self): if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.44.0") + self.requires("sqlite3/3.43.2") if self.options.with_webp: self.requires("libwebp/1.3.2") if self.options.with_xerces: From 6649b6776241435a97836d434f5ed9918b1274eb Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 01:12:22 +0200 Subject: [PATCH 060/105] gdal: fix hdf5 check --- recipes/gdal/post_3.5.0/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index cd223d37d8eb9..4d0fb3697314c 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -434,12 +434,12 @@ def generate(self): ) # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf5/CMakeLists.txt#L61-L64 tc.cache_variables["GDAL_ENABLE_HDF5_GLOBAL_LOCK"] = ( - self.dependencies.get("hdf5", False) and + self.options.with_hdf5 and bool(self.dependencies["hdf5"].options.get_safe("threadsafe")) ) # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf4/CMakeLists.txt#L28-L46 tc.cache_variables["HDF4_HAS_MAXOPENFILES"] = ( - self.dependencies.get("hdf4", False) and + self.options.with_hdf4 and Version(self.dependencies["hdf4"].ref.version) >= "4.2.5" ) tc.generate() From 69a6d250ff8529a2f2dc7c6a9a551791cb7eb17e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 10:31:18 +0200 Subject: [PATCH 061/105] gdal: add brunsli support --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 4d0fb3697314c..edf9e212b18e2 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -29,6 +29,7 @@ class GdalConan(ConanFile): "with_arrow": [True, False], "with_basisu": [True, False], "with_blosc": [True, False], + "with_brunsli": [True, False], "with_cfitsio": [True, False], # with_cypto option has been renamed with_openssl in version 3.5.1 "with_crypto": ["deprecated", True, False], @@ -91,6 +92,7 @@ class GdalConan(ConanFile): "with_arrow": False, "with_basisu": False, "with_blosc": False, + "with_brunsli": False, "with_cfitsio": False, "with_crypto": "deprecated", "with_cryptopp": False, @@ -183,6 +185,8 @@ def requirements(self): self.requires("libbasisu/1.15.0") if self.options.with_blosc: self.requires("c-blosc/1.21.5") + if self.options.with_brunsli: + self.requires("brunsli/cci.20231024") if self.options.with_cfitsio: self.requires("cfitsio/4.3.0") if self.options.with_cryptopp: @@ -452,7 +456,7 @@ def generate(self): conan_to_cmake_pkg_name = { "armadillo": "Armadillo", "arrow": "Arrow", - # "brunsli": "BRUNSLI", + "brunsli": "BRUNSLI", "c-blosc": "Blosc", "cfitsio": "CFITSIO", "crunch": "Crnlib", @@ -537,6 +541,8 @@ def generate(self): renamed_targets = { "arrow": "Arrow::arrow_shared", + "brunsli::brunslidec-c": "BRUNSLI::DECODE", + "brunsli::brunslienc-c": "BRUNSLI::ENCODE", "c-blosc": "Blosc::Blosc", "cfitsio": "CFITSIO::CFITSIO", "crunch": "CRNLIB::Crnlib", @@ -630,6 +636,8 @@ def package_info(self): self.cpp_info.requires.extend(["arrow::libarrow"]) if self.options.with_basisu: self.cpp_info.requires.extend(["libbasisu::libbasisu"]) + if self.options.with_brunsli: + self.cpp_info.requires.extend(["brunsli::brunsli"]) if self.options.with_blosc: self.cpp_info.requires.extend(["c-blosc::c-blosc"]) if self.options.with_cfitsio: From 1b1258473b8a7651c9605ead8376d555190c06cc Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 11:07:39 +0200 Subject: [PATCH 062/105] gdal: add opencl support --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index edf9e212b18e2..097bc6e06624c 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -62,6 +62,7 @@ class GdalConan(ConanFile): "with_netcdf": [True, False], "with_odbc": [True, False], "with_opencad": [True, False], + "with_opencl": [True, False], "with_openjpeg": [True, False], "with_openssl": [True, False], "with_pcre": [True, False], @@ -124,6 +125,7 @@ class GdalConan(ConanFile): "with_netcdf": False, "with_odbc": False, "with_opencad": False, + "with_opencl": True, "with_openjpeg": False, "with_openssl": False, "with_pcre": False, @@ -246,6 +248,8 @@ def requirements(self): self.requires("netcdf/4.8.1") if self.options.with_odbc: self.requires("odbc/2.3.11") + if self.options.with_opencl: + self.requires("opencl-icd-loader/2023.04.17") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_openssl: @@ -397,6 +401,7 @@ def generate(self): tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad tc.cache_variables["GDAL_USE_OPENCL"] = False tc.cache_variables["GDAL_USE_OPENEXR"] = self.options.with_exr + tc.cache_variables["GDAL_USE_OPENCL"] = self.options.with_opencl tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl tc.cache_variables["GDAL_USE_ORACLE"] = False @@ -505,7 +510,7 @@ def generate(self): # "odbccpp": "ODBCCPP", # "ogdi": "OGDI", # "opencad": "OpenCAD", - # "opencl": "OpenCL", + "opencl-icd-loader": "OpenCL", "openexr": "OpenEXR", "openjpeg": "OpenJPEG", "openssl": "OpenSSL", @@ -569,6 +574,7 @@ def generate(self): "mongo-cxx-driver::bsoncxx": "MONGOCXX::BSONCXX", "mongo-cxx-driver::mongocxx": "MONGOCXX::MONGOCXX", "netcds": "netCDF::netcdf", + "opencl-icd-loader": "OpenCL::OpenCL", "openjpeg": "OPENJPEG::OpenJPEG", "pcre": "PCRE::PCRE", "pcre2::pcre2-8": "PCRE2::PCRE2-8", @@ -698,6 +704,8 @@ def package_info(self): self.cpp_info.requires.extend(["netcdf::netcdf"]) if self.options.with_odbc: self.cpp_info.requires.extend(["odbc::odbc"]) + if self.options.with_opencl: + self.cpp_info.requires.extend(["opencl-icd-loader::opencl-icd-loader"]) if self.options.with_openjpeg: self.cpp_info.requires.extend(["openjpeg::openjpeg"]) if self.options.with_openssl: From 2ac650b70dc9df89533d64f34a23a0df32b1cb4f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 14:14:29 +0200 Subject: [PATCH 063/105] gdal: add tiledb --- recipes/gdal/post_3.5.0/conanfile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 097bc6e06624c..274d65036fbd5 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -79,6 +79,7 @@ class GdalConan(ConanFile): "with_shapelib": [True, False], "with_spatialite": [True, False], "with_sqlite3": [True, False], + "with_tiledb": [True, False], "with_webp": [True, False], "with_xerces": [True, False], "with_xml2": [True, False], @@ -142,6 +143,7 @@ class GdalConan(ConanFile): "with_shapelib": True, "with_spatialite": False, "with_sqlite3": True, + "with_tiledb": False, "with_webp": False, "with_xerces": False, "with_xml2": False, @@ -278,6 +280,8 @@ def requirements(self): self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: self.requires("sqlite3/3.43.2") + if self.options.with_tiledb: + self.requires("tiledb/2.17.4") if self.options.with_webp: self.requires("libwebp/1.3.2") if self.options.with_xerces: @@ -425,7 +429,7 @@ def generate(self): tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 tc.cache_variables["GDAL_USE_TEIGHA"] = False tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_TILEDB"] = False + tc.cache_variables["GDAL_USE_TILEDB"] = self.options.with_tiledb tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces tc.cache_variables["GDAL_USE_ZLIB"] = True @@ -526,7 +530,7 @@ def generate(self): # "sfcgal": "SFCGAL", "shapelib": "Shapelib", "sqlite3": "SQLite3", - # "tiledb": "TileDB", + "tiledb": "TileDB", "xerces-c": "XercesC", "xz_utils": "LibLZMA", "zlib": "ZLIB", @@ -582,6 +586,7 @@ def generate(self): "podofo": "PODOFO::Podofo", "poppler": "Poppler::Poppler", "shapelib": "SHAPELIB::shp", + "tiledb": "TileDB::tiledb_shared", "xz_utils": "LibLZMA::LibLZMA", "zstd": "ZSTD::zstd", } @@ -732,6 +737,8 @@ def package_info(self): self.cpp_info.requires.extend(["libspatialite::libspatialite"]) if self.options.with_sqlite3: self.cpp_info.requires.extend(["sqlite3::sqlite"]) + if self.options.with_tiledb: + self.cpp_info.requires.extend(["tiledb::tiledb"]) if self.options.with_webp: self.cpp_info.requires.extend(["libwebp::libwebp"]) if self.options.with_xerces: From ce6da4b3ebc2c5250a34f3b5785bffecff1c0e6f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 19 Nov 2023 22:05:07 +0200 Subject: [PATCH 064/105] gdal: add ecw support --- recipes/gdal/post_3.5.0/conanfile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 274d65036fbd5..dbc783e33af41 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -36,6 +36,7 @@ class GdalConan(ConanFile): "with_cryptopp": [True, False], "with_curl": [True, False], "with_dds": [True, False], + "with_ecw": [True, False], "with_expat": [True, False], "with_exr": [True, False], "with_freexl": [True, False], @@ -100,6 +101,7 @@ class GdalConan(ConanFile): "with_cryptopp": False, "with_curl": True, "with_dds": False, + "with_ecw": False, "with_expat": True, "with_exr": False, "with_freexl": False, @@ -199,6 +201,8 @@ def requirements(self): self.requires("libcurl/[>=7.78 <9]") if self.options.with_dds: self.requires("crunch/cci.20190615") + if self.options.with_ecw: + self.requires("libecwj2/3.3") if self.options.with_expat: self.requires("expat/2.5.0") if self.options.with_exr: @@ -356,7 +360,7 @@ def generate(self): tc.cache_variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp tc.cache_variables["GDAL_USE_CURL"] = self.options.with_curl tc.cache_variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate - tc.cache_variables["GDAL_USE_ECW"] = False + tc.cache_variables["GDAL_USE_ECW"] = self.options.with_ecw tc.cache_variables["GDAL_USE_EXPAT"] = self.options.with_expat tc.cache_variables["GDAL_USE_FILEGDB"] = False tc.cache_variables["GDAL_USE_FREEXL"] = self.options.with_freexl @@ -487,6 +491,7 @@ def generate(self): # "libcsf": "LIBCSF", "libcurl": "CURL", "libdeflate": "Deflate", + "libecwj2": "ECW", "libgeotiff": "GeoTIFF", "libgta": "GTA", "libheif": "HEIF", @@ -536,7 +541,6 @@ def generate(self): "zlib": "ZLIB", "zstd": "ZSTD", # Closed-source/proprietary libraries - # "ecw": "ECW", # "idb": "IDB", # "kdu": "KDU", # "luratech": "LURATECH", @@ -565,6 +569,7 @@ def generate(self): "libarchive": "ARCHIVE::ARCHIVE", "libbasisu": "basisu::basisu_lib", "libdeflate": "Deflate::Deflate", + "libecwj2": "ECW::ECW_ALL", "libgeotiff": "GEOTIFF::GEOTIFF", "libheif": "HEIF::HEIF", "libjxl::jxl": "JXL::JXL", @@ -659,6 +664,8 @@ def package_info(self): self.cpp_info.requires.extend(["libcurl::curl"]) if self.options.with_dds: self.cpp_info.requires.extend(["crunch::crunch"]) + if self.options.with_ecw: + self.cpp_info.requires.extend(["libecwj2::libecwj2"]) if self.options.with_expat: self.cpp_info.requires.extend(["expat::expat"]) if self.options.with_exr: From 5ff6318e53ec025124e0e69f22b0ead13e99f796 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 20 Nov 2023 16:10:17 +0200 Subject: [PATCH 065/105] gdal: bump sqlite3 dependency --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index dbc783e33af41..1279fcbff5ab0 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -283,7 +283,7 @@ def requirements(self): if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.43.2") + self.requires("sqlite3/3.44.0") if self.options.with_tiledb: self.requires("tiledb/2.17.4") if self.options.with_webp: From 03e039108de2cfaced0883937076fcfcee5e1bda Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 20 Nov 2023 16:15:48 +0200 Subject: [PATCH 066/105] gdal: fix brunsli option --- recipes/gdal/post_3.5.0/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 1279fcbff5ab0..b1c3fcd294dbb 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -354,7 +354,7 @@ def generate(self): tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow tc.cache_variables["GDAL_USE_BASISU"] = self.options.with_basisu tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc - tc.cache_variables["GDAL_USE_BRUNSLI"] = False + tc.cache_variables["GDAL_USE_BRUNSLI"] = self.options.with_brunsli tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds tc.cache_variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp @@ -475,7 +475,6 @@ def generate(self): "crunch": "Crnlib", "cryptopp": "CryptoPP", "expat": "EXPAT", - # "filegdb": "FileGDB", "freexl": "FreeXL", # "fyba": "FYBA", "geos": "GEOS", @@ -541,6 +540,7 @@ def generate(self): "zlib": "ZLIB", "zstd": "ZSTD", # Closed-source/proprietary libraries + # "filegdb": "FileGDB", # "idb": "IDB", # "kdu": "KDU", # "luratech": "LURATECH", From 1b3689b051bdd59aa1f3f7cf1d08e8559643c780 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 22 Nov 2023 11:17:24 +0200 Subject: [PATCH 067/105] gdal: fix gdal data not being packaged Fixes #15660. --- recipes/gdal/post_3.5.0/conanfile.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index b1c3fcd294dbb..983ba82d911d0 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -620,12 +620,15 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE.TXT", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.TXT", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + os.rename(os.path.join(self.package_folder, "share"), + os.path.join(self.package_folder, "res")) + rmdir(self, os.path.join(self.package_folder, "res", "bash-completion")) + rmdir(self, os.path.join(self.package_folder, "res", "man")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "GDAL") @@ -640,6 +643,7 @@ def package_info(self): if self.settings.build_type == "Debug": libname += "d" self.cpp_info.libs = [libname] + self.cpp_info.resdirs = ["res"] self.cpp_info.requires.extend(["json-c::json-c"]) self.cpp_info.requires.extend(["libgeotiff::libgeotiff"]) @@ -765,10 +769,10 @@ def package_info(self): self.cpp_info.system_libs += ["crypt32"] gdal_data_path = os.path.join(self.package_folder, "res", "gdal") - self.runenv_info.prepend_path("GDAL_DATA", gdal_data_path) + self.runenv_info.define_path("GDAL_DATA", gdal_data_path) if self.options.tools: - self.buildenv_info.prepend_path("GDAL_DATA", gdal_data_path) + self.buildenv_info.define_path("GDAL_DATA", gdal_data_path) # TODO: remove in conan v2 self.cpp_info.names["cmake_find_package"] = "GDAL" From 334706c1e0a03b18d4f974b6dabc0e8c78ff86f3 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 29 Nov 2023 16:02:40 +0200 Subject: [PATCH 068/105] gdal: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 983ba82d911d0..f7bc51b197744 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -241,7 +241,7 @@ def requirements(self): if self.options.with_libkml: self.requires("libkml/1.3.0") if self.options.with_lzma: - self.requires("xz_utils/5.4.4") + self.requires("xz_utils/5.4.5") if self.options.with_lz4: self.requires("lz4/1.9.4") if self.options.with_mongocxx: @@ -283,7 +283,7 @@ def requirements(self): if self.options.with_spatialite: self.requires("libspatialite/5.0.1") if self.options.with_sqlite3: - self.requires("sqlite3/3.44.0") + self.requires("sqlite3/3.44.2") if self.options.with_tiledb: self.requires("tiledb/2.17.4") if self.options.with_webp: From eacd9779fb44054117b284e9111c6346d164d2b7 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 1 Dec 2023 13:41:37 +0200 Subject: [PATCH 069/105] gdal: bump to v3.8.1 --- recipes/gdal/config.yml | 2 +- recipes/gdal/post_3.5.0/conandata.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index c33434e96c652..8ebbfbfbe73d1 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,5 +1,5 @@ versions: - "3.8.0": + "3.8.1": folder: "post_3.5.0" "3.7.3": folder: "post_3.5.0" diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 604c3b6f57ae4..9427afc8ce584 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,7 +1,7 @@ sources: - "3.8.0": - url: "https://github.com/OSGeo/gdal/releases/download/v3.8.0/gdal-3.8.0.tar.gz" - sha256: "69d881cf6e883623bd18e2a6e02ac34ef27db1a9ee68b09961d13703c0862002" + "3.8.1": + url: "https://github.com/OSGeo/gdal/releases/download/v3.8.1/gdal-3.8.1.tar.gz" + sha256: "75b0019c8f47bb5f1c2be2182340fc2f45ab1c684204c2aa4971d6127d819f2d" "3.7.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" From f8fc064b1ccaca2f1e48fed349905d14bbf866d1 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 5 Dec 2023 10:18:53 +0200 Subject: [PATCH 070/105] gdal: improve patching --- .../post_3.5.0/cmake/ConanFindPackage.cmake | 19 +++++++---- recipes/gdal/post_3.5.0/conandata.yml | 6 ++-- recipes/gdal/post_3.5.0/conanfile.py | 23 +++++++++---- .../3.5.3/0-replace-find-package.patch | 5 ++- .../3.7.3/0-replace-find-package.patch | 26 +++------------ .../0-replace-find-package.patch | 33 ++----------------- .../1-fix-recursive-targets.patch | 0 7 files changed, 39 insertions(+), 73 deletions(-) rename recipes/gdal/post_3.5.0/patches/{3.8.0 => 3.8.1}/0-replace-find-package.patch (52%) rename recipes/gdal/post_3.5.0/patches/{3.8.0 => 3.8.1}/1-fix-recursive-targets.patch (100%) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake index cf7f3e489702c..f4fa6c66600fb 100644 --- a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -8,6 +8,7 @@ function(find_package2 pkgname) find_package(${pkgname} ${ARGN} QUIET CONFIG + GLOBAL # Forbid the use of system libs entirely NO_DEFAULT_PATH PATHS ${CMAKE_PREFIX_PATH} @@ -20,17 +21,21 @@ function(find_package2 pkgname) list(APPEND targets ${lib}) endif() endforeach() - set(${key}_TARGET "${targets}" CACHE STRING "") - set(${pkgname}_TARGET "${targets}" CACHE STRING "") - set(${key}_LIBRARIES "${${pkgname}_LIBRARIES}" CACHE STRING "") - set(${key}_LIBRARY "${${pkgname}_LIBRARIES}" CACHE STRING "") - set(${key}_INCLUDE_DIR "${${pkgname}_INCLUDE_DIR}" CACHE STRING "") - set(${key}_INCLUDE_DIRS "${${pkgname}_INCLUDE_DIRS}" CACHE STRING "") + # Add upper-case variables set(${key}_DEFINITIONS "${${pkgname}_DEFINITIONS}" CACHE STRING "") set(${key}_FOUND ${${pkgname}_FOUND} CACHE BOOL "") - set(${pkgname}_VERSION ${${pkgname}_VERSION_STRING} CACHE BOOL "") + set(${key}_INCLUDE_DIR "${${pkgname}_INCLUDE_DIR}" CACHE STRING "") + set(${key}_INCLUDE_DIRS "${${pkgname}_INCLUDE_DIRS}" CACHE STRING "") + set(${key}_LIBRARIES "${${pkgname}_LIBRARIES}" CACHE STRING "") + set(${key}_LIBRARY "${${pkgname}_LIBRARIES}" CACHE STRING "") + set(${key}_TARGET "${targets}" CACHE STRING "") set(${key}_VERSION ${${pkgname}_VERSION} CACHE BOOL "") + # Add as cache vars for global visibility + set(${pkgname}_FOUND ${${pkgname}_FOUND} CACHE BOOL "") + set(${pkgname}_TARGET "${targets}" CACHE STRING "") + set(${pkgname}_VERSION ${${pkgname}_VERSION_STRING} CACHE BOOL "") + message(STATUS "Found ${pkgname}: ${${pkgname}_FOUND}") message(STATUS " ${key}_TARGET: ${${key}_TARGET}") message(STATUS " ${key}_LIBRARIES: ${${key}_LIBRARIES}") diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 9427afc8ce584..811c5887553af 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -9,11 +9,11 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" patches: - "3.8.0": - - patch_file: "patches/3.8.0/0-replace-find-package.patch" + "3.8.1": + - patch_file: "patches/3.8.1/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.8.0/1-fix-recursive-targets.patch" + - patch_file: "patches/3.8.1/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" "3.7.3": diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index f7bc51b197744..8735bedede45b 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -156,7 +156,9 @@ class GdalConan(ConanFile): def export_sources(self): copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) export_conandata_patches(self) - copy(self, "ConanFindPackage.cmake", src=os.path.join(self.recipe_folder, "cmake"), dst=self.export_sources_folder) + copy(self, "*.cmake", + src=os.path.join(self.recipe_folder, "cmake"), + dst=os.path.join(self.export_sources_folder, "src", "cmake", "helpers")) def config_options(self): if self.settings.os == "Windows": @@ -345,9 +347,6 @@ def generate(self): tc.cache_variables["BUILD_APPS"] = self.options.tools tc.cache_variables["BUILD_TESTING"] = False - tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata - tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree - tc.cache_variables["GDAL_USE_ARCHIVE"] = self.options.with_libarchive tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow @@ -439,6 +438,16 @@ def generate(self): tc.cache_variables["GDAL_USE_ZLIB"] = True tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd + + # https://github.com/OSGeo/gdal/blob/v3.8.1/cmake/modules/packages/FindSQLite3.cmake + if self.options.with_sqlite3: + tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata + tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree + tc.cache_variables["SQLite3_HAS_LOAD_EXTENSION"] = not self.dependencies["sqlite3"].options.omit_load_extension + tc.cache_variables["SQLite3_HAS_PROGRESS_HANDLER"] = True + tc.cache_variables["SQLite3_HAS_MUTEX_ALLOC"] = True + tc.preprocessor_definitions["SQLite3_HAS_COLUMN_METADATA"] = 1 if self.dependencies["sqlite3"].options.enable_column_metadata else 0 + tc.preprocessor_definitions["SQLite3_HAS_RTREE"] = 1 if self.dependencies["sqlite3"].options.enable_rtree else 0 # https://github.com/OSGeo/gdal/blob/v3.8.0/cmake/helpers/CheckDependentLibraries.cmake#L419-L450 tc.cache_variables["HAVE_JPEGTURBO_DUAL_MODE_8_12"] = ( self.options.with_jpeg == "libjpeg-turbo" and @@ -576,6 +585,9 @@ def generate(self): "libjxl::jxl_threads": "JXL_THREADS::JXL_THREADS", "libjpeg": "JPEG::JPEG", "libjpeg-turbo::jpeg": "JPEG::JPEG", + "libkml::kmldom": "LIBKML::DOM", + "libkml::kmlengine": "LIBKML::ENGINE", + "libkml": "LIBKML::LibKML", "librasterlite2": "RASTERLITE2::RASTERLITE2", "libspatialite": "SPATIALITE::SPATIALITE", "libwebp": "WEBP::WebP", @@ -602,9 +614,6 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - copy(self, "ConanFindPackage.cmake", - src=self.export_sources_folder, - dst=os.path.join(self.source_folder, "cmake", "helpers")) # Fix Deflate::Deflate not being correctly propagated internally. replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), "PRIVATE Deflate::Deflate", diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch index a17686e020af0..f006440e8da58 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch @@ -46,10 +46,9 @@ diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDe cmake_dependent_option(GDAL_USE_RASTERLITE2 "Set ON to use Rasterlite2" ON HAVE_RASTERLITE2 OFF) -find_package(LibKML COMPONENTS DOM ENGINE) -+find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) ++find_package2(LibKML COMPONENTS DOM ENGINE) if (GDAL_USE_LIBKML) -- if (NOT LibKML_FOUND) -+ if (FALSE) + if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") endif () endif () diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch index 3df39bda78985..e25f0d63223d9 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/0-replace-find-package.patch @@ -42,36 +42,18 @@ diff -urN ./a/cmake/helpers/CheckDependentLibraries.cmake ./b/cmake/helpers/Chec get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") -@@ -527,6 +526,16 @@ - gdal_check_package(SQLite3 "Enable SQLite3 support (used by SQLite/Spatialite, GPKG, Rasterlite, MBTiles, etc.)" - CAN_DISABLE RECOMMENDED) - if (SQLite3_FOUND) -+ set(CMAKE_REQUIRED_INCLUDES ${SQLite3_INCLUDE_DIRS}) -+ check_symbol_exists(sqlite3_mutex_alloc sqlite3ext.h SQLite3_HAS_MUTEX_ALLOC) -+ check_symbol_exists(sqlite3_column_table_name sqlite3ext.h SQLite3_HAS_COLUMN_METADATA) -+ check_symbol_exists(sqlite3_rtree_query_callback sqlite3.h SQLite3_HAS_RTREE) -+ check_symbol_exists(sqlite3_load_extension sqlite3ext.h SQLite3_HAS_LOAD_EXTENSION) -+ # https://www.sqlite.org/compile.html recommends to build with -DSQLITE_OMIT_PROGRESS_CALLBACK -+ # "for applications that are able to use them"... This is sometimes wrongly -+ # understood as recommended in all situations. -+ check_symbol_exists(sqlite3_progress_handler sqlite3.h SQLite3_HAS_PROGRESS_HANDLER) -+ - if (NOT DEFINED SQLite3_HAS_COLUMN_METADATA) - message(FATAL_ERROR "missing SQLite3_HAS_COLUMN_METADATA") - endif () -@@ -566,9 +575,9 @@ +@@ -566,9 +565,9 @@ gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE) gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE) -find_package(LibKML COMPONENTS DOM ENGINE) -+find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) ++find_package2(LibKML COMPONENTS DOM ENGINE) if (GDAL_USE_LIBKML) -- if (NOT LibKML_FOUND) -+ if (FALSE) + if (NOT LibKML_FOUND) message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") endif () endif () -@@ -733,7 +742,7 @@ +@@ -733,7 +732,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) # OpenJPEG's cmake-CONFIG is broken, so call module explicitly diff --git a/recipes/gdal/post_3.5.0/patches/3.8.0/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.8.1/0-replace-find-package.patch similarity index 52% rename from recipes/gdal/post_3.5.0/patches/3.8.0/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.8.1/0-replace-find-package.patch index f3bd7f40faeb8..c82d659742baf 100644 --- a/recipes/gdal/post_3.5.0/patches/3.8.0/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.8.1/0-replace-find-package.patch @@ -17,7 +17,7 @@ - find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency) - else() + find_package2(${name} QUIET) -+ if (FALSE) ++ if(FALSE) set(_find_package_args) if (_GCP_VERSION) list(APPEND _find_package_args ${_GCP_VERSION}) @@ -41,36 +41,7 @@ get_target_property(include_dirs json-c::json-c INTERFACE_INCLUDE_DIRECTORIES) find_path(GDAL_JSON_INCLUDE_DIR NAMES json.h PATHS ${include_dirs} PATH_SUFFIXES json-c NO_DEFAULT_PATH) list(APPEND include_dirs "${GDAL_JSON_INCLUDE_DIR}") -@@ -527,6 +526,16 @@ - gdal_check_package(SQLite3 "Enable SQLite3 support (used by SQLite/Spatialite, GPKG, Rasterlite, MBTiles, etc.)" - CAN_DISABLE RECOMMENDED) - if (SQLite3_FOUND) -+ set(CMAKE_REQUIRED_INCLUDES ${SQLite3_INCLUDE_DIRS}) -+ check_symbol_exists(sqlite3_mutex_alloc sqlite3ext.h SQLite3_HAS_MUTEX_ALLOC) -+ check_symbol_exists(sqlite3_column_table_name sqlite3ext.h SQLite3_HAS_COLUMN_METADATA) -+ check_symbol_exists(sqlite3_rtree_query_callback sqlite3.h SQLite3_HAS_RTREE) -+ check_symbol_exists(sqlite3_load_extension sqlite3ext.h SQLite3_HAS_LOAD_EXTENSION) -+ # https://www.sqlite.org/compile.html recommends to build with -DSQLITE_OMIT_PROGRESS_CALLBACK -+ # "for applications that are able to use them"... This is sometimes wrongly -+ # understood as recommended in all situations. -+ check_symbol_exists(sqlite3_progress_handler sqlite3.h SQLite3_HAS_PROGRESS_HANDLER) -+ - if (NOT DEFINED SQLite3_HAS_COLUMN_METADATA) - message(FATAL_ERROR "missing SQLite3_HAS_COLUMN_METADATA") - endif () -@@ -566,9 +575,9 @@ - gdal_check_package(SPATIALITE "Enable spatialite support for sqlite3" VERSION 4.1.2 CAN_DISABLE) - gdal_check_package(RASTERLITE2 "Enable RasterLite2 support for sqlite3" VERSION 1.1.0 CAN_DISABLE) - --find_package(LibKML COMPONENTS DOM ENGINE) -+find_package2(LibKML COMPONENTS kmlengine kmldom kmlbase) - if (GDAL_USE_LIBKML) -- if (NOT LibKML_FOUND) -+ if (FALSE) - message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") - endif () - endif () -@@ -736,7 +745,7 @@ +@@ -727,7 +726,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) # OpenJPEG's cmake-CONFIG is broken, so call module explicitly diff --git a/recipes/gdal/post_3.5.0/patches/3.8.0/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.8.1/1-fix-recursive-targets.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.8.0/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.8.1/1-fix-recursive-targets.patch From ea1e8c7e1725f373853cd8298466b4af4e26ff8b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 15 Dec 2023 16:23:49 +0200 Subject: [PATCH 071/105] gdal: disable libiconv on macOS --- recipes/gdal/post_3.5.0/conanfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 8735bedede45b..bb49587654b6e 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -2,6 +2,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file from conan.tools.microsoft import is_msvc @@ -163,6 +164,12 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + if is_apple_os(self): + # FIXME: compilation fails on macOS due to difference in ICONV_CONST value in iconv() signature + # https://github.com/conan-io/conan-center-index/pull/19298#issuecomment-1840433415 + # https://github.com/roboticslibrary/libiconv/blob/v1.17/include/iconv.h.in#L82 + # https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html + self.options.with_libiconv = False def configure(self): if self.options.shared: From 4c3b93307c79ead475f4936b921bb29259f66717 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 15 Dec 2023 16:24:33 +0200 Subject: [PATCH 072/105] gdal: drop ineffective libjpeg-turbo propagation --- recipes/gdal/post_3.5.0/conanfile.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index bb49587654b6e..9e74728c1009d 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -175,12 +175,6 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") - self.options["hdf4"].jpegturbo = self.options.with_jpeg == "libjpeg-turbo" - self.options["libtiff"].jpeg = self.options.with_jpeg - # TODO: add libjpeg options to poppler and podofo recipes - # self.options["poppler"].with_libjpeg = self.options.with_jpeg - # self.options["podofo"].with_libjpeg = self.options.with_jpeg - def layout(self): cmake_layout(self, src_folder="src") From 4d7ac57768ce6b99b7e6c811f2e93fc4d2a3e39a Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 15 Dec 2023 16:25:51 +0200 Subject: [PATCH 073/105] gdal: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 9e74728c1009d..5564a3f9996c6 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -222,7 +222,7 @@ def requirements(self): if self.options.with_hdf4: self.requires("hdf4/4.2.15") if self.options.with_hdf5: - self.requires("hdf5/1.14.2") + self.requires("hdf5/1.14.3") if self.options.with_heif: self.requires("libheif/1.16.2") if self.options.with_jpeg == "libjpeg": @@ -294,7 +294,7 @@ def requirements(self): if self.options.with_xerces: self.requires("xerces-c/3.2.4") if self.options.with_xml2: - self.requires("libxml2/2.11.5") + self.requires("libxml2/2.12.2") if self.options.with_zstd: self.requires("zstd/1.5.5") # Use of external shapelib is not recommended and is currently broken. From b50986f36693b40cf7d580a750e8a773b10a993b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 15 Dec 2023 16:30:48 +0200 Subject: [PATCH 074/105] gdal: add parquet support --- recipes/gdal/post_3.5.0/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 5564a3f9996c6..dfb51c2e409b9 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -413,7 +413,7 @@ def generate(self): tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl tc.cache_variables["GDAL_USE_ORACLE"] = False - tc.cache_variables["GDAL_USE_PARQUET"] = False + tc.cache_variables["GDAL_USE_PARQUET"] = self.options.with_arrow tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 tc.cache_variables["GDAL_USE_PDFIUM"] = False # self.options.with_pdfium @@ -533,7 +533,6 @@ def generate(self): "openjpeg": "OpenJPEG", "openssl": "OpenSSL", # "oracle": "Oracle", - # "parquet": "Parquet", "pcre": "PCRE", "pcre2": "PCRE2", "pdfium": "PDFIUM", @@ -563,7 +562,8 @@ def generate(self): deps.set_property(conan_name, "cmake_file_name", cmake_name) renamed_targets = { - "arrow": "Arrow::arrow_shared", + "arrow::libarrow": "Arrow::arrow_shared", + "arrow::libparquet": "Parquet::parquet_shared", "brunsli::brunslidec-c": "BRUNSLI::DECODE", "brunsli::brunslienc-c": "BRUNSLI::ENCODE", "c-blosc": "Blosc::Blosc", From 91020b797c48d94908e4cd152535a074ca7e26ea Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 15 Dec 2023 16:39:22 +0200 Subject: [PATCH 075/105] gdal: avoid the use of cache_variables --- recipes/gdal/post_3.5.0/conanfile.py | 218 +++++++++++++-------------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index dfb51c2e409b9..b2e0ae784a599 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -339,133 +339,133 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) - tc.cache_variables["GDAL_SET_INSTALL_RELATIVE_RPATH"] = True - - tc.cache_variables["BUILD_JAVA_BINDINGS"] = False - tc.cache_variables["BUILD_CSHARP_BINDINGS"] = False - tc.cache_variables["BUILD_PYTHON_BINDINGS"] = False - tc.cache_variables["BUILD_APPS"] = self.options.tools - tc.cache_variables["BUILD_TESTING"] = False - - tc.cache_variables["GDAL_USE_ARCHIVE"] = self.options.with_libarchive - tc.cache_variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo - tc.cache_variables["GDAL_USE_ARROW"] = self.options.with_arrow - tc.cache_variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow - tc.cache_variables["GDAL_USE_BASISU"] = self.options.with_basisu - tc.cache_variables["GDAL_USE_BLOSC"] = self.options.with_blosc - tc.cache_variables["GDAL_USE_BRUNSLI"] = self.options.with_brunsli - tc.cache_variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio - tc.cache_variables["GDAL_USE_CRNLIB"] = self.options.with_dds - tc.cache_variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp - tc.cache_variables["GDAL_USE_CURL"] = self.options.with_curl - tc.cache_variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate - tc.cache_variables["GDAL_USE_ECW"] = self.options.with_ecw - tc.cache_variables["GDAL_USE_EXPAT"] = self.options.with_expat - tc.cache_variables["GDAL_USE_FILEGDB"] = False - tc.cache_variables["GDAL_USE_FREEXL"] = self.options.with_freexl - tc.cache_variables["GDAL_USE_FYBA"] = False - tc.cache_variables["GDAL_USE_GEOS"] = self.options.with_geos - tc.cache_variables["GDAL_USE_GEOTIFF"] = True - tc.cache_variables["GDAL_USE_GEOTIFF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_GIF"] = self.options.with_gif - tc.cache_variables["GDAL_USE_GIF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_GTA"] = self.options.with_gta - tc.cache_variables["GDAL_USE_HDF4"] = self.options.with_hdf4 - tc.cache_variables["GDAL_USE_HDF5"] = self.options.with_hdf5 - tc.cache_variables["GDAL_USE_HDFS"] = False - tc.cache_variables["GDAL_USE_HEIF"] = self.options.with_heif - tc.cache_variables["GDAL_USE_ICONV"] = self.options.with_libiconv - tc.cache_variables["GDAL_USE_IDB"] = False - tc.cache_variables["GDAL_USE_JPEG"] = bool(self.options.with_jpeg) - tc.cache_variables["GDAL_USE_JPEG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JPEG12_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JSONC"] = True - tc.cache_variables["GDAL_USE_JSONC_INTERNAL"] = False - tc.cache_variables["GDAL_USE_JXL"] = self.options.with_jxl - tc.cache_variables["GDAL_USE_JXL_THREADS"] = self.options.with_jxl - tc.cache_variables["GDAL_USE_KDU"] = False - tc.cache_variables["GDAL_USE_KEA"] = self.options.with_kea - tc.cache_variables["GDAL_USE_LERC"] = self.options.with_lerc - tc.cache_variables["GDAL_USE_LERC_INTERNAL"] = False - tc.cache_variables["GDAL_USE_LIBCSF"] = False - tc.cache_variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf - tc.cache_variables["GDAL_USE_LIBKML"] = self.options.with_libkml - tc.cache_variables["GDAL_USE_LIBLZMA"] = self.options.with_lzma - tc.cache_variables["GDAL_USE_LIBQB3"] = False - tc.cache_variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 - tc.cache_variables["GDAL_USE_LURATECH"] = False - tc.cache_variables["GDAL_USE_LZ4"] = self.options.with_lz4 - tc.cache_variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx - tc.cache_variables["GDAL_USE_MRSID"] = False - tc.cache_variables["GDAL_USE_MSSQL_NCLI"] = False - tc.cache_variables["GDAL_USE_MSSQL_ODBC"] = False - tc.cache_variables["GDAL_USE_MYSQL"] = bool(self.options.with_mysql) - tc.cache_variables["GDAL_USE_NETCDF"] = self.options.with_netcdf - tc.cache_variables["GDAL_USE_ODBC"] = self.options.with_odbc - tc.cache_variables["GDAL_USE_ODBCCPP"] = False - tc.cache_variables["GDAL_USE_OGDI"] = False - tc.cache_variables["GDAL_USE_OPENCAD"] = False - tc.cache_variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad - tc.cache_variables["GDAL_USE_OPENCL"] = False - tc.cache_variables["GDAL_USE_OPENEXR"] = self.options.with_exr - tc.cache_variables["GDAL_USE_OPENCL"] = self.options.with_opencl - tc.cache_variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg - tc.cache_variables["GDAL_USE_OPENSSL"] = self.options.with_openssl - tc.cache_variables["GDAL_USE_ORACLE"] = False - tc.cache_variables["GDAL_USE_PARQUET"] = self.options.with_arrow - tc.cache_variables["GDAL_USE_PCRE"] = self.options.with_pcre - tc.cache_variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 - tc.cache_variables["GDAL_USE_PDFIUM"] = False # self.options.with_pdfium - tc.cache_variables["GDAL_USE_PNG"] = self.options.with_png - tc.cache_variables["GDAL_USE_PNG_INTERNAL"] = False - tc.cache_variables["GDAL_USE_PODOFO"] = self.options.with_podofo - tc.cache_variables["GDAL_USE_POPPLER"] = self.options.with_poppler - tc.cache_variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg - tc.cache_variables["GDAL_USE_PUBLICDECOMPWT"] = self.options.with_publicdecompwt - tc.cache_variables["GDAL_USE_QHULL"] = self.options.with_qhull - tc.cache_variables["GDAL_USE_QHULL_INTERNAL"] = False - tc.cache_variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 - tc.cache_variables["GDAL_USE_SFCGAL"] = False - tc.cache_variables["GDAL_USE_SHAPELIB"] = False - tc.cache_variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib - tc.cache_variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite - tc.cache_variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 - tc.cache_variables["GDAL_USE_TEIGHA"] = False - tc.cache_variables["GDAL_USE_TIFF_INTERNAL"] = False - tc.cache_variables["GDAL_USE_TILEDB"] = self.options.with_tiledb - tc.cache_variables["GDAL_USE_WEBP"] = self.options.with_webp - tc.cache_variables["GDAL_USE_XERCESC"] = self.options.with_xerces - tc.cache_variables["GDAL_USE_ZLIB"] = True - tc.cache_variables["GDAL_USE_ZLIB_INTERNAL"] = False - tc.cache_variables["GDAL_USE_ZSTD"] = self.options.with_zstd + tc.variables["GDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.variables["GDAL_SET_INSTALL_RELATIVE_RPATH"] = True + + tc.variables["BUILD_JAVA_BINDINGS"] = False + tc.variables["BUILD_CSHARP_BINDINGS"] = False + tc.variables["BUILD_PYTHON_BINDINGS"] = False + tc.variables["BUILD_APPS"] = self.options.tools + tc.variables["BUILD_TESTING"] = False + + tc.variables["GDAL_USE_ARCHIVE"] = self.options.with_libarchive + tc.variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo + tc.variables["GDAL_USE_ARROW"] = self.options.with_arrow + tc.variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow + tc.variables["GDAL_USE_BASISU"] = self.options.with_basisu + tc.variables["GDAL_USE_BLOSC"] = self.options.with_blosc + tc.variables["GDAL_USE_BRUNSLI"] = self.options.with_brunsli + tc.variables["GDAL_USE_CFITSIO"] = self.options.with_cfitsio + tc.variables["GDAL_USE_CRNLIB"] = self.options.with_dds + tc.variables["GDAL_USE_CRYPTOPP"] = self.options.with_cryptopp + tc.variables["GDAL_USE_CURL"] = self.options.with_curl + tc.variables["GDAL_USE_DEFLATE"] = self.options.with_libdeflate + tc.variables["GDAL_USE_ECW"] = self.options.with_ecw + tc.variables["GDAL_USE_EXPAT"] = self.options.with_expat + tc.variables["GDAL_USE_FILEGDB"] = False + tc.variables["GDAL_USE_FREEXL"] = self.options.with_freexl + tc.variables["GDAL_USE_FYBA"] = False + tc.variables["GDAL_USE_GEOS"] = self.options.with_geos + tc.variables["GDAL_USE_GEOTIFF"] = True + tc.variables["GDAL_USE_GEOTIFF_INTERNAL"] = False + tc.variables["GDAL_USE_GIF"] = self.options.with_gif + tc.variables["GDAL_USE_GIF_INTERNAL"] = False + tc.variables["GDAL_USE_GTA"] = self.options.with_gta + tc.variables["GDAL_USE_HDF4"] = self.options.with_hdf4 + tc.variables["GDAL_USE_HDF5"] = self.options.with_hdf5 + tc.variables["GDAL_USE_HDFS"] = False + tc.variables["GDAL_USE_HEIF"] = self.options.with_heif + tc.variables["GDAL_USE_ICONV"] = self.options.with_libiconv + tc.variables["GDAL_USE_IDB"] = False + tc.variables["GDAL_USE_JPEG"] = bool(self.options.with_jpeg) + tc.variables["GDAL_USE_JPEG_INTERNAL"] = False + tc.variables["GDAL_USE_JPEG12_INTERNAL"] = False + tc.variables["GDAL_USE_JSONC"] = True + tc.variables["GDAL_USE_JSONC_INTERNAL"] = False + tc.variables["GDAL_USE_JXL"] = self.options.with_jxl + tc.variables["GDAL_USE_JXL_THREADS"] = self.options.with_jxl + tc.variables["GDAL_USE_KDU"] = False + tc.variables["GDAL_USE_KEA"] = self.options.with_kea + tc.variables["GDAL_USE_LERC"] = self.options.with_lerc + tc.variables["GDAL_USE_LERC_INTERNAL"] = False + tc.variables["GDAL_USE_LIBCSF"] = False + tc.variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf + tc.variables["GDAL_USE_LIBKML"] = self.options.with_libkml + tc.variables["GDAL_USE_LIBLZMA"] = self.options.with_lzma + tc.variables["GDAL_USE_LIBQB3"] = False + tc.variables["GDAL_USE_LIBXML2"] = self.options.with_xml2 + tc.variables["GDAL_USE_LURATECH"] = False + tc.variables["GDAL_USE_LZ4"] = self.options.with_lz4 + tc.variables["GDAL_USE_MONGOCXX"] = self.options.with_mongocxx + tc.variables["GDAL_USE_MRSID"] = False + tc.variables["GDAL_USE_MSSQL_NCLI"] = False + tc.variables["GDAL_USE_MSSQL_ODBC"] = False + tc.variables["GDAL_USE_MYSQL"] = bool(self.options.with_mysql) + tc.variables["GDAL_USE_NETCDF"] = self.options.with_netcdf + tc.variables["GDAL_USE_ODBC"] = self.options.with_odbc + tc.variables["GDAL_USE_ODBCCPP"] = False + tc.variables["GDAL_USE_OGDI"] = False + tc.variables["GDAL_USE_OPENCAD"] = False + tc.variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad + tc.variables["GDAL_USE_OPENCL"] = False + tc.variables["GDAL_USE_OPENEXR"] = self.options.with_exr + tc.variables["GDAL_USE_OPENCL"] = self.options.with_opencl + tc.variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg + tc.variables["GDAL_USE_OPENSSL"] = self.options.with_openssl + tc.variables["GDAL_USE_ORACLE"] = False + tc.variables["GDAL_USE_PARQUET"] = self.options.with_arrow + tc.variables["GDAL_USE_PCRE"] = self.options.with_pcre + tc.variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 + tc.variables["GDAL_USE_PDFIUM"] = False # self.options.with_pdfium + tc.variables["GDAL_USE_PNG"] = self.options.with_png + tc.variables["GDAL_USE_PNG_INTERNAL"] = False + tc.variables["GDAL_USE_PODOFO"] = self.options.with_podofo + tc.variables["GDAL_USE_POPPLER"] = self.options.with_poppler + tc.variables["GDAL_USE_POSTGRESQL"] = self.options.with_pg + tc.variables["GDAL_USE_PUBLICDECOMPWT"] = self.options.with_publicdecompwt + tc.variables["GDAL_USE_QHULL"] = self.options.with_qhull + tc.variables["GDAL_USE_QHULL_INTERNAL"] = False + tc.variables["GDAL_USE_RASTERLITE2"] = self.options.with_rasterlite2 + tc.variables["GDAL_USE_SFCGAL"] = False + tc.variables["GDAL_USE_SHAPELIB"] = False + tc.variables["GDAL_USE_SHAPELIB_INTERNAL"] = self.options.with_shapelib + tc.variables["GDAL_USE_SPATIALITE"] = self.options.with_spatialite + tc.variables["GDAL_USE_SQLITE3"] = self.options.with_sqlite3 + tc.variables["GDAL_USE_TEIGHA"] = False + tc.variables["GDAL_USE_TIFF_INTERNAL"] = False + tc.variables["GDAL_USE_TILEDB"] = self.options.with_tiledb + tc.variables["GDAL_USE_WEBP"] = self.options.with_webp + tc.variables["GDAL_USE_XERCESC"] = self.options.with_xerces + tc.variables["GDAL_USE_ZLIB"] = True + tc.variables["GDAL_USE_ZLIB_INTERNAL"] = False + tc.variables["GDAL_USE_ZSTD"] = self.options.with_zstd # https://github.com/OSGeo/gdal/blob/v3.8.1/cmake/modules/packages/FindSQLite3.cmake if self.options.with_sqlite3: - tc.cache_variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata - tc.cache_variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree - tc.cache_variables["SQLite3_HAS_LOAD_EXTENSION"] = not self.dependencies["sqlite3"].options.omit_load_extension - tc.cache_variables["SQLite3_HAS_PROGRESS_HANDLER"] = True - tc.cache_variables["SQLite3_HAS_MUTEX_ALLOC"] = True + tc.variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata + tc.variables["SQLite3_HAS_RTREE"] = self.dependencies["sqlite3"].options.enable_rtree + tc.variables["SQLite3_HAS_LOAD_EXTENSION"] = not self.dependencies["sqlite3"].options.omit_load_extension + tc.variables["SQLite3_HAS_PROGRESS_HANDLER"] = True + tc.variables["SQLite3_HAS_MUTEX_ALLOC"] = True tc.preprocessor_definitions["SQLite3_HAS_COLUMN_METADATA"] = 1 if self.dependencies["sqlite3"].options.enable_column_metadata else 0 tc.preprocessor_definitions["SQLite3_HAS_RTREE"] = 1 if self.dependencies["sqlite3"].options.enable_rtree else 0 # https://github.com/OSGeo/gdal/blob/v3.8.0/cmake/helpers/CheckDependentLibraries.cmake#L419-L450 - tc.cache_variables["HAVE_JPEGTURBO_DUAL_MODE_8_12"] = ( + tc.variables["HAVE_JPEGTURBO_DUAL_MODE_8_12"] = ( self.options.with_jpeg == "libjpeg-turbo" and bool(self.dependencies["libjpeg-turbo"].options.get_safe("enable12bit")) ) # https://github.com/OSGeo/gdal/blob/v3.8.0/port/CMakeLists.txt - tc.cache_variables["BLOSC_HAS_BLOSC_CBUFFER_VALIDATE"] = ( + tc.variables["BLOSC_HAS_BLOSC_CBUFFER_VALIDATE"] = ( self.options.with_blosc and Version(self.dependencies["c-blosc"].ref.version) >= "1.21.5" ) # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf5/CMakeLists.txt#L61-L64 - tc.cache_variables["GDAL_ENABLE_HDF5_GLOBAL_LOCK"] = ( + tc.variables["GDAL_ENABLE_HDF5_GLOBAL_LOCK"] = ( self.options.with_hdf5 and bool(self.dependencies["hdf5"].options.get_safe("threadsafe")) ) # https://github.com/OSGeo/gdal/blob/v3.8.0/frmts/hdf4/CMakeLists.txt#L28-L46 - tc.cache_variables["HDF4_HAS_MAXOPENFILES"] = ( + tc.variables["HDF4_HAS_MAXOPENFILES"] = ( self.options.with_hdf4 and Version(self.dependencies["hdf4"].ref.version) >= "4.2.5" ) From 88f00d4ddf06073754d04f5bcb6720dc36ba52a0 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 15 Dec 2023 16:52:02 +0200 Subject: [PATCH 076/105] gdal: configure ArrowDataset correctly --- recipes/gdal/post_3.5.0/conanfile.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index b2e0ae784a599..fca05ace9d101 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -93,7 +93,7 @@ class GdalConan(ConanFile): "fPIC": True, "tools": False, "with_armadillo": False, - "with_arrow": False, + "with_arrow": True, "with_basisu": False, "with_blosc": False, "with_brunsli": False, @@ -351,7 +351,7 @@ def generate(self): tc.variables["GDAL_USE_ARCHIVE"] = self.options.with_libarchive tc.variables["GDAL_USE_ARMADILLO"] = self.options.with_armadillo tc.variables["GDAL_USE_ARROW"] = self.options.with_arrow - tc.variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow + tc.variables["GDAL_USE_ARROWDATASET"] = self.options.with_arrow and self.dependencies["arrow"].options.dataset_modules tc.variables["GDAL_USE_BASISU"] = self.options.with_basisu tc.variables["GDAL_USE_BLOSC"] = self.options.with_blosc tc.variables["GDAL_USE_BRUNSLI"] = self.options.with_brunsli @@ -413,7 +413,7 @@ def generate(self): tc.variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg tc.variables["GDAL_USE_OPENSSL"] = self.options.with_openssl tc.variables["GDAL_USE_ORACLE"] = False - tc.variables["GDAL_USE_PARQUET"] = self.options.with_arrow + tc.variables["GDAL_USE_PARQUET"] = self.options.with_arrow and self.dependencies["arrow"].options.parquet tc.variables["GDAL_USE_PCRE"] = self.options.with_pcre tc.variables["GDAL_USE_PCRE2"] = self.options.with_pcre2 tc.variables["GDAL_USE_PDFIUM"] = False # self.options.with_pdfium @@ -440,6 +440,9 @@ def generate(self): tc.variables["GDAL_USE_ZLIB_INTERNAL"] = False tc.variables["GDAL_USE_ZSTD"] = self.options.with_zstd + tc.variables["Parquet_FOUND"] = self.options.with_arrow and self.dependencies["arrow"].options.parquet + tc.variables["ArrowDataset_FOUND"] = self.options.with_arrow and self.dependencies["arrow"].options.dataset_modules + # https://github.com/OSGeo/gdal/blob/v3.8.1/cmake/modules/packages/FindSQLite3.cmake if self.options.with_sqlite3: tc.variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata @@ -563,6 +566,7 @@ def generate(self): renamed_targets = { "arrow::libarrow": "Arrow::arrow_shared", + "arrow::dataset": "ArrowDataset::arrow_dataset_shared", "arrow::libparquet": "Parquet::parquet_shared", "brunsli::brunslidec-c": "BRUNSLI::DECODE", "brunsli::brunslienc-c": "BRUNSLI::ENCODE", @@ -619,9 +623,14 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "port", "CMakeLists.txt"), "PRIVATE Deflate::Deflate", "PUBLIC Deflate::Deflate") - # JXL_THREADS is provided under the JXL package in Conan. + # Workaround for JXL_THREADS being provided by the JXL package on CCI. replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), "JXL_THREADS", "JXL", strict=False) + # Workaround for Parquet and ArrowDataset being provided by Arrow on CCI. + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "gdal_check_package(Parquet", "# gdal_check_package(Parquet") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "gdal_check_package(ArrowDataset", "# gdal_check_package(ArrowDataset") def build(self): self._patch_sources() @@ -664,6 +673,10 @@ def package_info(self): self.cpp_info.requires.extend(["armadillo::armadillo"]) if self.options.with_arrow: self.cpp_info.requires.extend(["arrow::libarrow"]) + if self.dependencies["arrow"].options.parquet: + self.cpp_info.requires.extend(["arrow::libparquet"]) + if self.dependencies["arrow"].options.dataset_modules: + self.cpp_info.requires.extend(["arrow::dataset"]) if self.options.with_basisu: self.cpp_info.requires.extend(["libbasisu::libbasisu"]) if self.options.with_brunsli: From b85abd0d1a4c4e9591f69c2d9cf12c77adc39462 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 19 Dec 2023 14:18:15 +0200 Subject: [PATCH 077/105] gdal: fix ArrowDataset support by version --- recipes/gdal/post_3.5.0/conanfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index fca05ace9d101..58cdb9481d313 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -629,8 +629,9 @@ def _patch_sources(self): # Workaround for Parquet and ArrowDataset being provided by Arrow on CCI. replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), "gdal_check_package(Parquet", "# gdal_check_package(Parquet") - replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), - "gdal_check_package(ArrowDataset", "# gdal_check_package(ArrowDataset") + if Version(self.version) >= "3.6.0": + replace_in_file(self, os.path.join(self.source_folder, "cmake", "helpers", "CheckDependentLibraries.cmake"), + "gdal_check_package(ArrowDataset", "# gdal_check_package(ArrowDataset") def build(self): self._patch_sources() From b572d4321c09c7c883d921d63c48058d48737cf7 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 19 Dec 2023 15:23:34 +0200 Subject: [PATCH 078/105] gdal: fix arrow target name on 3.5 --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 58cdb9481d313..ddd32289e47d4 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -565,7 +565,7 @@ def generate(self): deps.set_property(conan_name, "cmake_file_name", cmake_name) renamed_targets = { - "arrow::libarrow": "Arrow::arrow_shared", + "arrow::libarrow": "Arrow::arrow_shared" if Version(self.version) >= "3.7" else "arrow_shared", "arrow::dataset": "ArrowDataset::arrow_dataset_shared", "arrow::libparquet": "Parquet::parquet_shared", "brunsli::brunslidec-c": "BRUNSLI::DECODE", From 6e4cda43e2daffba2f7d6e7a833ac178411c8e7c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 19 Dec 2023 16:02:44 +0200 Subject: [PATCH 079/105] gdal: disable arrow for v3.5 --- recipes/gdal/post_3.5.0/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index ddd32289e47d4..1e76545b79563 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -170,6 +170,9 @@ def config_options(self): # https://github.com/roboticslibrary/libiconv/blob/v1.17/include/iconv.h.in#L82 # https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html self.options.with_libiconv = False + if Version(self.version) < "3.7": + # Latest versions of Arrow are no longer compatible with GDAL 3.5 + self.options.with_arrow = False def configure(self): if self.options.shared: From 1f0057dc7c4c028a7379598458950261dd9d581e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 20 Dec 2023 18:52:00 +0200 Subject: [PATCH 080/105] gdal: bump to v3.8.2 --- recipes/gdal/config.yml | 2 +- recipes/gdal/post_3.5.0/conandata.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index 8ebbfbfbe73d1..c74bb7934f3f6 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,5 +1,5 @@ versions: - "3.8.1": + "3.8.2": folder: "post_3.5.0" "3.7.3": folder: "post_3.5.0" diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 811c5887553af..f2e109ba97303 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,7 +1,7 @@ sources: - "3.8.1": - url: "https://github.com/OSGeo/gdal/releases/download/v3.8.1/gdal-3.8.1.tar.gz" - sha256: "75b0019c8f47bb5f1c2be2182340fc2f45ab1c684204c2aa4971d6127d819f2d" + "3.8.2": + url: "https://github.com/OSGeo/gdal/releases/download/v3.8.2/gdal-3.8.2.tar.gz" + sha256: "e914690d2694671d75bab15b451a42c2f115d7267a5b600eb361e94b58a089d6" "3.7.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" @@ -9,7 +9,7 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" patches: - "3.8.1": + "3.8.2": - patch_file: "patches/3.8.1/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" From 1fbd9afe8092c7b8afa37f331abd2523d6b07292 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 20 Dec 2023 18:53:29 +0200 Subject: [PATCH 081/105] gdal: bump arrow --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 1e76545b79563..56b7faa5c9f73 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -192,7 +192,7 @@ def requirements(self): if self.options.with_armadillo: self.requires("armadillo/12.6.4") if self.options.with_arrow: - self.requires("arrow/14.0.1") + self.requires("arrow/14.0.2") if self.options.with_basisu: self.requires("libbasisu/1.15.0") if self.options.with_blosc: From 4c389255129e0eda7fd4b3ddff60e0c641583fee Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 20 Dec 2023 19:10:54 +0200 Subject: [PATCH 082/105] gdal: further mark proprietary deps as such --- recipes/gdal/post_3.5.0/conanfile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 56b7faa5c9f73..f6c9009cd3ee6 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -481,6 +481,7 @@ def generate(self): jsonc.cpp_info.includedirs.append(os.path.join(jsonc.package_folder, "include", "json-c")) deps = CMakeDeps(self) + # https://gdal.org/development/building_from_source.html#cmake-package-dependent-options # Based on `grep -hPIR '(gdal_check_package|find_package2)\(' ~/.conan2/p/b/gdal*/b/src/cmake | sort -u` conan_to_cmake_pkg_name = { "armadillo": "Armadillo", @@ -527,8 +528,6 @@ def generate(self): "lz4": "LZ4", "mariadb-connector-c": "MySQL", "mongo-cxx-driver": "MONGOCXX", - # "mssql_ncli": "MSSQL_NCLI", - # "mssql_odbc": "MSSQL_ODBC", "netcdf": "NetCDF", "odbc": "ODBC", # "odbccpp": "ODBCCPP", @@ -538,7 +537,6 @@ def generate(self): "openexr": "OpenEXR", "openjpeg": "OpenJPEG", "openssl": "OpenSSL", - # "oracle": "Oracle", "pcre": "PCRE", "pcre2": "PCRE2", "pdfium": "PDFIUM", @@ -560,6 +558,9 @@ def generate(self): # "kdu": "KDU", # "luratech": "LURATECH", # "mrsid": "MRSID", + # "mssql_ncli": "MSSQL_NCLI", + # "mssql_odbc": "MSSQL_ODBC", + # "oracle": "Oracle", # "rdb": "rdb", # "teigha": "TEIGHA", } From 3a1d2c6d0528058c141533148cc5c494d6909f9e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 20 Dec 2023 19:39:41 +0200 Subject: [PATCH 083/105] gdal: add libaec support --- recipes/gdal/post_3.5.0/conanfile.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index f6c9009cd3ee6..368b923fd5e0d 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -51,6 +51,7 @@ class GdalConan(ConanFile): "with_jxl": [True, False], "with_kea": [True, False], "with_lerc": [True, False], + "with_libaec": [True, False], "with_libarchive": [True, False], "with_libcsf": [True, False], "with_libdeflate": [True, False], @@ -116,6 +117,7 @@ class GdalConan(ConanFile): "with_jxl": False, "with_kea": False, "with_lerc": True, + "with_libaec": False, "with_libarchive": False, "with_libcsf": True, "with_libdeflate": True, @@ -173,6 +175,8 @@ def config_options(self): if Version(self.version) < "3.7": # Latest versions of Arrow are no longer compatible with GDAL 3.5 self.options.with_arrow = False + if Version(self.version) < "3.8": + del self.options.with_libaec def configure(self): if self.options.shared: @@ -238,6 +242,8 @@ def requirements(self): self.requires("kealib/1.4.14") if self.options.with_lerc: self.requires("lerc/4.0.1") + if self.options.get_safe("with_libaec"): + self.requires("libaec/1.0.6") if self.options.with_libarchive: self.requires("libarchive/3.7.2") if self.options.with_libdeflate: @@ -391,6 +397,7 @@ def generate(self): tc.variables["GDAL_USE_KEA"] = self.options.with_kea tc.variables["GDAL_USE_LERC"] = self.options.with_lerc tc.variables["GDAL_USE_LERC_INTERNAL"] = False + tc.variables["GDAL_USE_LIBAEC"] = self.options.get_safe("with_libaec", False) tc.variables["GDAL_USE_LIBCSF"] = False tc.variables["GDAL_USE_LIBCSF_INTERNAL"] = self.options.with_libcsf tc.variables["GDAL_USE_LIBKML"] = self.options.with_libkml @@ -502,6 +509,7 @@ def generate(self): "json-c": "JSONC", "kealib": "KEA", "lerc": "LERC", + "libaec": "LIBAEC", "libarchive": "ARCHIVE", "libbasisu": "basisu", # "libcsf": "LIBCSF", @@ -584,6 +592,7 @@ def generate(self): "hdfs": "HDFS::HDFS", "kealib": "KEA::KEA", "lerc": "LERC::LERC", + "libaec": "LIBAEC::LIBAEC", "libarchive": "ARCHIVE::ARCHIVE", "libbasisu": "basisu::basisu_lib", "libdeflate": "Deflate::Deflate", @@ -722,6 +731,8 @@ def package_info(self): self.cpp_info.requires.extend(["kealib::kealib"]) if self.options.with_lerc: self.cpp_info.requires.extend(["lerc::lerc"]) + if self.options.get_safe("with_libaec"): + self.cpp_info.requires.extend(["libaec::libaec"]) if self.options.with_libarchive: self.cpp_info.requires.extend(["libarchive::libarchive"]) if self.options.with_libdeflate: From 0d1c374a6f2fd16180deb81c253d0e0f6b2ee045 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 1 Jan 2024 21:31:13 +0200 Subject: [PATCH 084/105] gdal: bump proj Co-authored-by: Matthieu Darbois --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 368b923fd5e0d..5dfc31a62f299 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -189,7 +189,7 @@ def requirements(self): self.requires("json-c/0.17") self.requires("libgeotiff/1.7.1") self.requires("libtiff/4.6.0") - self.requires("proj/9.3.0") + self.requires("proj/9.3.1") # Used in a public header here: # https://github.com/OSGeo/gdal/blob/v3.7.1/port/cpl_minizip_ioapi.h#L26 self.requires("zlib/[>=1.2.11 <2]", transitive_headers=True, transitive_libs=True) From 2207075e72c1d275fef5fb85725e0543bcae4c53 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 2 Jan 2024 08:12:57 +0200 Subject: [PATCH 085/105] gdal: add a workaround for iconv() incompatibilities --- recipes/gdal/post_3.5.0/conandata.yml | 9 +++++++ .../patches/3.5.3/3-iconv-compatibility.patch | 24 +++++++++++++++++++ .../patches/3.7.3/3-iconv-compatibility.patch | 24 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch create mode 100644 recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index f2e109ba97303..e400f3c706003 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -16,6 +16,9 @@ patches: - patch_file: "patches/3.8.1/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" + - patch_file: "patches/3.7.3/3-iconv-compatibility.patch" + patch_description: "Fix iconv() signature incompatibility on some platforms" + patch_type: "portability" "3.7.3": - patch_file: "patches/3.7.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" @@ -23,6 +26,9 @@ patches: - patch_file: "patches/3.7.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" + - patch_file: "patches/3.7.3/3-iconv-compatibility.patch" + patch_description: "Fix iconv() signature incompatibility on some platforms" + patch_type: "portability" "3.5.3": - patch_file: "patches/3.5.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" @@ -30,3 +36,6 @@ patches: - patch_file: "patches/3.5.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" + - patch_file: "patches/3.5.3/3-iconv-compatibility.patch" + patch_description: "Fix iconv() signature incompatibility on some platforms" + patch_type: "portability" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch new file mode 100644 index 0000000000000..f17c526810ac8 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch @@ -0,0 +1,24 @@ +Workaround for iconv() signature differences on different platforms. +https://github.com/bnoordhuis/libiconv/blob/master/include/iconv.h.in#L83 +https://github.com/OSGeo/gdal/issues/7472 + +--- port/cpl_recode_iconv.cpp ++++ port/cpl_recode_iconv.cpp +@@ -121,7 +121,7 @@ + while( nSrcLen > 0 ) + { + size_t nConverted = +- iconv( sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen ); ++ iconv( sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen ); + + if( nConverted == static_cast(-1) ) + { +@@ -286,7 +286,7 @@ + while( nSrcLen > 0 ) + { + const size_t nConverted = +- iconv( sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen ); ++ iconv( sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen ); + + if( nConverted == static_cast(-1) ) + { diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch new file mode 100644 index 0000000000000..0adc847e347bc --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch @@ -0,0 +1,24 @@ +Workaround for iconv() signature differences on different platforms. +https://github.com/bnoordhuis/libiconv/blob/master/include/iconv.h.in#L83 +https://github.com/OSGeo/gdal/issues/7472 + +--- port/cpl_recode_iconv.cpp ++++ port/cpl_recode_iconv.cpp +@@ -146,7 +146,7 @@ + while (nSrcLen > 0) + { + size_t nConverted = +- iconv(sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen); ++ iconv(sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen); + + if (nConverted == static_cast(-1)) + { +@@ -315,7 +315,7 @@ + while (nSrcLen > 0) + { + const size_t nConverted = +- iconv(sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen); ++ iconv(sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen); + + if (nConverted == static_cast(-1)) + { From 37e113dea0a3f6e138153baa1f007c4023f6cd09 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 08:16:44 +0200 Subject: [PATCH 086/105] gdal: fix v3.5.3 URL and related patch --- recipes/gdal/post_3.5.0/conandata.yml | 4 ++-- .../patches/3.5.3/1-fix-recursive-targets.patch | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index e400f3c706003..eff147722745f 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -6,8 +6,8 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" "3.5.3": - url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" - sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.3/gdal-3.5.3.tar.gz" + sha256: "a9ea0300d17e35bab71df4f16e62bb2fb8081caf994ab3ee0502ce4cf0d4e593" patches: "3.8.2": - patch_file: "patches/3.8.1/0-replace-find-package.patch" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch index 41a5c1ce7e58a..08ad40e836e9e 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch @@ -27,10 +27,10 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) if (_res) target_include_directories(${_TARGET} PRIVATE ${_res}) -@@ -247,6 +247,10 @@ - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_COMPILE_OPTIONS) +@@ -251,6 +251,10 @@ + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) if (_res) - target_compile_options(${_TARGET} PRIVATE ${_res}) + gdal_target_interfaces(${_TARGET} ${_res}) + endif () + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) + if (_res) @@ -38,7 +38,7 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -276,14 +280,12 @@ +@@ -280,15 +284,13 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) @@ -55,3 +55,4 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp + target_link_libraries(${ARGV}) endif () endfunction() + From 2a2e3929b303925a6c4ebc0bd51a526a1fa9e2cc Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 08:20:22 +0200 Subject: [PATCH 087/105] gdal: re-enable libiconv for apple-clang --- recipes/gdal/post_3.5.0/conanfile.py | 6 ------ .../post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch | 3 ++- .../post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch | 3 ++- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 5dfc31a62f299..175280b543314 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -166,12 +166,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if is_apple_os(self): - # FIXME: compilation fails on macOS due to difference in ICONV_CONST value in iconv() signature - # https://github.com/conan-io/conan-center-index/pull/19298#issuecomment-1840433415 - # https://github.com/roboticslibrary/libiconv/blob/v1.17/include/iconv.h.in#L82 - # https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html - self.options.with_libiconv = False if Version(self.version) < "3.7": # Latest versions of Arrow are no longer compatible with GDAL 3.5 self.options.with_arrow = False diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch index f17c526810ac8..f45cdd84625da 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch @@ -1,6 +1,7 @@ -Workaround for iconv() signature differences on different platforms. +Workaround for iconv() signature differing on MSVC and apple-clang. https://github.com/bnoordhuis/libiconv/blob/master/include/iconv.h.in#L83 https://github.com/OSGeo/gdal/issues/7472 +https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html --- port/cpl_recode_iconv.cpp +++ port/cpl_recode_iconv.cpp diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch index 0adc847e347bc..9fb5d147f5770 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch @@ -1,6 +1,7 @@ -Workaround for iconv() signature differences on different platforms. +Workaround for iconv() signature differing on MSVC and apple-clang. https://github.com/bnoordhuis/libiconv/blob/master/include/iconv.h.in#L83 https://github.com/OSGeo/gdal/issues/7472 +https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html --- port/cpl_recode_iconv.cpp +++ port/cpl_recode_iconv.cpp From 85454b7f951dd75a671050259e4ae080a2e7dd52 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 08:22:03 +0200 Subject: [PATCH 088/105] gdal: add short comments for deprecated options --- recipes/gdal/post_3.5.0/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 175280b543314..8617baa21007f 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -57,7 +57,7 @@ class GdalConan(ConanFile): "with_libdeflate": [True, False], "with_libiconv": [True, False], "with_libkml": [True, False], - "with_libtiff": ["deprecated", True, False], + "with_libtiff": ["deprecated", True, False], # always enabled "with_lzma": [True, False], "with_lz4": [True, False], "with_mongocxx": [True, False], @@ -75,7 +75,7 @@ class GdalConan(ConanFile): "with_png": [True, False], "with_podofo": [True, False], "with_poppler": [True, False], - "with_proj": ["deprecated", True, False], + "with_proj": ["deprecated", True, False], # always enabled "with_publicdecompwt": [True, False], "with_qhull": [True, False], "with_rasterlite2": [True, False], @@ -86,7 +86,7 @@ class GdalConan(ConanFile): "with_webp": [True, False], "with_xerces": [True, False], "with_xml2": [True, False], - "with_zlib": ["deprecated", True, False], + "with_zlib": ["deprecated", True, False], # always enabled "with_zstd": [True, False], } default_options = { From f5e7e9c2136b8e5ad13e3cb82768f9c51777d8b4 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 08:58:37 +0200 Subject: [PATCH 089/105] gdal: libiconv patches can be avoided --- recipes/gdal/post_3.5.0/conandata.yml | 9 ------- recipes/gdal/post_3.5.0/conanfile.py | 4 +++ .../patches/3.5.3/3-iconv-compatibility.patch | 25 ------------------- .../patches/3.7.3/3-iconv-compatibility.patch | 25 ------------------- 4 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch delete mode 100644 recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index eff147722745f..97d96343a9f74 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -16,9 +16,6 @@ patches: - patch_file: "patches/3.8.1/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" - - patch_file: "patches/3.7.3/3-iconv-compatibility.patch" - patch_description: "Fix iconv() signature incompatibility on some platforms" - patch_type: "portability" "3.7.3": - patch_file: "patches/3.7.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" @@ -26,9 +23,6 @@ patches: - patch_file: "patches/3.7.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" - - patch_file: "patches/3.7.3/3-iconv-compatibility.patch" - patch_description: "Fix iconv() signature incompatibility on some platforms" - patch_type: "portability" "3.5.3": - patch_file: "patches/3.5.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" @@ -36,6 +30,3 @@ patches: - patch_file: "patches/3.5.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" - - patch_file: "patches/3.5.3/3-iconv-compatibility.patch" - patch_description: "Fix iconv() signature incompatibility on some platforms" - patch_type: "portability" diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 8617baa21007f..326f4584d295a 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -476,6 +476,10 @@ def generate(self): self.options.with_hdf4 and Version(self.dependencies["hdf4"].ref.version) >= "4.2.5" ) + # https://github.com/OSGeo/gdal/blob/4bb78aab3ae9ab5433042bc27239d1555cbe272e/cmake/helpers/CheckDependentLibraries.cmake#L301-L318 + # The detection fails for some reason + # Setting it to non-const is compatible with all platforms + tc.variables["_ICONV_SECOND_ARGUMENT_IS_NOT_CONST"] = True tc.generate() jsonc = self.dependencies["json-c"] diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch deleted file mode 100644 index f45cdd84625da..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.5.3/3-iconv-compatibility.patch +++ /dev/null @@ -1,25 +0,0 @@ -Workaround for iconv() signature differing on MSVC and apple-clang. -https://github.com/bnoordhuis/libiconv/blob/master/include/iconv.h.in#L83 -https://github.com/OSGeo/gdal/issues/7472 -https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html - ---- port/cpl_recode_iconv.cpp -+++ port/cpl_recode_iconv.cpp -@@ -121,7 +121,7 @@ - while( nSrcLen > 0 ) - { - size_t nConverted = -- iconv( sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen ); -+ iconv( sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen ); - - if( nConverted == static_cast(-1) ) - { -@@ -286,7 +286,7 @@ - while( nSrcLen > 0 ) - { - const size_t nConverted = -- iconv( sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen ); -+ iconv( sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen ); - - if( nConverted == static_cast(-1) ) - { diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch deleted file mode 100644 index 9fb5d147f5770..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/3-iconv-compatibility.patch +++ /dev/null @@ -1,25 +0,0 @@ -Workaround for iconv() signature differing on MSVC and apple-clang. -https://github.com/bnoordhuis/libiconv/blob/master/include/iconv.h.in#L83 -https://github.com/OSGeo/gdal/issues/7472 -https://lists.gnu.org/archive/html/bug-gnu-libiconv/2008-07/msg00005.html - ---- port/cpl_recode_iconv.cpp -+++ port/cpl_recode_iconv.cpp -@@ -146,7 +146,7 @@ - while (nSrcLen > 0) - { - size_t nConverted = -- iconv(sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen); -+ iconv(sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen); - - if (nConverted == static_cast(-1)) - { -@@ -315,7 +315,7 @@ - while (nSrcLen > 0) - { - const size_t nConverted = -- iconv(sConv, &pszSrcBuf, &nSrcLen, &pszDstBuf, &nDstLen); -+ iconv(sConv, const_cast(&pszSrcBuf), &nSrcLen, &pszDstBuf, &nDstLen); - - if (nConverted == static_cast(-1)) - { From d48d3e034cfcf9a057ce40469e3665b60b89a50b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 09:24:17 +0200 Subject: [PATCH 090/105] gdal: revert 3.5.3 to v3.5.2 due to patching issues --- recipes/gdal/config.yml | 2 +- recipes/gdal/post_3.5.0/conandata.yml | 12 ++++++------ .../{3.5.3 => 3.5.2}/0-replace-find-package.patch | 0 .../{3.5.3 => 3.5.2}/1-fix-recursive-targets.patch | 9 ++++----- 4 files changed, 11 insertions(+), 12 deletions(-) rename recipes/gdal/post_3.5.0/patches/{3.5.3 => 3.5.2}/0-replace-find-package.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.5.3 => 3.5.2}/1-fix-recursive-targets.patch (94%) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index c74bb7934f3f6..01db639a62b28 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -3,7 +3,7 @@ versions: folder: "post_3.5.0" "3.7.3": folder: "post_3.5.0" - "3.5.3": + "3.5.2": folder: "post_3.5.0" "3.4.3": folder: "pre_3.5.0" diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 97d96343a9f74..4031b01312765 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -5,9 +5,9 @@ sources: "3.7.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" - "3.5.3": - url: "https://github.com/OSGeo/gdal/releases/download/v3.5.3/gdal-3.5.3.tar.gz" - sha256: "a9ea0300d17e35bab71df4f16e62bb2fb8081caf994ab3ee0502ce4cf0d4e593" + "3.5.2": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" + sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" patches: "3.8.2": - patch_file: "patches/3.8.1/0-replace-find-package.patch" @@ -23,10 +23,10 @@ patches: - patch_file: "patches/3.7.3/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" - "3.5.3": - - patch_file: "patches/3.5.3/0-replace-find-package.patch" + "3.5.2": + - patch_file: "patches/3.5.2/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.5.3/1-fix-recursive-targets.patch" + - patch_file: "patches/3.5.2/1-fix-recursive-targets.patch" patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch similarity index 94% rename from recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch index 08ad40e836e9e..41a5c1ce7e58a 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.3/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch @@ -27,10 +27,10 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) if (_res) target_include_directories(${_TARGET} PRIVATE ${_res}) -@@ -251,6 +251,10 @@ - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) +@@ -247,6 +247,10 @@ + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_COMPILE_OPTIONS) if (_res) - gdal_target_interfaces(${_TARGET} ${_res}) + target_compile_options(${_TARGET} PRIVATE ${_res}) + endif () + get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) + if (_res) @@ -38,7 +38,7 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -280,15 +284,13 @@ +@@ -276,14 +280,12 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) @@ -55,4 +55,3 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp + target_link_libraries(${ARGV}) endif () endfunction() - From c66c8508ebb45572645e8be9ada9d02dde9efa50 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 09:37:36 +0200 Subject: [PATCH 091/105] gdal: split two unrelated patches --- recipes/gdal/post_3.5.0/conandata.yml | 21 ++++-- .../1-do-not-force-private-linking.patch | 20 ++++++ ... => 2-allow-cycles-in-cmake-targets.patch} | 17 ----- .../1-do-not-force-private-linking.patch | 23 ++++++ ... => 2-allow-cycles-in-cmake-targets.patch} | 20 ------ .../3.8.1/1-fix-recursive-targets.patch | 70 ------------------- 6 files changed, 58 insertions(+), 113 deletions(-) create mode 100644 recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch rename recipes/gdal/post_3.5.0/patches/3.5.2/{1-fix-recursive-targets.patch => 2-allow-cycles-in-cmake-targets.patch} (70%) create mode 100644 recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch rename recipes/gdal/post_3.5.0/patches/3.7.3/{1-fix-recursive-targets.patch => 2-allow-cycles-in-cmake-targets.patch} (73%) delete mode 100644 recipes/gdal/post_3.5.0/patches/3.8.1/1-fix-recursive-targets.patch diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 4031b01312765..8747ec88ceaa4 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -13,20 +13,29 @@ patches: - patch_file: "patches/3.8.1/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.8.1/1-fix-recursive-targets.patch" - patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" + - patch_file: "patches/3.7.3/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.7.3/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" patch_type: "conan" "3.7.3": - patch_file: "patches/3.7.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.7.3/1-fix-recursive-targets.patch" - patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" + - patch_file: "patches/3.7.3/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.7.3/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" patch_type: "conan" "3.5.2": - patch_file: "patches/3.5.2/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.5.2/1-fix-recursive-targets.patch" - patch_description: "Fix CMake failure due to recursive CMakeDeps Conan targets" + - patch_file: "patches/3.5.2/1-do-not-force-private-linking.patch" + patch_description: "Fix private linking not working for some Conan dependencies" + patch_type: "conan" + - patch_file: "patches/3.5.2/2-allow-cycles-in-cmake-targets.patch" + patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch new file mode 100644 index 0000000000000..af9ea12ae44d4 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch @@ -0,0 +1,20 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -276,14 +276,12 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) +- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") +- endif () + is_plugin(RES ${target}) + if (RES) + target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) + endif () + endfunction() diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch similarity index 70% rename from recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch index 41a5c1ce7e58a..c8059d6bd2075 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch @@ -38,20 +38,3 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -276,14 +280,12 @@ - set(_oneValueArgs) - set(_multiValueArgs PRIVATE) - cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) -- if (NOT _DRIVER_PRIVATE) -- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") -- endif () - is_plugin(RES ${target}) - if (RES) - target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) - else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) - gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) -+ target_link_libraries(${ARGV}) - endif () - endfunction() diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch new file mode 100644 index 0000000000000..9581a397f7631 --- /dev/null +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch @@ -0,0 +1,23 @@ +diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake +--- a/cmake/helpers/GdalDriverHelper.cmake ++++ b/cmake/helpers/GdalDriverHelper.cmake +@@ -280,9 +280,6 @@ + set(_oneValueArgs) + set(_multiValueArgs PRIVATE) + cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) +- if (NOT _DRIVER_PRIVATE) +- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") +- endif () + is_plugin(RES ${target}) + if (RES) + target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) +@@ -295,7 +292,8 @@ + endif() + endforeach() + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) ++ target_link_libraries(${ARGV}) + endif () + diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch similarity index 73% rename from recipes/gdal/post_3.5.0/patches/3.7.3/1-fix-recursive-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch index 478850c9c335e..4fb759309ce3c 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/1-fix-recursive-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch @@ -48,23 +48,3 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () -@@ -280,9 +280,6 @@ - set(_oneValueArgs) - set(_multiValueArgs PRIVATE) - cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) -- if (NOT _DRIVER_PRIVATE) -- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") -- endif () - is_plugin(RES ${target}) - if (RES) - target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) -@@ -295,7 +292,8 @@ - endif() - endforeach() - else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) - gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) -+ target_link_libraries(${ARGV}) - endif () - diff --git a/recipes/gdal/post_3.5.0/patches/3.8.1/1-fix-recursive-targets.patch b/recipes/gdal/post_3.5.0/patches/3.8.1/1-fix-recursive-targets.patch deleted file mode 100644 index 478850c9c335e..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.8.1/1-fix-recursive-targets.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake ---- a/cmake/helpers/GdalGenerateConfig.cmake -+++ b/cmake/helpers/GdalGenerateConfig.cmake -@@ -44,6 +44,10 @@ - elseif(_lib STREQUAL "general") - continue() - endif() -+ if(_lib IN_LIST _seen) -+ continue() -+ endif() -+ list(APPEND _seen "${_lib}") - gdal_resolve_link_genex(_lib "${_lib}") - if(_lib) - list(APPEND _libs "${_lib}") -@@ -64,7 +68,10 @@ - while(_input MATCHES "^(.*)\\\$<([^:>]*):*([^>]*)>") - set(_match "${CMAKE_MATCH_0}") - set(_first "${CMAKE_MATCH_1}") -- gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") -+ if(NOT _first IN_LIST _genex_seen) -+ gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") -+ endif() -+ list(APPEND _genex_seen "${_first}") - string(REPLACE "${_match}" "${_first}${_second}" _input "${_input}") - endwhile() - set("${_result}" "${_input}" PARENT_SCOPE) -diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake ---- a/cmake/helpers/GdalDriverHelper.cmake -+++ b/cmake/helpers/GdalDriverHelper.cmake -@@ -233,9 +233,9 @@ - endif () - endfunction() - --function(gdal_target_interfaces _TARGET) -+function(gdal_target_interfaces _TARGET _seen_libs) - foreach (_LIB IN ITEMS ${ARGN}) -- if (TARGET ${_LIB}) -+ if (TARGET ${_LIB} AND NOT ${_LIB} IN_LIST _seen_libs) - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - if (_res) - target_include_directories(${_TARGET} PRIVATE ${_res}) -@@ -250,7 +250,7 @@ - endif () - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) - if (_res) -- gdal_target_interfaces(${_TARGET} ${_res}) -+ gdal_target_interfaces(${_TARGET} "${_seen_libs};${ARGN}" ${_res}) - endif () - endif () - endforeach () -@@ -280,9 +280,6 @@ - set(_oneValueArgs) - set(_multiValueArgs PRIVATE) - cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) -- if (NOT _DRIVER_PRIVATE) -- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") -- endif () - is_plugin(RES ${target}) - if (RES) - target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) -@@ -295,7 +292,8 @@ - endif() - endforeach() - else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) - gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) -+ target_link_libraries(${ARGV}) - endif () - From 033ef9d8b62a592e3de492b7ff7d351688407499 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 14:17:00 +0200 Subject: [PATCH 092/105] gdal: fix mistake in patch splitting --- .../3.5.2/1-do-not-force-private-linking.patch | 14 +++++++------- .../3.5.2/2-allow-cycles-in-cmake-targets.patch | 7 +++++++ .../3.7.3/1-do-not-force-private-linking.patch | 17 +++++++---------- .../3.7.3/2-allow-cycles-in-cmake-targets.patch | 10 ++++++++-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch index af9ea12ae44d4..350b4a9d71fdb 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch @@ -1,20 +1,20 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake --- a/cmake/helpers/GdalDriverHelper.cmake +++ b/cmake/helpers/GdalDriverHelper.cmake -@@ -276,14 +276,12 @@ +@@ -276,7 +276,7 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) - if (NOT _DRIVER_PRIVATE) -- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") -- endif () ++ if (FALSE AND NOT _DRIVER_PRIVATE) + message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") + endif () is_plugin(RES ${target}) - if (RES) - target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) +@@ -285,6 +285,7 @@ else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) + target_link_libraries(${ARGV}) endif () endfunction() + diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch index c8059d6bd2075..5ee3de3ff1125 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch @@ -38,3 +38,10 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () +@@ -283,5 +287,5 @@ + if (RES) + target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch index 9581a397f7631..d5b761df32ded 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/1-do-not-force-private-linking.patch @@ -1,23 +1,20 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake --- a/cmake/helpers/GdalDriverHelper.cmake +++ b/cmake/helpers/GdalDriverHelper.cmake -@@ -280,9 +280,6 @@ +@@ -280,7 +280,7 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) - if (NOT _DRIVER_PRIVATE) -- message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") -- endif () ++ if (FALSE AND NOT _DRIVER_PRIVATE) + message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") + endif () is_plugin(RES ${target}) - if (RES) - target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) -@@ -295,7 +292,8 @@ - endif() - endforeach() +@@ -297,6 +297,7 @@ else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) + target_link_libraries(${ARGV}) endif () + # For debugging purposes diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch index 4fb759309ce3c..3b784b345a53c 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch @@ -5,10 +5,10 @@ diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerate elseif(_lib STREQUAL "general") continue() endif() -+ if(_lib IN_LIST _seen) ++ if(_lib IN_LIST _seen_libs) + continue() + endif() -+ list(APPEND _seen "${_lib}") ++ list(APPEND _seen_libs "${_lib}") gdal_resolve_link_genex(_lib "${_lib}") if(_lib) list(APPEND _libs "${_lib}") @@ -48,3 +48,9 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp endif () endif () endforeach () +@@ -296,4 +296,4 @@ + endforeach() + else () +- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) ++ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) + gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) From 4c7392305002cf0e540194038a7b3146c3f5645c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 5 Jan 2024 11:51:18 +0200 Subject: [PATCH 093/105] gdal: prevent the use of system libs better --- recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake | 7 ++++++- recipes/gdal/post_3.5.0/conanfile.py | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake index f4fa6c66600fb..cc5455d748073 100644 --- a/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake +++ b/recipes/gdal/post_3.5.0/cmake/ConanFindPackage.cmake @@ -5,6 +5,12 @@ function(find_package2 pkgname) list(REMOVE_ITEM ARGN OUT_DEPENDENCY _find_dependency) # Force CONFIG mode list(REMOVE_ITEM ARGN MODULE NO_CONFIG NO_MODULE) + string(TOUPPER ${pkgname} key) + if(DEFINED GDAL_USE_${key} AND NOT GDAL_USE_${key}) + set(${pkgname}_FOUND) + set(${key}_FOUND) + return() + endif() find_package(${pkgname} ${ARGN} QUIET CONFIG @@ -14,7 +20,6 @@ function(find_package2 pkgname) PATHS ${CMAKE_PREFIX_PATH} ) # Add variables with upper-case package name in addition to the default ones - string(TOUPPER ${pkgname} key) set(targets "") foreach(lib ${${pkgname}_LIBRARIES}) if(TARGET ${lib}) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 326f4584d295a..e2dc9c1a7a751 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -411,9 +411,8 @@ def generate(self): tc.variables["GDAL_USE_OGDI"] = False tc.variables["GDAL_USE_OPENCAD"] = False tc.variables["GDAL_USE_OPENCAD_INTERNAL"] = self.options.with_opencad - tc.variables["GDAL_USE_OPENCL"] = False - tc.variables["GDAL_USE_OPENEXR"] = self.options.with_exr tc.variables["GDAL_USE_OPENCL"] = self.options.with_opencl + tc.variables["GDAL_USE_OPENEXR"] = self.options.with_exr tc.variables["GDAL_USE_OPENJPEG"] = self.options.with_openjpeg tc.variables["GDAL_USE_OPENSSL"] = self.options.with_openssl tc.variables["GDAL_USE_ORACLE"] = False From 9b87b5b7d6152823bdd33c1ca99025a3c2af5ca3 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 5 Jan 2024 12:46:50 +0200 Subject: [PATCH 094/105] gdal: simplify 2-allow-cycles-in-cmake-targets.patch --- .../2-allow-cycles-in-cmake-targets.patch | 52 +++------------ .../2-allow-cycles-in-cmake-targets.patch | 64 +++++-------------- 2 files changed, 23 insertions(+), 93 deletions(-) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch index 5ee3de3ff1125..b0b67f7fc638b 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch @@ -1,47 +1,11 @@ diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake --- a/cmake/helpers/GdalGenerateConfig.cmake +++ b/cmake/helpers/GdalGenerateConfig.cmake -@@ -44,6 +44,10 @@ - elseif(_lib STREQUAL "general") - continue() - endif() -+ if(_lib IN_LIST _seen_libs) -+ continue() -+ endif() -+ list(APPEND _seen_libs "${_lib}") - gdal_resolve_link_genex(_lib "${_lib}") - if(_lib) - list(APPEND _libs "${_lib}") -diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake ---- a/cmake/helpers/GdalDriverHelper.cmake -+++ b/cmake/helpers/GdalDriverHelper.cmake -@@ -233,9 +233,9 @@ - endif () - endfunction() - --function(gdal_target_interfaces _TARGET) -+function(gdal_target_interfaces _TARGET _seen_libs) - foreach (_LIB IN ITEMS ${ARGN}) -- if (TARGET ${_LIB}) -+ if (TARGET ${_LIB} AND NOT ${_LIB} IN_LIST _seen_libs) - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - if (_res) - target_include_directories(${_TARGET} PRIVATE ${_res}) -@@ -247,6 +247,10 @@ - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_COMPILE_OPTIONS) - if (_res) - target_compile_options(${_TARGET} PRIVATE ${_res}) -+ endif () -+ get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) -+ if (_res) -+ gdal_target_interfaces(${_TARGET} "${_seen_libs};${ARGN}" ${_res}) - endif () - endif () - endforeach () -@@ -283,5 +287,5 @@ - if (RES) - target_link_libraries(${target} PRIVATE ${_DRIVER_PRIVATE}) - else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) - gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) +@@ -50,6 +50,7 @@ + if(TARGET "${_lib}") + get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES) + get_target_property(_type ${_lib} TYPE) ++ list(REMOVE_ITEM _link_libraries ${_lib}) + if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY") + list(INSERT ARGN 0 ${_link_libraries}) + endif() diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch index 3b784b345a53c..31bc2e5a8587d 100644 --- a/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch +++ b/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch @@ -1,56 +1,22 @@ -diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake ---- a/cmake/helpers/GdalGenerateConfig.cmake -+++ b/cmake/helpers/GdalGenerateConfig.cmake -@@ -44,6 +44,10 @@ - elseif(_lib STREQUAL "general") - continue() - endif() -+ if(_lib IN_LIST _seen_libs) -+ continue() -+ endif() -+ list(APPEND _seen_libs "${_lib}") - gdal_resolve_link_genex(_lib "${_lib}") - if(_lib) - list(APPEND _libs "${_lib}") -@@ -64,7 +68,10 @@ - while(_input MATCHES "^(.*)\\\$<([^:>]*):*([^>]*)>") - set(_match "${CMAKE_MATCH_0}") - set(_first "${CMAKE_MATCH_1}") -- gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") -+ if(NOT _first IN_LIST _genex_seen) -+ gdal_evaluate_link_genex(_second "${CMAKE_MATCH_2}" "${CMAKE_MATCH_3}") -+ endif() -+ list(APPEND _genex_seen "${_first}") - string(REPLACE "${_match}" "${_first}${_second}" _input "${_input}") - endwhile() - set("${_result}" "${_input}" PARENT_SCOPE) diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake --- a/cmake/helpers/GdalDriverHelper.cmake +++ b/cmake/helpers/GdalDriverHelper.cmake -@@ -233,9 +233,9 @@ - endif () - endfunction() - --function(gdal_target_interfaces _TARGET) -+function(gdal_target_interfaces _TARGET _seen_libs) - foreach (_LIB IN ITEMS ${ARGN}) -- if (TARGET ${_LIB}) -+ if (TARGET ${_LIB} AND NOT ${_LIB} IN_LIST _seen_libs) - get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - if (_res) - target_include_directories(${_TARGET} PRIVATE ${_res}) -@@ -250,7 +250,7 @@ +@@ -249,6 +249,7 @@ + target_compile_options(${_TARGET} PRIVATE ${_res}) endif () get_property(_res TARGET ${_LIB} PROPERTY INTERFACE_LINK_LIBRARIES) ++ list(REMOVE_ITEM _res ${_LIB}) if (_res) -- gdal_target_interfaces(${_TARGET} ${_res}) -+ gdal_target_interfaces(${_TARGET} "${_seen_libs};${ARGN}" ${_res}) + gdal_target_interfaces(${_TARGET} ${_res}) endif () - endif () - endforeach () -@@ -296,4 +296,4 @@ - endforeach() - else () -- gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) -+ gdal_target_interfaces(${target} "" ${_DRIVER_PRIVATE}) - gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) +diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake +--- a/cmake/helpers/GdalGenerateConfig.cmake ++++ b/cmake/helpers/GdalGenerateConfig.cmake +@@ -50,6 +50,7 @@ + if(TARGET "${_lib}") + get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES) + get_target_property(_type ${_lib} TYPE) ++ list(REMOVE_ITEM _link_libraries ${_lib}) + if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY") + list(INSERT ARGN 0 ${_link_libraries}) + endif() From a016fb79ebbdf5eef94678c4bafd5c59bfbdd607 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 5 Jan 2024 12:54:49 +0200 Subject: [PATCH 095/105] gdal: bump v3.5.2 -> v3.5.3 --- recipes/gdal/config.yml | 2 +- recipes/gdal/post_3.5.0/conandata.yml | 18 +++++++++--------- .../2-allow-cycles-in-cmake-targets.patch | 11 ----------- .../0-replace-find-package.patch | 0 .../1-do-not-force-private-linking.patch | 4 ++-- .../2-allow-cycles-in-cmake-targets.patch | 0 6 files changed, 12 insertions(+), 23 deletions(-) delete mode 100644 recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch rename recipes/gdal/post_3.5.0/patches/{3.5.2 => 3.5.3}/0-replace-find-package.patch (100%) rename recipes/gdal/post_3.5.0/patches/{3.5.2 => 3.5.3}/1-do-not-force-private-linking.patch (94%) rename recipes/gdal/post_3.5.0/patches/{3.7.3 => 3.5.3}/2-allow-cycles-in-cmake-targets.patch (100%) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index 01db639a62b28..c74bb7934f3f6 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -3,7 +3,7 @@ versions: folder: "post_3.5.0" "3.7.3": folder: "post_3.5.0" - "3.5.2": + "3.5.3": folder: "post_3.5.0" "3.4.3": folder: "pre_3.5.0" diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index 8747ec88ceaa4..ca97258b9d4a6 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -5,9 +5,9 @@ sources: "3.7.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" - "3.5.2": - url: "https://github.com/OSGeo/gdal/releases/download/v3.5.2/gdal-3.5.2.tar.gz" - sha256: "fbd696e1b2a858fbd2eb3718db16b14ed9ba82521d3578770d480c74fe1146d2" + "3.5.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.5.3/gdal-3.5.3.tar.gz" + sha256: "a9ea0300d17e35bab71df4f16e62bb2fb8081caf994ab3ee0502ce4cf0d4e593" patches: "3.8.2": - patch_file: "patches/3.8.1/0-replace-find-package.patch" @@ -16,7 +16,7 @@ patches: - patch_file: "patches/3.7.3/1-do-not-force-private-linking.patch" patch_description: "Fix private linking not working for some Conan dependencies" patch_type: "conan" - - patch_file: "patches/3.7.3/2-allow-cycles-in-cmake-targets.patch" + - patch_file: "patches/3.5.3/2-allow-cycles-in-cmake-targets.patch" patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" patch_type: "conan" "3.7.3": @@ -26,16 +26,16 @@ patches: - patch_file: "patches/3.7.3/1-do-not-force-private-linking.patch" patch_description: "Fix private linking not working for some Conan dependencies" patch_type: "conan" - - patch_file: "patches/3.7.3/2-allow-cycles-in-cmake-targets.patch" + - patch_file: "patches/3.5.3/2-allow-cycles-in-cmake-targets.patch" patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" patch_type: "conan" - "3.5.2": - - patch_file: "patches/3.5.2/0-replace-find-package.patch" + "3.5.3": + - patch_file: "patches/3.5.3/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" - - patch_file: "patches/3.5.2/1-do-not-force-private-linking.patch" + - patch_file: "patches/3.5.3/1-do-not-force-private-linking.patch" patch_description: "Fix private linking not working for some Conan dependencies" patch_type: "conan" - - patch_file: "patches/3.5.2/2-allow-cycles-in-cmake-targets.patch" + - patch_file: "patches/3.5.3/2-allow-cycles-in-cmake-targets.patch" patch_description: "Fix CMake failure due to cyclical dependencies in CMakeDeps targets" patch_type: "conan" diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch deleted file mode 100644 index b0b67f7fc638b..0000000000000 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/2-allow-cycles-in-cmake-targets.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/cmake/helpers/GdalGenerateConfig.cmake b/cmake/helpers/GdalGenerateConfig.cmake ---- a/cmake/helpers/GdalGenerateConfig.cmake -+++ b/cmake/helpers/GdalGenerateConfig.cmake -@@ -50,6 +50,7 @@ - if(TARGET "${_lib}") - get_target_property(_link_libraries ${_lib} INTERFACE_LINK_LIBRARIES) - get_target_property(_type ${_lib} TYPE) -+ list(REMOVE_ITEM _link_libraries ${_lib}) - if(_link_libraries AND NOT TYPE STREQUAL "SHARED_LIBRARY") - list(INSERT ARGN 0 ${_link_libraries}) - endif() diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.5.2/0-replace-find-package.patch rename to recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch diff --git a/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/1-do-not-force-private-linking.patch similarity index 94% rename from recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch rename to recipes/gdal/post_3.5.0/patches/3.5.3/1-do-not-force-private-linking.patch index 350b4a9d71fdb..e45427d007600 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.2/1-do-not-force-private-linking.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/1-do-not-force-private-linking.patch @@ -1,7 +1,7 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelper.cmake --- a/cmake/helpers/GdalDriverHelper.cmake +++ b/cmake/helpers/GdalDriverHelper.cmake -@@ -276,7 +276,7 @@ +@@ -280,7 +280,7 @@ set(_oneValueArgs) set(_multiValueArgs PRIVATE) cmake_parse_arguments(_DRIVER "" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) @@ -10,7 +10,7 @@ diff --git a/cmake/helpers/GdalDriverHelper.cmake b/cmake/helpers/GdalDriverHelp message(FATAL_ERROR "gdal_target_link_libraries(): PRIVATE is a mandatory argument.") endif () is_plugin(RES ${target}) -@@ -285,6 +285,7 @@ +@@ -289,6 +289,7 @@ else () gdal_target_interfaces(${target} ${_DRIVER_PRIVATE}) gdal_add_private_link_libraries(${_DRIVER_PRIVATE}) diff --git a/recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/2-allow-cycles-in-cmake-targets.patch similarity index 100% rename from recipes/gdal/post_3.5.0/patches/3.7.3/2-allow-cycles-in-cmake-targets.patch rename to recipes/gdal/post_3.5.0/patches/3.5.3/2-allow-cycles-in-cmake-targets.patch From f26c947fbc688f40e9bd0f894b19c51b0e0335b6 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Fri, 5 Jan 2024 13:06:25 +0200 Subject: [PATCH 096/105] gdal: drop unused import --- recipes/gdal/post_3.5.0/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index e2dc9c1a7a751..31bb795469aef 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -2,7 +2,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, replace_in_file from conan.tools.microsoft import is_msvc From 450afd73830f5776c46a321bf8c5c31b005b74c7 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 9 Jan 2024 09:00:35 +0200 Subject: [PATCH 097/105] gdal: bump 3.8.2 -> 3.8.3 --- recipes/gdal/config.yml | 2 +- recipes/gdal/post_3.5.0/conandata.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/gdal/config.yml b/recipes/gdal/config.yml index c74bb7934f3f6..a7240af75cc2e 100644 --- a/recipes/gdal/config.yml +++ b/recipes/gdal/config.yml @@ -1,5 +1,5 @@ versions: - "3.8.2": + "3.8.3": folder: "post_3.5.0" "3.7.3": folder: "post_3.5.0" diff --git a/recipes/gdal/post_3.5.0/conandata.yml b/recipes/gdal/post_3.5.0/conandata.yml index ca97258b9d4a6..159958b913d13 100644 --- a/recipes/gdal/post_3.5.0/conandata.yml +++ b/recipes/gdal/post_3.5.0/conandata.yml @@ -1,7 +1,7 @@ sources: - "3.8.2": - url: "https://github.com/OSGeo/gdal/releases/download/v3.8.2/gdal-3.8.2.tar.gz" - sha256: "e914690d2694671d75bab15b451a42c2f115d7267a5b600eb361e94b58a089d6" + "3.8.3": + url: "https://github.com/OSGeo/gdal/releases/download/v3.8.3/gdal-3.8.3.tar.gz" + sha256: "f7a30387a8239e9da26200f787a02136df2ee6473e86b36d05ad682761a049ea" "3.7.3": url: "https://github.com/OSGeo/gdal/releases/download/v3.7.3/gdal-3.7.3.tar.gz" sha256: "f66161e10b8b89a8a541cd760cd36d490114ed3f020a26db1489a6154db5d2be" @@ -9,7 +9,7 @@ sources: url: "https://github.com/OSGeo/gdal/releases/download/v3.5.3/gdal-3.5.3.tar.gz" sha256: "a9ea0300d17e35bab71df4f16e62bb2fb8081caf994ab3ee0502ce4cf0d4e593" patches: - "3.8.2": + "3.8.3": - patch_file: "patches/3.8.1/0-replace-find-package.patch" patch_description: "Use custom version of find_package() for Conan deps" patch_type: "conan" From f6cc7584e9f4c398bc42cd004f913cd01913eca5 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 9 Jan 2024 09:04:18 +0200 Subject: [PATCH 098/105] gdal: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 31bb795469aef..50ad63dc70962 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -197,9 +197,9 @@ def requirements(self): if self.options.with_brunsli: self.requires("brunsli/cci.20231024") if self.options.with_cfitsio: - self.requires("cfitsio/4.3.0") + self.requires("cfitsio/4.3.1") if self.options.with_cryptopp: - self.requires("cryptopp/8.8.0") + self.requires("cryptopp/8.9.0") if self.options.with_curl: self.requires("libcurl/[>=7.78 <9]") if self.options.with_dds: @@ -220,7 +220,7 @@ def requirements(self): if self.options.with_gta: self.requires("libgta/1.2.1") if self.options.with_hdf4: - self.requires("hdf4/4.2.15") + self.requires("hdf4/4.2.16-2") if self.options.with_hdf5: self.requires("hdf5/1.14.3") if self.options.with_heif: @@ -296,13 +296,13 @@ def requirements(self): if self.options.with_xerces: self.requires("xerces-c/3.2.4") if self.options.with_xml2: - self.requires("libxml2/2.12.2") + self.requires("libxml2/2.12.3") if self.options.with_zstd: self.requires("zstd/1.5.5") # Use of external shapelib is not recommended and is currently broken. # https://github.com/OSGeo/gdal/issues/5711 # if self.options.with_shapelib: - # self.requires("shapelib/1.5.0") + # self.requires("shapelib/1.6.0") def build_requirements(self): # https://github.com/conan-io/conan/issues/3482#issuecomment-662284561 From 1d5231799a72bab2e8e42c803c0f1cef1fc19ab3 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 16 Jan 2024 14:53:31 +0200 Subject: [PATCH 099/105] gdal: enable Armadillo --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 50ad63dc70962..89e33d7ae6400 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -92,7 +92,7 @@ class GdalConan(ConanFile): "shared": False, "fPIC": True, "tools": False, - "with_armadillo": False, + "with_armadillo": True, "with_arrow": True, "with_basisu": False, "with_blosc": False, From 1ee20b2c89ad77624aa6e95c4616305d2c39a5b6 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 16 Jan 2024 14:54:56 +0200 Subject: [PATCH 100/105] gdal: bump deps --- recipes/gdal/post_3.5.0/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 89e33d7ae6400..42eee44d7d5b3 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -260,7 +260,7 @@ def requirements(self): if self.options.with_odbc: self.requires("odbc/2.3.11") if self.options.with_opencl: - self.requires("opencl-icd-loader/2023.04.17") + self.requires("opencl-icd-loader/2023.12.14") if self.options.with_openjpeg: self.requires("openjpeg/2.5.0") if self.options.with_openssl: @@ -294,7 +294,7 @@ def requirements(self): if self.options.with_webp: self.requires("libwebp/1.3.2") if self.options.with_xerces: - self.requires("xerces-c/3.2.4") + self.requires("xerces-c/3.2.5") if self.options.with_xml2: self.requires("libxml2/2.12.3") if self.options.with_zstd: From 876a7cc545e29d3ab173bff9fc5421bf43d8cf9c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 16 Jan 2024 15:31:21 +0200 Subject: [PATCH 101/105] gdal: fix a v3.5.3 CMake bug --- .../patches/3.5.3/0-replace-find-package.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch index f006440e8da58..a13e4429270d1 100644 --- a/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch +++ b/recipes/gdal/post_3.5.0/patches/3.5.3/0-replace-find-package.patch @@ -52,6 +52,17 @@ diff --git a/cmake/helpers/CheckDependentLibraries.cmake b/cmake/helpers/CheckDe message(FATAL_ERROR "Configured to use GDAL_USE_LIBKML, but not found") endif () endif () +@@ -540,8 +540,8 @@ + gdal_check_package(MRSID "MrSID raster SDK" CAN_DISABLE) + gdal_check_package(Armadillo "C++ library for linear algebra (used for TPS transformation)" CAN_DISABLE) + if (ARMADILLO_FOUND) +- # On Conda, the armadillo package has no dependency on lapack, but the later is required for successful linking. So +- # try to build & link a test program using Armadillo. ++ # On Conda, the armadillo package has no dependency on lapack, but the later is required for successful linking. So try to build & link a test program using Armadillo. ++ include(CMakePushCheckState) + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_INCLUDES "${ARMADILLO_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_LIBRARIES "${ARMADILLO_LIBRARIES}") @@ -646,7 +646,7 @@ gdal_check_package(HEIF "HEIF >= 1.1" CAN_DISABLE) From c01267da77ef049d5a74d94fe9bd9a69769a66e8 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 25 Jan 2024 10:06:03 +0200 Subject: [PATCH 102/105] gdal: add CMAKE_TRY_COMPILE_CONFIGURATION for try_compile() --- recipes/gdal/post_3.5.0/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 42eee44d7d5b3..24e2604078a0a 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -92,7 +92,7 @@ class GdalConan(ConanFile): "shared": False, "fPIC": True, "tools": False, - "with_armadillo": True, + "with_armadillo": False, "with_arrow": True, "with_basisu": False, "with_blosc": False, @@ -445,6 +445,9 @@ def generate(self): tc.variables["Parquet_FOUND"] = self.options.with_arrow and self.dependencies["arrow"].options.parquet tc.variables["ArrowDataset_FOUND"] = self.options.with_arrow and self.dependencies["arrow"].options.dataset_modules + # General workaround for try_compile() tests in the project + # https://github.com/conan-io/conan/issues/12180 + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = self.settings.build_type # https://github.com/OSGeo/gdal/blob/v3.8.1/cmake/modules/packages/FindSQLite3.cmake if self.options.with_sqlite3: tc.variables["SQLite3_HAS_COLUMN_METADATA"] = self.dependencies["sqlite3"].options.enable_column_metadata From be97efda9829100719193fc0561e269ac90560a6 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 12 Feb 2024 16:58:28 +0100 Subject: [PATCH 103/105] Add deprecation warning message --- recipes/gdal/post_3.5.0/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 24e2604078a0a..6bee73c202bb0 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -316,6 +316,9 @@ def package_id(self): del self.info.options.with_zlib def validate(self): + for option in ["crypto", "zlib", "proj", "libtiff"]: + self.options.get_safe(f"with_{option}") != "deprecated": + self.output.warning(f"{self.ref}:with_{option} option is deprecated. The {option} dependecy is always enabled now.") if self.options.with_pcre and self.options.with_pcre2: raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both") From d47f9855adce7a735426c63763cf0806c738deed Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 12 Feb 2024 16:59:00 +0100 Subject: [PATCH 104/105] Do not set json-c include folder --- recipes/gdal/post_3.5.0/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 6bee73c202bb0..9055660fc05f4 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -486,8 +486,6 @@ def generate(self): tc.variables["_ICONV_SECOND_ARGUMENT_IS_NOT_CONST"] = True tc.generate() - jsonc = self.dependencies["json-c"] - jsonc.cpp_info.includedirs.append(os.path.join(jsonc.package_folder, "include", "json-c")) deps = CMakeDeps(self) # https://gdal.org/development/building_from_source.html#cmake-package-dependent-options From 0ee0384037af2e55762fa22e968a95f2df513c39 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 12 Feb 2024 17:04:47 +0100 Subject: [PATCH 105/105] fix missing if condition --- recipes/gdal/post_3.5.0/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/gdal/post_3.5.0/conanfile.py b/recipes/gdal/post_3.5.0/conanfile.py index 9055660fc05f4..49c2e7d3e5d6e 100644 --- a/recipes/gdal/post_3.5.0/conanfile.py +++ b/recipes/gdal/post_3.5.0/conanfile.py @@ -317,7 +317,7 @@ def package_id(self): def validate(self): for option in ["crypto", "zlib", "proj", "libtiff"]: - self.options.get_safe(f"with_{option}") != "deprecated": + if self.options.get_safe(f"with_{option}") != "deprecated": self.output.warning(f"{self.ref}:with_{option} option is deprecated. The {option} dependecy is always enabled now.") if self.options.with_pcre and self.options.with_pcre2: raise ConanInvalidConfiguration("Enable either pcre or pcre2, not both")