diff --git a/pkgs/development/libraries/proj/default.nix b/pkgs/development/libraries/proj/default.nix index e6675ae9950..5e063b59f3d 100644 --- a/pkgs/development/libraries/proj/default.nix +++ b/pkgs/development/libraries/proj/default.nix @@ -17,22 +17,18 @@ stdenv.mkDerivation (finalAttrs: rec { pname = "proj"; - version = "9.1.1"; + version = "9.2.0"; src = fetchFromGitHub { owner = "OSGeo"; repo = "PROJ"; rev = version; - hash = "sha256-yw7eSm64qFFt9egJWKVyVo0e7xQRSmfUY7pk6Cwvwdk="; + hash = "sha256-NC5H7ufIXit+PVDwNDhz5cv44fduTytsdmNOWyqDDYQ="; }; patches = [ # https://github.com/OSGeo/PROJ/pull/3252 - (fetchpatch { - name = "only-add-find_dependencyCURL-for-static-builds.patch"; - url = "https://github.com/OSGeo/PROJ/commit/11f4597bbb7069bd5d4391597808703bd96df849.patch"; - hash = "sha256-4w5Cu2m5VJZr6E2dUVRyWJdED2TyS8cI8G20EwfQ4u0="; - }) + ./only-add-curl-for-static-builds.patch ]; outputs = [ "out" "dev" ]; @@ -68,6 +64,7 @@ stdenv.mkDerivation (finalAttrs: rec { }; meta = with lib; { + changelog = "https://github.com/OSGeo/PROJ/blob/${src.rev}/docs/source/news.rst"; description = "Cartographic Projections Library"; homepage = "https://proj.org/"; license = licenses.mit; diff --git a/pkgs/development/libraries/proj/only-add-curl-for-static-builds.patch b/pkgs/development/libraries/proj/only-add-curl-for-static-builds.patch new file mode 100644 index 00000000000..2997edd8957 --- /dev/null +++ b/pkgs/development/libraries/proj/only-add-curl-for-static-builds.patch @@ -0,0 +1,55 @@ +From 831063f8206cab1ad3e90b204a1c3f8c87c3d5cc Mon Sep 17 00:00:00 2001 +From: Even Rouault +Date: Tue, 5 Jul 2022 19:40:53 +0200 +Subject: [PATCH] proj-config.cmake generation: only add find_dependency(CURL) + for static builds + +--- + cmake/project-config.cmake.in | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in +index 40dbaaa2..c1ecd601 100644 +--- a/cmake/project-config.cmake.in ++++ b/cmake/project-config.cmake.in +@@ -15,20 +15,24 @@ include(CMakeFindDependencyMacro) + + cmake_policy(PUSH) + cmake_policy(SET CMP0012 NEW) +-if("@ENABLE_TIFF@") +- find_dependency(TIFF) ++if(NOT "@BUILD_SHARED_LIBS@") ++ if("@ENABLE_TIFF@") ++ find_dependency(TIFF) ++ endif() + endif() +-if("@CURL_ENABLED@") +- # Chainload CURL usage requirements +- find_dependency(CURL) +- # Target CURL::libcurl only defined since CMake 3.12 +- if(NOT TARGET CURL::libcurl) +- add_library(CURL::libcurl INTERFACE IMPORTED) +- set_target_properties(CURL::libcurl PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}" +- INTERFACE_LINK_LIBRARIES "${CURL_LIBRARIES}" +- ) +- endif() ++if(NOT "@BUILD_SHARED_LIBS@") ++ if("@CURL_ENABLED@") ++ # Chainload CURL usage requirements ++ find_dependency(CURL) ++ # Target CURL::libcurl only defined since CMake 3.12 ++ if(NOT TARGET CURL::libcurl) ++ add_library(CURL::libcurl INTERFACE IMPORTED) ++ set_target_properties(CURL::libcurl PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}" ++ INTERFACE_LINK_LIBRARIES "${CURL_LIBRARIES}" ++ ) ++ endif() ++ endif() + endif() + cmake_policy(POP) + +-- +2.39.2 +