abseil-cpp: don’t propagate CoreFoundation

abseil-cpp builds with the default SDK, which can break dependent
packages that require a different SDK version to build. Don’t propagate
the CoreFoundation framework path and rely on nixpkgs to provide it
instead. The line can’t be dropped because otherwise abseil-cpp will
fail to build (due to missing symbols).
This commit is contained in:
Randy Eckenrode 2023-10-30 21:53:57 -04:00
parent 98b8d3474b
commit 020240dc47
No known key found for this signature in database
GPG key ID: 64C1CD4EC2A600D9
6 changed files with 40 additions and 0 deletions

View file

@ -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 [
# Dont propagate the path to CoreFoundation. Otherwise, its impossible to build packages
# that require a different SDK other than the default one.
./cmake-core-foundation.patch
];
cmakeFlags = [

View file

@ -18,6 +18,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its 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) [

View file

@ -18,6 +18,12 @@ stdenv.mkDerivation rec {
hash = "sha256-Od1FZOOWEXVQsnZBwGjDIExi6LdYtomyL0STR44SsG8=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its 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) [

View file

@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-PLoI7ix+reUqkZ947kWzls8lujYqWXk9A9a55UcfahI=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its 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"

View file

@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-uNGrTNg5G5xFGtc+BSWE389x0tQ/KxJQLHfebNWas/k=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its 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"

View file

@ -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(