all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 59896@debbugs.gnu.org
Subject: [bug#59896] [PATCH 1/5] gnu: Add catch2-3.1.
Date: Thu, 8 Dec 2022 09:31:42 +0100	[thread overview]
Message-ID: <c379bfcab3215a24e775ac3fc136d6e10360e9cb.camel@gmail.com> (raw)
In-Reply-To: <dc4bd56c84e4656c5603fd66eeff80dbdf3de487.camel@gmail.com>

* 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 c900a055d5..af48ae91be 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -580,6 +580,85 @@ (define-public cbehave
 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")
-- 
2.38.1





  reply	other threads:[~2022-12-08 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  8:54 [bug#59896] [PATCH 0/5] Update clingo and add telingo Liliana Marie Prikler
2022-12-08  8:31 ` Liliana Marie Prikler [this message]
2022-12-08  8:33 ` [bug#59896] [PATCH 2/5] gnu: clingo: Update to 5.6.2 Liliana Marie Prikler
2022-12-08  8:47 ` [bug#59896] [PATCH 3/5] gnu: clingo: Use G-Expressions Liliana Marie Prikler
2022-12-08  8:48 ` [bug#59896] [PATCH 4/5] gnu: Add python-clingo Liliana Marie Prikler
2022-12-08  8:49 ` [bug#59896] [PATCH 5/5] gnu: Add python-telingo Liliana Marie Prikler
2022-12-15 16:00   ` bug#59896: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c379bfcab3215a24e775ac3fc136d6e10360e9cb.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=59896@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.