Skip to content

Commit

Permalink
abseil-cpp_202[301,401]: fix build on aarch64_darwin (#362350)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage authored Dec 6, 2024
2 parents 43c5cd5 + 2a3534c commit e74f789
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkgs/development/libraries/abseil-cpp/202301.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, gtest
, static ? stdenv.hostPlatform.isStatic
Expand All @@ -18,7 +19,15 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-7C/QIXYRyUyNVVE0tqmv8b5g/uWc58iBI5jzdtddQ+U=";
};

patches = lib.optionals stdenv.hostPlatform.isDarwin [
patches = [
# Fixes: clang++: error: unsupported option '-msse4.1' for target 'aarch64-apple-darwin'
# https://github.com/abseil/abseil-cpp/pull/1707
(fetchpatch {
name = "fix-compile-breakage-on-darwin";
url = "https://github.com/abseil/abseil-cpp/commit/6dee153242d7becebe026a9bed52f4114441719d.patch";
hash = "sha256-r6QnHPnwPwOE/hv4kLNA3FqNq2vU/QGmwAc5q0/q1cs=";
})
] ++ lib.optionals stdenv.hostPlatform.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
Expand Down
11 changes: 11 additions & 0 deletions pkgs/development/libraries/abseil-cpp/202401.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, gtest
, static ? stdenv.hostPlatform.isStatic
Expand All @@ -18,6 +19,16 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-eA2/dZpNOlex1O5PNa3XSZhpMB3AmaIoHzVDI9TD/cg=";
};

patches = [
# Fixes: clang++: error: unsupported option '-msse4.1' for target 'aarch64-apple-darwin'
# https://github.com/abseil/abseil-cpp/pull/1707
(fetchpatch {
name = "fix-compile-breakage-on-darwin";
url = "https://github.com/abseil/abseil-cpp/commit/6dee153242d7becebe026a9bed52f4114441719d.patch";
hash = "sha256-r6QnHPnwPwOE/hv4kLNA3FqNq2vU/QGmwAc5q0/q1cs=";
})
];

cmakeFlags = [
"-DABSL_BUILD_TEST_HELPERS=ON"
"-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
Expand Down

0 comments on commit e74f789

Please sign in to comment.