diff --git a/pkgs/development/libraries/abseil-cpp/202103.nix b/pkgs/development/libraries/abseil-cpp/202103.nix index 712f89e383ff..59294496f80a 100644 --- a/pkgs/development/libraries/abseil-cpp/202103.nix +++ b/pkgs/development/libraries/abseil-cpp/202103.nix @@ -39,6 +39,10 @@ stdenv.mkDerivation rec { url = "https://github.com/abseil/abseil-cpp/commit/808bc202fc13e85a7948db0d7fb58f0f051200b1.patch"; sha256 = "sha256-ayY/aV/xWOdEyFSDqV7B5WDGvZ0ASr/aeBeYwP5RZVc="; }) + ] ++ lib.optionals stdenv.isDarwin [ + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages + # that require a different SDK other than the default one. + ./cmake-core-foundation.patch ]; cmakeFlags = [ diff --git a/pkgs/development/libraries/abseil-cpp/202111.nix b/pkgs/development/libraries/abseil-cpp/202111.nix index d40ca0bd4ab2..0c1a173eca44 100644 --- a/pkgs/development/libraries/abseil-cpp/202111.nix +++ b/pkgs/development/libraries/abseil-cpp/202111.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk="; }; + patches = lib.optionals stdenv.isDarwin [ + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages + # that require a different SDK other than the default one. + ./cmake-core-foundation.patch + ]; + cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ] ++ lib.optionals (cxxStandard != null) [ diff --git a/pkgs/development/libraries/abseil-cpp/202206.nix b/pkgs/development/libraries/abseil-cpp/202206.nix index 7ca25f414040..a605be3c05ed 100644 --- a/pkgs/development/libraries/abseil-cpp/202206.nix +++ b/pkgs/development/libraries/abseil-cpp/202206.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation rec { hash = "sha256-Od1FZOOWEXVQsnZBwGjDIExi6LdYtomyL0STR44SsG8="; }; + patches = lib.optionals stdenv.isDarwin [ + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages + # that require a different SDK other than the default one. + ./cmake-core-foundation.patch + ]; + cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ] ++ lib.optionals (cxxStandard != null) [ diff --git a/pkgs/development/libraries/abseil-cpp/202301.nix b/pkgs/development/libraries/abseil-cpp/202301.nix index da5f1fc029e1..4676264c26d7 100644 --- a/pkgs/development/libraries/abseil-cpp/202301.nix +++ b/pkgs/development/libraries/abseil-cpp/202301.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-PLoI7ix+reUqkZ947kWzls8lujYqWXk9A9a55UcfahI="; }; + patches = lib.optionals stdenv.isDarwin [ + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages + # that require a different SDK other than the default one. + ./cmake-core-foundation.patch + ]; + cmakeFlags = [ "-DABSL_BUILD_TEST_HELPERS=ON" "-DABSL_USE_EXTERNAL_GOOGLETEST=ON" diff --git a/pkgs/development/libraries/abseil-cpp/202308.nix b/pkgs/development/libraries/abseil-cpp/202308.nix index 7ec0ac8a775f..78651024ab5d 100644 --- a/pkgs/development/libraries/abseil-cpp/202308.nix +++ b/pkgs/development/libraries/abseil-cpp/202308.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-uNGrTNg5G5xFGtc+BSWE389x0tQ/KxJQLHfebNWas/k="; }; + patches = lib.optionals stdenv.isDarwin [ + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages + # that require a different SDK other than the default one. + ./cmake-core-foundation.patch + ]; + cmakeFlags = [ "-DABSL_BUILD_TEST_HELPERS=ON" "-DABSL_USE_EXTERNAL_GOOGLETEST=ON" diff --git a/pkgs/development/libraries/abseil-cpp/cmake-core-foundation.patch b/pkgs/development/libraries/abseil-cpp/cmake-core-foundation.patch new file mode 100644 index 000000000000..61b57456b3fc --- /dev/null +++ b/pkgs/development/libraries/abseil-cpp/cmake-core-foundation.patch @@ -0,0 +1,12 @@ +diff -ur a/absl/time/CMakeLists.txt b/absl/time/CMakeLists.txt +--- a/absl/time/CMakeLists.txt 1969-12-31 19:00:01.000000000 -0500 ++++ b/absl/time/CMakeLists.txt 2023-10-30 21:50:32.639061785 -0400 +@@ -55,7 +55,7 @@ + ) + + if(APPLE) +- find_library(CoreFoundation CoreFoundation) ++ set(CoreFoundation "-framework CoreFoundation") + endif() + + absl_cc_library(