[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/06: gnu: Add catch2-3.1.
From: |
guix-commits |
Subject: |
01/06: gnu: Add catch2-3.1. |
Date: |
Thu, 15 Dec 2022 10:59:26 -0500 (EST) |
lilyp pushed a commit to branch master
in repository guix.
commit 407b4f5661ea806ddc1056b35722fd551237f87d
Author: Liliana Marie Prikler <liliana.prikler@gmail.com>
AuthorDate: Thu Dec 8 09:31:42 2022 +0100
gnu: Add catch2-3.1.
* gnu/packages/check.scm (catch2-3.1): New variable.
---
gnu/packages/check.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index af0ad1c00f..aaa41777dc 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -580,6 +580,85 @@ It allows the specification of behaviour scenarios using a
given-when-then
pattern.")
(license license:apsl2))))
+(define-public catch2-3.1
+ (package
+ (name "catch2")
+ (version "3.1.1")
+ (home-page "https://github.com/catchorg/Catch2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/catchorg/Catch2")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1qnr5b3zq8brh43f924rgnw5gmmjf9ax7kbq2crz1mlwgmdymxlp"))))
+ (outputs (list "out" "static"))
+ (build-system meson-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-meson
+ (lambda _
+ (substitute* "src/catch2/meson.build"
+ (("static_library") "both_libraries"))))
+ (add-after 'install 'install-cmake-config
+ (lambda* (#:key outputs #:allow-other-keys)
+ (define prefix (string-append (assoc-ref outputs "out")
+ "/lib/cmake/Catch2/"))
+ (mkdir-p prefix)
+ (call-with-output-file (string-append
+ prefix
+ "catch2-config-version.cmake")
+ (lambda (port)
+ (format
+ port
+ "set(PACKAGE_VERSION ~s)~@
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)~@
+ set(PACKAGE_VERSION_EXACT TRUE)~@
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)~@
+ elseif(PACKAGE_FIND_VERSION VERSION_LESS_EQUAL ~
+ PACKAGE_VERSION)~@
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)~@
+ else()~@
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)~@
+ endif()"
+ #$version)))
+ (call-with-output-file (string-append prefix
+ "catch2-config.cmake")
+ (lambda (port)
+ (format
+ port
+ "include(FindPkgConfig)~@
+ pkg_check_modules(CATCH2 IMPORTED_TARGET GLOBAL catch2)~@
+ pkg_check_modules(CATCH2MAIN ~
+ IMPORTED_TARGET GLOBAL ~
+ catch2 catch2-with-main)~@
+ if(CATCH2_FOUND)~@
+ add_library(Catch2::Catch2 ALIAS PkgConfig::CATCH2)~@
+ endif()~@
+ if(CATCH2MAIN_FOUND)~@
+ add_library(Catch2::Catch2WithMain ~
+ ALIAS PkgConfig::CATCH2MAIN)~@
+ endif()")))))
+ (add-after 'install 'move-static-libraries
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (static (assoc-ref outputs "static")))
+ (for-each
+ (lambda (file)
+ (install-file file (string-append static "/lib"))
+ (delete-file file))
+ (find-files (string-append out "/lib")
+ "\\.a$"))))))))
+ (inputs (list python-wrapper))
+ (synopsis "Automated test framework for C++ and Objective-C")
+ (description "Catch2 stands for C++ Automated Test Cases in Headers and is
+a multi-paradigm automated test framework for C++ and Objective-C.")
+ (license license:boost1.0)))
+
(define-public cmdtest
(package
(name "cmdtest")
- branch master updated (b19f5bbac7 -> f19d49e69c), guix-commits, 2022/12/15
- 02/06: gnu: clingo: Update to 5.6.2., guix-commits, 2022/12/15
- 01/06: gnu: Add catch2-3.1.,
guix-commits <=
- 03/06: gnu: clingo: Use G-Expressions., guix-commits, 2022/12/15
- 06/06: gnu: Add orf-dl., guix-commits, 2022/12/15
- 05/06: gnu: Add python-telingo., guix-commits, 2022/12/15
- 04/06: gnu: Add python-clingo., guix-commits, 2022/12/15