Skip to content

Commit

Permalink
(#21512) proj: add v9.4.0, drop old versions
Browse files Browse the repository at this point in the history
* proj: bump v6, simplify patching

* proj: fix SQLite version check

* proj: add v9.4.0

* proj: set CMP0077

* proj: tweak patching

* proj: revert old patches, v9.4.0 no longer requires patching

* proj: fix failure due to unrecognized warning flags

* proj: ignore warning flags for GCC 7 as well

* proj: require newer CMake

* proj: bump sqlite3 for #23277

* Added new patch version

* Update recipes/proj/all/conanfile.py

---------

Co-authored-by: PerseoGI <perseog@jfrog.com>
Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
  • Loading branch information
3 people authored Jun 11, 2024
1 parent 5783d45 commit b087c3e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 155 deletions.
35 changes: 3 additions & 32 deletions recipes/proj/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"9.4.1":
url: "https://github.com/OSGeo/PROJ/releases/download/9.4.1/proj-9.4.1.tar.gz"
sha256: "ffe20170ee2b952207adf8a195e2141eab12cda181e49fdeb54425d98c7171d7"
"9.3.1":
url: "https://github.com/OSGeo/PROJ/releases/download/9.3.1/proj-9.3.1.tar.gz"
sha256: "b0f919cb9e1f42f803a3e616c2b63a78e4d81ecfaed80978d570d3a5e29d10bc"
Expand All @@ -8,18 +11,6 @@ sources:
"9.2.1":
url: "https://github.com/OSGeo/PROJ/releases/download/9.2.1/proj-9.2.1.tar.gz"
sha256: "15ebf4afa8744b9e6fccb5d571fc9f338dc3adcf99907d9e62d1af815d4971a1"
"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"
Expand All @@ -42,26 +33,6 @@ patches:
- 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"
Expand Down
25 changes: 16 additions & 9 deletions recipes/proj/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from conan.tools.scm import Version
import os


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


Expand Down Expand Up @@ -68,6 +67,8 @@ def requirements(self):
self.requires("libcurl/[>=7.78.0 <9]")

def build_requirements(self):
if Version(self.version) >= "9.4.0":
self.tool_requires("cmake/[>=3.16 <4]")
if not self._is_legacy_one_profile:
self.tool_requires("sqlite3/<host_version>")

Expand Down Expand Up @@ -109,6 +110,7 @@ def generate(self):
# Workaround for: https://github.com/conan-io/conan/issues/13560
libdirs_host = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs]
tc.variables["CMAKE_BUILD_RPATH"] = ";".join(libdirs_host)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()

deps = CMakeDeps(self)
Expand All @@ -118,19 +120,19 @@ 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)")
if Version(self.version) < "9.4.0":
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)")

# 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 All @@ -155,6 +157,11 @@ def _patch_sources(self):
if Version(self.version) < "8.1.0":
rmdir(self, os.path.join(self.source_folder, "include", "proj", "internal", "nlohmann"))

# Remove warning flags that are unfamiliar to GCC 5
if Version(self.version) >= "9.0" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8.0":
replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${PROJ_C_WARN_FLAGS}", "")
replace_in_file(self, os.path.join(self.source_folder, "src", "CMakeLists.txt"), "${PROJ_CXX_WARN_FLAGS}", "")

def build(self):
self._patch_sources()
cmake = CMake(self)
Expand Down
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.

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

This file was deleted.

10 changes: 2 additions & 8 deletions recipes/proj/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
versions:
"9.4.1":
folder: "all"
"9.3.1":
folder: "all"
"9.3.0":
folder: "all"
"9.2.1":
folder: "all"
"9.1.1":
folder: "all"
"9.1.0":
folder: "all"
"9.0.1":
folder: "all"
"9.0.0":
folder: "all"
"8.2.1":
folder: "all"
"7.2.1":
Expand Down

0 comments on commit b087c3e

Please sign in to comment.