From c0cea38f6ccb281aa105aba00b3da3e4a5c8f7ef Mon Sep 17 00:00:00 2001 From: Lukas Gradl Date: Thu, 2 Jun 2016 08:38:23 -0500 Subject: [PATCH] gnu: Add googletest. * gnu/packages/check.scm (googletest): New variable. --- gnu/packages/check.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 9eef7a9..576ef61 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2015 Andreas Enge ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 Roel Janssen +;;; Copyright © 2016 Lukas Gradl ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ (define-module (gnu packages check) #:use-module (gnu packages) #:use-module (gnu packages autotools) + #:use-module (gnu packages python) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) @@ -193,3 +195,45 @@ in the code. Cppcheck primarily detects the types of bugs that the compilers normally do not detect. The goal is to detect only real errors in the code (i.e. have zero false positives).") (license gpl3+))) + +(define-public googletest + (package + (name "googletest") + (version "1.7.0") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://github.com/google/googletest/archive/release-" + version ".tar.gz")) + (sha256 + (base32 + "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp")))) + (build-system cmake-build-system) + (native-inputs + `(("python-2" ,python-2))) + (arguments + `(#:configure-flags + '("-Dgtest_build_tests=ON") + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda _ + (let ((out (assoc-ref %outputs "out")) + (version version)) + (begin + (mkdir-p (string-append out "/lib")) + (mkdir-p (string-append out "/include")) + (install-file "libgtest.a" (string-append out "/lib")) + (install-file "libgtest_main.a" (string-append out "/lib")) + (copy-recursively + (string-append "../googletest-release-" version "/include") + (string-append out "/lib"))))))))) + (home-page "https://github.com/google/googletest/") + (synopsis "Test discovery and XUnit test framework") + (description "Google Test features an XUnit test framework, automated test +discovery, death tests, assertions, parameterized tests and XML test report +generation.") + (license bsd-3))) + -- 2.7.4