diff options
| author | Herman Rimm <herman@rimm.ee> | 2026-08-25 11:46:53 +0200 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-08-25 13:19:45 +0200 |
| commit | 0a7a1a4cb55b887727dac6b9c2585002629e8497 (patch) | |
| tree | e5b0a6c8794085362b9544c0055fa05b22b576d1 /gnu/packages/cpp.scm | |
| parent | 930f84bdc1106ea0192525cd98adb284ba45c610 (diff) | |
gnu: abseil-cpp-20220623: Fix cross-compilation.
* gnu/packages/cpp.scm (abseil-cpp-20220623)[arguments]: Dedent a space.
Add TODO comments. Do not enable tests or set CMAKE_EXE_LINKER_FLAGS if
cross-compiling. Remove remove-gtest-check phase if cross-compiling.
Fixes: guix/guix#2654
Signed-off-by: Andreas Enge <andreas@enge.fr>
Diffstat (limited to 'gnu/packages/cpp.scm')
| -rw-r--r-- | gnu/packages/cpp.scm | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 3167c1ac94f..05cdd9151c9 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm | |||
| @@ -2500,11 +2500,15 @@ point and then, after each tween step, plugging back the result.") | |||
| 2500 | (search-patches "abseil-cpp-20220623.1-no-kepsilon-i686.patch")))) | 2500 | (search-patches "abseil-cpp-20220623.1-no-kepsilon-i686.patch")))) |
| 2501 | (build-system cmake-build-system) | 2501 | (build-system cmake-build-system) |
| 2502 | (arguments | 2502 | (arguments |
| 2503 | (list | 2503 | (list |
| 2504 | #:configure-flags | 2504 | #:configure-flags |
| 2505 | (if (%current-target-system) | ||
| 2506 | #~'("-DBUILD_SHARED_LIBS=ON") | ||
| 2505 | ;; The following convoluted expression has been crafted to avoid | 2507 | ;; The following convoluted expression has been crafted to avoid |
| 2506 | ;; changing the derivation when removing inheritance from | 2508 | ;; changing the derivation when removing inheritance from |
| 2507 | ;; abseil-cpp-20200923.3. | 2509 | ;; abseil-cpp-20200923.3. |
| 2510 | ;; TODO: Simplify and try to remove CMAKE_EXE_LINKER_FLAGS for | ||
| 2511 | ;; next world-rebuild. | ||
| 2508 | #~(cons* | 2512 | #~(cons* |
| 2509 | "-DABSL_BUILD_TESTING=ON" | 2513 | "-DABSL_BUILD_TESTING=ON" |
| 2510 | (delete | 2514 | (delete |
| @@ -2518,22 +2522,23 @@ point and then, after each tween step, plugging back the result.") | |||
| 2518 | ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so: | 2522 | ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so: |
| 2519 | ;; error adding symbols: DSO missing from command line | 2523 | ;; error adding symbols: DSO missing from command line |
| 2520 | ;; collect2: error: ld returned 1 exit status | 2524 | ;; collect2: error: ld returned 1 exit status |
| 2521 | "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock"))) | 2525 | "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")))) |
| 2522 | #:phases | 2526 | #:phases |
| 2523 | #~(modify-phases %standard-phases | 2527 | #~(modify-phases %standard-phases |
| 2524 | (add-after 'unpack 'fix-max | 2528 | (add-after 'unpack 'fix-max |
| 2525 | (lambda _ | 2529 | (lambda _ |
| 2526 | (substitute* "absl/debugging/failure_signal_handler.cc" | 2530 | (substitute* "absl/debugging/failure_signal_handler.cc" |
| 2527 | (("std::max\\(SIGSTKSZ, 65536\\)") | 2531 | (("std::max\\(SIGSTKSZ, 65536\\)") |
| 2528 | "std::max<size_t>(SIGSTKSZ, 65536)")))) | 2532 | "std::max<size_t>(SIGSTKSZ, 65536)")))) |
| 2529 | (add-before 'configure 'remove-gtest-check | 2533 | ;; TODO: Remove phase unconditionally for next world-rebuild. |
| 2530 | ;; The CMakeLists fails to find our googletest for some reason, but | 2534 | #$@(if (%current-target-system) |
| 2531 | ;; it works nonetheless. | 2535 | #~() |
| 2532 | (lambda _ | 2536 | #~((add-before 'configure 'remove-gtest-check |
| 2533 | (substitute* "CMakeLists.txt" | 2537 | (lambda _ |
| 2534 | (("check_target\\(gtest\\)") "") | 2538 | (substitute* "CMakeLists.txt" |
| 2535 | (("check_target\\(gtest_main\\)") "") | 2539 | (("check_target\\(gtest\\)") "") |
| 2536 | (("check_target\\(gmock\\)") ""))))))) | 2540 | (("check_target\\(gtest_main\\)") "") |
| 2541 | (("check_target\\(gmock\\)") ""))))))))) | ||
| 2537 | (native-inputs | 2542 | (native-inputs |
| 2538 | (list googletest-1.12)) | 2543 | (list googletest-1.12)) |
| 2539 | (home-page "https://abseil.io") | 2544 | (home-page "https://abseil.io") |
