Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proj: add v9.4.0, drop old versions #21512

Merged
merged 14 commits into from
Jun 11, 2024
33 changes: 33 additions & 0 deletions recipes/proj/all/conan_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
macro(custom_find_package name)
find_package(${name} ${ARGN}
# Allow only Conan packages
NO_DEFAULT_PATH
PATHS ${CMAKE_PREFIX_PATH}
)
string(TOUPPER ${name} name_upper)
set(${name_upper}_FOUND TRUE)
set(${name_upper}_VERSION ${${name}_VERSION})
set(${name_upper}_VERSION_STRING ${${name}_VERSION_STRING})
set(${name_upper}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS})
set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR})
set(${name_upper}_LIBRARIES ${${name}_LIBRARIES})
set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS})
unset(name_upper)
endmacro()

custom_find_package(nlohmann_json REQUIRED CONFIG)
link_libraries(nlohmann_json::nlohmann_json)

custom_find_package(SQLite3 REQUIRED CONFIG)
link_libraries(SQLite::SQLite3)

if(ENABLE_TIFF)
custom_find_package(TIFF QUIET CONFIG)
link_libraries(TIFF::TIFF)
endif()

if(ENABLE_CURL)
custom_find_package(CURL QUIET CONFIG)
link_libraries(CURL::libcurl)
endif()

57 changes: 3 additions & 54 deletions recipes/proj/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,15 @@ sources:
"9.1.1":
url: "https://github.com/OSGeo/PROJ/releases/download/9.1.1/proj-9.1.1.tar.gz"
sha256: "003cd4010e52bb5eb8f7de1c143753aa830c8902b6ed01209f294846e40e6d39"
"9.1.0":
url: "https://github.com/OSGeo/PROJ/releases/download/9.1.0/proj-9.1.0.tar.gz"
sha256: "81b2239b94cad0886222cde4f53cb49d34905aad2a1317244a0c30a553db2315"
"9.0.1":
url: "https://github.com/OSGeo/PROJ/releases/download/9.0.1/proj-9.0.1.tar.gz"
sha256: "737eaacbe7906d0d6ff43f0d9ebedc5c734cccc9e6b8d7beefdec3ab22d9a6a3"
"9.0.0":
url: "https://github.com/OSGeo/PROJ/releases/download/9.0.0/proj-9.0.0.tar.gz"
sha256: "0620aa01b812de00b54d6c23e7c5cc843ae2cd129b24fabe411800302172b989"
"8.2.1":
url: "https://github.com/OSGeo/PROJ/releases/download/8.2.1/proj-8.2.1.tar.gz"
sha256: "76ed3d0c3a348a6693dfae535e5658bbfd47f71cb7ff7eb96d9f12f7e068b1cf"
"7.2.1":
url: "https://github.com/OSGeo/PROJ/releases/download/7.2.1/proj-7.2.1.tar.gz"
sha256: "b384f42e5fb9c6d01fe5fa4d31da2e91329668863a684f97be5d4760dbbf0a14"
"6.3.1":
url: "https://github.com/OSGeo/PROJ/releases/download/6.3.1/proj-6.3.1.tar.gz"
sha256: "6de0112778438dcae30fcc6942dee472ce31399b9e5a2b67e8642529868c86f8"
patches:
"9.3.1":
- patch_file: "patches/0001-use-cmake-targets-9.2.1.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"9.3.0":
- patch_file: "patches/0001-use-cmake-targets-9.2.1.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"9.2.1":
- patch_file: "patches/0001-use-cmake-targets-9.2.1.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"9.1.1":
- patch_file: "patches/0001-use-cmake-targets-9.1.0.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"9.1.0":
- patch_file: "patches/0001-use-cmake-targets-9.1.0.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"9.0.1":
- patch_file: "patches/0001-use-cmake-targets-9.0.1.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"9.0.0":
- patch_file: "patches/0001-use-cmake-targets-9.0.0.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
- patch_file: "patches/0002-cmake-configure-proj-pc.patch"
patch_type: "portability"
patch_description: "cmake configure proj pc"
patch_source: "https://github.com/OSGeo/PROJ/pull/3087"
"8.2.1":
- patch_file: "patches/0001-use-cmake-targets-8.2.0.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"7.2.1":
- patch_file: "patches/0001-use-cmake-targets-7.2.1.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"6.3.1":
- patch_file: "patches/0001-use-cmake-targets-6.x.x.patch"
patch_type: "conan"
patch_description: "Use cmake targets"
"6.3.2":
url: "https://github.com/OSGeo/PROJ/releases/download/6.3.2/proj-6.3.2.tar.gz"
sha256: "cb776a70f40c35579ae4ba04fb4a388c1d1ce025a1df6171350dc19f25b80311"
24 changes: 9 additions & 15 deletions recipes/proj/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
from conan.tools.build import stdcpp_library
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv, VirtualRunEnv
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, collect_libs, rm, rename
from conan.tools.files import get, copy, rmdir, replace_in_file, collect_libs, rename
from conan.tools.microsoft import is_msvc
from conan.tools.scm import Version
import os


required_conan_version = ">=1.60.0 <2 || >=2.0.5"


Expand Down Expand Up @@ -43,7 +42,7 @@ def _is_legacy_one_profile(self):
return not hasattr(self, "settings_build")

def export_sources(self):
export_conandata_patches(self)
copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))

def config_options(self):
if self.settings.os == "Windows":
Expand Down Expand Up @@ -112,25 +111,20 @@ def generate(self):
tc.generate()

deps = CMakeDeps(self)
deps.set_property("sqlite3", "cmake_file_name", "SQLite3")
deps.generate()

def _patch_sources(self):
apply_conandata_patches(self)

cmakelists = os.path.join(self.source_folder, "CMakeLists.txt")
replace_in_file(self, cmakelists, "/W4", "")

# Fix up usage of SQLite3 finder outputs
rm(self, "FindSqlite3.cmake", os.path.join(self.source_folder, "cmake"))
replace_in_file(self, cmakelists, "SQLITE3_FOUND", "SQLite3_FOUND")
replace_in_file(self, cmakelists, "SQLITE3_VERSION", "SQLite3_VERSION")
replace_in_file(self, cmakelists, "find_package(Sqlite3 REQUIRED)", "find_package(SQLite3 REQUIRED)")
# Inject Conan dependencies
replace_in_file(self, cmakelists, "# Set C++ version", "include(conan_deps.cmake)\n# ")

replace_in_file(self, cmakelists, "/W4", "")

# Let CMake install shared lib with a clean rpath !
if Version(self.version) >= "7.1.0" and Version(self.version) < "9.0.0":
replace_in_file(self, cmakelists,
"set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)",
"")
if "7.1.0" <= Version(self.version) < "9.0.0":
replace_in_file(self, cmakelists, "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", "")

# Aggressive workaround against SIP on macOS, to handle sqlite3 executable
# linked to shared sqlite3 lib
Expand Down
34 changes: 0 additions & 34 deletions recipes/proj/all/patches/0001-use-cmake-targets-6.x.x.patch

This file was deleted.

37 changes: 0 additions & 37 deletions recipes/proj/all/patches/0001-use-cmake-targets-7.2.1.patch

This file was deleted.

31 changes: 0 additions & 31 deletions recipes/proj/all/patches/0001-use-cmake-targets-8.2.0.patch

This file was deleted.

31 changes: 0 additions & 31 deletions recipes/proj/all/patches/0001-use-cmake-targets-9.0.0.patch

This file was deleted.

31 changes: 0 additions & 31 deletions recipes/proj/all/patches/0001-use-cmake-targets-9.0.1.patch

This file was deleted.

31 changes: 0 additions & 31 deletions recipes/proj/all/patches/0001-use-cmake-targets-9.1.0.patch

This file was deleted.

12 changes: 0 additions & 12 deletions recipes/proj/all/patches/0001-use-cmake-targets-9.2.1.patch

This file was deleted.

13 changes: 0 additions & 13 deletions recipes/proj/all/patches/0002-cmake-configure-proj-pc.patch

This file was deleted.

Loading