gnu: Add abseil-cpp.

* gnu/packages/cpp.scm (abseil-cpp): New variable.

Signed-off-by: Pierre Neidhardt <mail@ambrevar.xyz>
This commit is contained in:
Roel Janssen 2020-03-04 15:03:29 +01:00 committed by Pierre Neidhardt
parent f19d0b1b3f
commit 33aa372eec
No known key found for this signature in database
GPG key ID: 9BDCF497A4BBCC7F

View file

@ -7,6 +7,7 @@
;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -439,3 +440,47 @@ (define-public tweeny
other values of screen objects, by setting their values as the tween starting
point and then, after each tween step, plugging back the result.")
(license license:expat)))
(define-public abseil-cpp
(package
(name "abseil-cpp")
(version "20200225")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/abseil/abseil-cpp.git")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"0wb04pszzrl39ny1pz9jvvq8lbbm355dd60jspcyqfwxnk6njgd1"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
"-DABSL_RUN_TESTS=ON"
;; Needed, else we get errors like:
;;
;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o:
;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE'
;; ld: /gnu/store/bxapb1f1l8frjpbjckk3zdxhmcig3xzk-googletest-1.10.0/lib/libgmock.so:
;; error adding symbols: DSO missing from command line
;; collect2: error: ld returned 1 exit status
"-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock")
#:phases
(modify-phases %standard-phases
(add-before 'configure 'remove-gtest-check
;; The CMakeLists fails to find our googletest for some reason, but
;; it works nonetheless.
(lambda _
(substitute* "CMakeLists.txt"
(("check_target\\(gtest\\)") "")
(("check_target\\(gtest_main\\)") "")
(("check_target\\(gmock\\)") "")))))))
(native-inputs
`(("googletest" ,googletest)))
(home-page "https://abseil.io")
(synopsis "Augmented C++ standard library")
(description "Abseil is a collection of C++ library code designed to
augment the C++ standard library. The Abseil library code is collected from
Google's C++ code base.")
(license license:asl2.0)))