unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2
@ 2023-06-17 19:27 David Elsing
  2023-06-17 19:30 ` [bug#64137] [PATCH 1/2] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: David Elsing @ 2023-06-17 19:27 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

Currently, the catch2-3.1 package is built with Meson. I think this was done
to build both static and shared libraries together, which is not supported by
CMake. Unfortunately, several CMake files (in lib/cmake/Catch2) are not
installed and to install them, CMake would be necessary as build dependency
anyway. Only the clingo package depends on this package and the static output
is not used in another package.

Would it be acceptable to build it with CMake instead, like the catch2 package
(for version 2)? I also included a separate package for the static version. Of
course, the documentation and headers are then installed in both packages.

David Elsing (2):
  gnu: catch2-3.1: Rename to catch2-3.3.
  gnu: Add catch2-static-3.3.

 gnu/packages/check.scm    | 81 ++++++++++-----------------------------
 gnu/packages/potassco.scm |  2 +-
 2 files changed, 21 insertions(+), 62 deletions(-)


base-commit: 6e1215fb9c03ccb4a2d4440990aee5a66a935268
-- 
2.40.1





^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH 1/2] gnu: catch2-3.1: Rename to catch2-3.3.
  2023-06-17 19:27 [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
@ 2023-06-17 19:30 ` David Elsing
  2023-06-17 19:30 ` [bug#64137] [PATCH 2/2] gnu: Add catch2-static-3.3 David Elsing
  2023-06-18  6:55 ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 Liliana Marie Prikler
  2 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-17 19:30 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/check.scm (catch2-3.1): Rename to catch2-3.3.
* gnu/packages/potassco.scm (clingo): Adjust accordingly.
---
 gnu/packages/check.scm    | 70 +++++----------------------------------
 gnu/packages/potassco.scm |  2 +-
 2 files changed, 10 insertions(+), 62 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..512b2ac070 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -38,7 +38,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
@@ -596,10 +596,10 @@ (define-public cbehave
 pattern.")
       (license license:apsl2))))
 
-(define-public catch2-3.1
+(define-public catch2-3.3
   (package
     (name "catch2")
-    (version "3.1.1")
+    (version "3.3.2")
     (home-page "https://github.com/catchorg/Catch2")
     (source (origin
               (method git-fetch)
@@ -609,66 +609,14 @@ (define-public catch2-3.1
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1qnr5b3zq8brh43f924rgnw5gmmjf9ax7kbq2crz1mlwgmdymxlp"))))
-    (outputs (list "out" "static"))
-    (build-system meson-build-system)
+                "0m6i3lr0qk303ashjpz5vpwmxf76n5d6s8jq6r6kcy6gph525zmp"))))
+    (build-system cmake-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$"))))))))
+      #:configure-flags
+      #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
+              "-DENABLE_WERROR=OFF"
+              "-DBUILD_SHARED_LIBS=ON")))
     (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
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index 03d243cdc7..cf385a65d5 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -198,7 +198,7 @@ (define-public clingo
                                 "unpool-ast-v2" "parse_term"
                                 "propagator" "propgator-sequence-mining"
                                 "symbol" "visitor"))))))))))
-    (inputs (list catch2-3.1 clasp libpotassco))
+    (inputs (list catch2-3.3 clasp libpotassco))
     (native-inputs (list pkg-config))
     (home-page "https://potassco.org/")
     (synopsis "Grounder and solver for logic programs")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH 2/2] gnu: Add catch2-static-3.3.
  2023-06-17 19:27 [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
  2023-06-17 19:30 ` [bug#64137] [PATCH 1/2] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
@ 2023-06-17 19:30 ` David Elsing
  2023-06-18  6:55 ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 Liliana Marie Prikler
  2 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-17 19:30 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/check.scm (catch2-static-3.3): New variable.
---
 gnu/packages/check.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 512b2ac070..7986f58cc1 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -623,6 +623,17 @@ (define-public catch2-3.3
 a multi-paradigm automated test framework for C++ and Objective-C.")
     (license license:boost1.0)))
 
+(define-public catch2-static-3.3
+  (let ((base catch2-3.3))
+    (package
+      (inherit base)
+      (name "catch2-static")
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:configure-flags flags)
+          #~(cons* "-DBUILD_SHARED_LIBS=OFF"
+                   (delete "-DBUILD_SHARED_LIBS=ON" #$flags))))))))
+
 (define-public cmdtest
   (package
     (name "cmdtest")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2
  2023-06-17 19:27 [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
  2023-06-17 19:30 ` [bug#64137] [PATCH 1/2] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
  2023-06-17 19:30 ` [bug#64137] [PATCH 2/2] gnu: Add catch2-static-3.3 David Elsing
@ 2023-06-18  6:55 ` Liliana Marie Prikler
  2023-06-18 20:47   ` David Elsing
  2 siblings, 1 reply; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-18  6:55 UTC (permalink / raw)
  To: David Elsing, 64137

Am Samstag, dem 17.06.2023 um 19:27 +0000 schrieb David Elsing:
> Currently, the catch2-3.1 package is built with Meson. I think this
> was done to build both static and shared libraries together, which is
> not supported by CMake. Unfortunately, several CMake files (in
> lib/cmake/Catch2) are not installed and to install them, CMake would
> be necessary as build dependency anyway. Only the clingo package
> depends on this package and the static output is not used in another
> package.
> 
> Would it be acceptable to build it with CMake instead, like the
> catch2 package (for version 2)?  I also included a separate package
> for the static version.  Of course, the documentation and headers are
> then installed in both packages.
If you actually get clingo to build, that'd be one thing, but there
shouldn't be any issue getting our catch2 to work in CMake-based
projects to begin with.  After all, we do provide a catch2-config that
simply invokes pkg-config.  I'd hazard a guess that whatever project
you're trying to build pokes at internals it's not really supposed to
see.

As for the upgrade to 3.3.2, I'd take that in solitude if clingo still
builds with it.  If not, you'd have to make it an extra version.

Cheers




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2
  2023-06-18  6:55 ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 Liliana Marie Prikler
@ 2023-06-18 20:47   ` David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant David Elsing
                       ` (8 more replies)
  0 siblings, 9 replies; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:47 UTC (permalink / raw)
  To: Liliana Marie Prikler, 64137

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> If you actually get clingo to build, that'd be one thing, but there
> shouldn't be any issue getting our catch2 to work in CMake-based
> projects to begin with.  After all, we do provide a catch2-config that
> simply invokes pkg-config.  I'd hazard a guess that whatever project
> you're trying to build pokes at internals it's not really supposed to
> see.
I see, what is missing are the "extras" like catch_discover_tests, but
it seems they can just be copied to lib/cmake/Catch2.
>
> As for the upgrade to 3.3.2, I'd take that in solitude if clingo still
> builds with it.  If not, you'd have to make it an extra version.
To build clingo with 3.3.2, the find_package(Catch2 3.1 ...) command
just needed to be adjusted, but I went ahead and unbundled the remaining
dependencies as well. Should this be a separate issue?
For catch2, it seems simpler to me to build it with CMake, as I don't
see the use case for the static library (as a second output). If you
prefer, I can change it back to Meson though and just copy the files
from the extras directory as well (provided it works).




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant.
  2023-06-18 20:47   ` David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-22  4:16       ` Liliana Marie Prikler
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 2/8] gnu: Add tsl-hopscotch-map David Elsing
                       ` (7 subsequent siblings)
  8 siblings, 1 reply; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (mpark-variant): New variable.
---
 gnu/packages/cpp.scm | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 39a34c20dd..5a6298fc4d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -29,7 +29,7 @@
 ;;; Copyright © 2022 muradm <mail@muradm.net>
 ;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name>
 ;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022, 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Sughosha <Sughosha@proton.me>
@@ -2553,3 +2553,38 @@ (define-public ftxui
 @item No dependencies.
 @end itemize")
     (license license:expat)))
+
+(define-public mpark-variant
+  (package
+    (name "mpark-variant")
+    (version "1.4.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/mpark/variant")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "0gz8d5qprlfqb42cfyyc4nbwhgarhw027a9nr52h3gbdn560j0j4"))
+              (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:configure-flags #~(list "-DMPARK_VARIANT_INCLUDE_TESTS=mpark")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'find-googletest
+            (lambda _
+              (substitute* "test/CMakeLists.txt"
+                (("add_subdirectory.*3rdparty/googletest.*\n")
+                 "find_package(GTest REQUIRED)\n")
+                ((".*3rdparty/googletest.*\n") "")
+                ((".*config_compiler_and_linker.*\n") "")
+                (("gtest_main") "gtest gtest_main")))))))
+    (native-inputs (list googletest))
+    (home-page "https://github.com/mpark/variant")
+    (synopsis "Implementation of the C++17 std::variant for C++11/14/17")
+    (description
+     "MPark.Variant provides the C++17 std::variant for C++11/14/17.  It is
+based on the implementation of std::variant in libc++.")
+    (license license:boost1.0)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 2/8] gnu: Add tsl-hopscotch-map.
  2023-06-18 20:47   ` David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-22  4:18       ` Liliana Marie Prikler
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 3/8] gnu: Add tsl-sparse-map David Elsing
                       ` (6 subsequent siblings)
  8 siblings, 1 reply; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tsl-hopscotch-map): New variable.
---
 gnu/packages/cpp.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 5a6298fc4d..7878aa2a6d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2588,3 +2588,38 @@ (define-public mpark-variant
      "MPark.Variant provides the C++17 std::variant for C++11/14/17.  It is
 based on the implementation of std::variant in libc++.")
     (license license:boost1.0)))
+
+(define-public tsl-hopscotch-map
+  (package
+    (name "tsl-hopscotch-map")
+    (version "2.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Tessil/hopscotch-map")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "012pw37w000pdxdvps0wsqrw6597cm6i6kr5rpl303qmiwqicb2p"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (let ((file (open-file "CMakeLists.txt" "a")))
+                (display "\nenable_testing()\nadd_subdirectory(tests)" file)
+                (close-port file))
+              (substitute* "tests/CMakeLists.txt"
+                (("set\\(Boost_USE_STATIC_LIBS.*") "")
+                (("add_subdirectory\\(\\.\\..*")
+                 "add_test(tsl_hopscotch_map_tests tsl_hopscotch_map_tests)\n")))))))
+    (native-inputs (list boost))
+    (home-page "https://github.com/Tessil/hopscotch-map")
+    (synopsis "C++ implementation of a hash map and hash set using hopscotch hashing")
+    (description "This package provides a C++ implementation of a hash map and
+a hash set using open-addressing and hopscotch hashing to resolve
+collisions.")
+    (license license:expat)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 3/8] gnu: Add tsl-sparse-map.
  2023-06-18 20:47   ` David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 2/8] gnu: Add tsl-hopscotch-map David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 4/8] gnu: Add tsl-ordered-map David Elsing
                       ` (5 subsequent siblings)
  8 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tsl-sparse-map): New variable.
---
 gnu/packages/cpp.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 7878aa2a6d..6f558d1f5b 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2623,3 +2623,37 @@ (define-public tsl-hopscotch-map
 a hash set using open-addressing and hopscotch hashing to resolve
 collisions.")
     (license license:expat)))
+
+(define-public tsl-sparse-map
+  (package
+    (name "tsl-sparse-map")
+    (version "0.6.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Tessil/sparse-map")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "0rb7w0hzsj4qbm0dff1niaf75aag9lj0xqhgb3vg5h9hfic62ic2"))
+              (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (let ((file (open-file "CMakeLists.txt" "a")))
+                (display "\nenable_testing()\nadd_subdirectory(tests)" file)
+                (close-port file))
+              (substitute* "tests/CMakeLists.txt"
+                (("set\\(Boost_USE_STATIC_LIBS.*") "")
+                (("add_subdirectory\\(\\.\\..*")
+                 "add_test(tsl_sparse_map_tests tsl_sparse_map_tests)\n")))))))
+    (native-inputs (list boost))
+    (home-page "https://github.com/Tessil/sparse-map")
+    (synopsis "C++ implementation of a memory efficient hash map and hash set")
+    (description "This package provides a C++ implementation of a hash map and
+a hash set with focus on memory efficiency.")
+    (license license:expat)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 4/8] gnu: Add tsl-ordered-map.
  2023-06-18 20:47   ` David Elsing
                       ` (2 preceding siblings ...)
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 3/8] gnu: Add tsl-sparse-map David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 5/8] gnu: Add tl-optional David Elsing
                       ` (4 subsequent siblings)
  8 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tsl-ordered-map): New variable.
---
 gnu/packages/cpp.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6f558d1f5b..f1d7e89537 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2657,3 +2657,37 @@ (define-public tsl-sparse-map
     (description "This package provides a C++ implementation of a hash map and
 a hash set with focus on memory efficiency.")
     (license license:expat)))
+
+(define-public tsl-ordered-map
+  (package
+    (name "tsl-ordered-map")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Tessil/ordered-map")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0bz5zgabalb7z0j9scng4zmi95hy7iasry5gz15x6y6dsdz0qf3j"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (let ((file (open-file "CMakeLists.txt" "a")))
+                (display "\nenable_testing()\nadd_subdirectory(tests)" file)
+                (close-port file))
+              (substitute* "tests/CMakeLists.txt"
+                (("set\\(Boost_USE_STATIC_LIBS.*") "")
+                (("add_subdirectory\\(\\.\\..*")
+                 "add_test(tsl_ordered_map_tests tsl_ordered_map_tests)\n")))))))
+    (native-inputs (list boost))
+    (home-page "https://github.com/Tessil/ordered-map")
+    (synopsis "C++ hash map and hash set which preserve the order of insertion")
+    (description "This package provides a C++ implementation of a hash map and
+a hash set which preserve the order of insertion.")
+    (license license:expat)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 5/8] gnu: Add tl-optional.
  2023-06-18 20:47   ` David Elsing
                       ` (3 preceding siblings ...)
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 4/8] gnu: Add tsl-ordered-map David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 6/8] gnu: clingo: Unbundle dependencies David Elsing
                       ` (3 subsequent siblings)
  8 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tl-optional): New variable.
---
 gnu/packages/cpp.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index f1d7e89537..2fe7f477ce 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2691,3 +2691,35 @@ (define-public tsl-ordered-map
     (description "This package provides a C++ implementation of a hash map and
 a hash set which preserve the order of insertion.")
     (license license:expat)))
+
+(define-public tl-optional
+  (package
+    (name "tl-optional")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/TartanLlama/optional")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0qkjplmhilbi1iqxx3pz0grcx5355ymk6wwd4h4309mk156xgx2q"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("FetchContent_Declare.*") "")
+                ((".*http.*catchorg/Catch2.*") "")
+                (("FetchContent_MakeAvailable\\(Catch2\\)")
+                 "find_package(Catch2 REQUIRED)")))))))
+    (native-inputs (list catch2))
+    (home-page "https://github.com/TartanLlama/optional")
+    (synopsis "C++11/14/17 implementation of std::optional with extensions")
+    (description "tl-optional is a single-header implementation of
+std::optional with functional-style extensions and support for references.")
+    (license license:cc0)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 6/8] gnu: clingo: Unbundle dependencies.
  2023-06-18 20:47   ` David Elsing
                       ` (4 preceding siblings ...)
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 5/8] gnu: Add tl-optional David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-22  4:19       ` Liliana Marie Prikler
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 7/8] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
                       ` (2 subsequent siblings)
  8 siblings, 1 reply; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/potassco.scm: (clingo)
[arguments]<#:phases>: Patch CMakeLists.txt files to use external dependencies.
[native-inputs]: Add mpark-variant, tl-optional, tsl-hopscotch-map,
tsl-ordered-map and tsl-sparse-map.
---
 gnu/packages/potassco.scm | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index 03d243cdc7..b8e51e7d47 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022, 2023 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@ (define-module (gnu packages potassco)
   #:use-module (guix build-system python)
   #:use-module (guix build-system pyproject)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages pkg-config)
@@ -153,8 +155,7 @@ (define-public clingo
               (snippet
                #~(begin
                    (delete-file-recursively "clasp")
-                   ;; TODO: Unvendor other third-party stuff
-                   (delete-file-recursively "third_party/catch")))
+                   (delete-file-recursively "third_party")))
               (sha256
                (base32
                 "19s59ndcm2yj0kxlikfxnx2bmp6b7n31wq1zvwc7hyk37rqarwys"))))
@@ -173,12 +174,22 @@ (define-public clingo
             (lambda _
               (substitute* "CMakeLists.txt"
                 (("add_subdirectory\\(clasp\\)")
-                 "find_package(clasp REQUIRED)"))
+                 "find_package(clasp REQUIRED)")
+                (("add_subdirectory\\(third_party\\)")
+                 (string-append
+                  "find_package(tsl-hopscotch-map)\n"
+                  "find_package(tl-optional)\n"
+                  "find_package(mpark_variant)\n"
+                  "find_package(tsl-sparse-map)\n"
+                  "find_package(tsl-ordered-map)\n"
+                  "find_package(Catch2 3 REQUIRED)")))
               (substitute* "libclingo/CMakeLists.txt"
                 (("\"cmake/Clingo\"") "\"cmake/clingo\"")
                 (("ClingoConfig\\.cmake") "clingo-config.cmake")
                 (("ClingoConfigVersion\\.cmake")
                  "clingo-config-version.cmake"))
+              (substitute* "libgringo/CMakeLists.txt"
+                (("mpark::variant") "mpark_variant"))
               (substitute* "cmake/ClingoConfig.cmake.in"
                 (("find_package\\(Clasp") "find_package(clasp"))
               (rename-file "cmake/ClingoConfig.cmake.in"
@@ -199,7 +210,12 @@ (define-public clingo
                                 "propagator" "propgator-sequence-mining"
                                 "symbol" "visitor"))))))))))
     (inputs (list catch2-3.1 clasp libpotassco))
-    (native-inputs (list pkg-config))
+    (native-inputs (list mpark-variant
+                         pkg-config
+                         tl-optional
+                         tsl-hopscotch-map
+                         tsl-ordered-map
+                         tsl-sparse-map))
     (home-page "https://potassco.org/")
     (synopsis "Grounder and solver for logic programs")
     (description "Clingo computes answer sets for a given logic program.")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 7/8] gnu: catch2-3.1: Rename to catch2-3.3.
  2023-06-18 20:47   ` David Elsing
                       ` (5 preceding siblings ...)
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 6/8] gnu: clingo: Unbundle dependencies David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-22  4:20       ` Liliana Marie Prikler
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 8/8] gnu: Add catch2-static-3.3 David Elsing
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
  8 siblings, 1 reply; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/check.scm (catch2-3.1): Rename to catch2-3.3.
* gnu/packages/potassco.scm (clingo): Adjust accordingly.
---
 gnu/packages/check.scm    | 70 +++++----------------------------------
 gnu/packages/potassco.scm |  2 +-
 2 files changed, 10 insertions(+), 62 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..512b2ac070 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -38,7 +38,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
@@ -596,10 +596,10 @@ (define-public cbehave
 pattern.")
       (license license:apsl2))))
 
-(define-public catch2-3.1
+(define-public catch2-3.3
   (package
     (name "catch2")
-    (version "3.1.1")
+    (version "3.3.2")
     (home-page "https://github.com/catchorg/Catch2")
     (source (origin
               (method git-fetch)
@@ -609,66 +609,14 @@ (define-public catch2-3.1
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1qnr5b3zq8brh43f924rgnw5gmmjf9ax7kbq2crz1mlwgmdymxlp"))))
-    (outputs (list "out" "static"))
-    (build-system meson-build-system)
+                "0m6i3lr0qk303ashjpz5vpwmxf76n5d6s8jq6r6kcy6gph525zmp"))))
+    (build-system cmake-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$"))))))))
+      #:configure-flags
+      #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
+              "-DENABLE_WERROR=OFF"
+              "-DBUILD_SHARED_LIBS=ON")))
     (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
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index b8e51e7d47..4e7d715e39 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -209,7 +209,7 @@ (define-public clingo
                                 "unpool-ast-v2" "parse_term"
                                 "propagator" "propgator-sequence-mining"
                                 "symbol" "visitor"))))))))))
-    (inputs (list catch2-3.1 clasp libpotassco))
+    (inputs (list catch2-3.3 clasp libpotassco))
     (native-inputs (list mpark-variant
                          pkg-config
                          tl-optional
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 8/8] gnu: Add catch2-static-3.3.
  2023-06-18 20:47   ` David Elsing
                       ` (6 preceding siblings ...)
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 7/8] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
@ 2023-06-18 20:53     ` David Elsing
  2023-06-22  4:24       ` Liliana Marie Prikler
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
  8 siblings, 1 reply; 29+ messages in thread
From: David Elsing @ 2023-06-18 20:53 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/check.scm (catch2-static-3.3): New variable.
---
 gnu/packages/check.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 512b2ac070..7986f58cc1 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -623,6 +623,17 @@ (define-public catch2-3.3
 a multi-paradigm automated test framework for C++ and Objective-C.")
     (license license:boost1.0)))
 
+(define-public catch2-static-3.3
+  (let ((base catch2-3.3))
+    (package
+      (inherit base)
+      (name "catch2-static")
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:configure-flags flags)
+          #~(cons* "-DBUILD_SHARED_LIBS=OFF"
+                   (delete "-DBUILD_SHARED_LIBS=ON" #$flags))))))))
+
 (define-public cmdtest
   (package
     (name "cmdtest")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant.
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant David Elsing
@ 2023-06-22  4:16       ` Liliana Marie Prikler
  0 siblings, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-22  4:16 UTC (permalink / raw)
  To: David Elsing, 64137

Am Sonntag, dem 18.06.2023 um 20:53 +0000 schrieb David Elsing:
> * gnu/packages/cpp.scm (mpark-variant): New variable.
> ---
>  gnu/packages/cpp.scm | 37 ++++++++++++++++++++++++++++++++++++-
>  1 file changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
> index 39a34c20dd..5a6298fc4d 100644
> --- a/gnu/packages/cpp.scm
> +++ b/gnu/packages/cpp.scm
> @@ -29,7 +29,7 @@
>  ;;; Copyright © 2022 muradm <mail@muradm.net>
>  ;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name>
>  ;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
> -;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
> +;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
>  ;;; Copyright © 2022, 2023 Zheng Junjie <873216071@qq.com>
>  ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
>  ;;; Copyright © 2023 Sughosha <Sughosha@proton.me>
> @@ -2553,3 +2553,38 @@ (define-public ftxui
>  @item No dependencies.
>  @end itemize")
>      (license license:expat)))
> +
> +(define-public mpark-variant
> +  (package
> +    (name "mpark-variant")
> +    (version "1.4.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/mpark/variant")
> +                    (commit (string-append "v" version))))
> +              (sha256
> +               (base32
> +               
> "0gz8d5qprlfqb42cfyyc4nbwhgarhw027a9nr52h3gbdn560j0j4"))
> +              (file-name (git-file-name name version))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     (list
> +      #:configure-flags #~(list "-
> DMPARK_VARIANT_INCLUDE_TESTS=mpark")
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'unpack 'find-googletest
> +            (lambda _
> +              (substitute* "test/CMakeLists.txt"
> +                (("add_subdirectory.*3rdparty/googletest.*\n")
> +                 "find_package(GTest REQUIRED)\n")
> +                ((".*3rdparty/googletest.*\n") "")
> +                ((".*config_compiler_and_linker.*\n") "")
> +                (("gtest_main") "gtest gtest_main")))))))
> +    (native-inputs (list googletest))
> +    (home-page "https://github.com/mpark/variant")
> +    (synopsis "Implementation of the C++17 std::variant for
> C++11/14/17")
Could probably be shortened to std::variant for C++11/14[/17]
> +    (description
> +     "MPark.Variant provides the C++17 std::variant for
> C++11/14/17.  It is
> +based on the implementation of std::variant in libc++.")
> +    (license license:boost1.0)))

Otherwise LGTM.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 2/8] gnu: Add tsl-hopscotch-map.
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 2/8] gnu: Add tsl-hopscotch-map David Elsing
@ 2023-06-22  4:18       ` Liliana Marie Prikler
  0 siblings, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-22  4:18 UTC (permalink / raw)
  To: David Elsing, 64137

Am Sonntag, dem 18.06.2023 um 20:53 +0000 schrieb David Elsing:
> * gnu/packages/cpp.scm (tsl-hopscotch-map): New variable.
> ---
>  gnu/packages/cpp.scm | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
> index 5a6298fc4d..7878aa2a6d 100644
> --- a/gnu/packages/cpp.scm
> +++ b/gnu/packages/cpp.scm
> @@ -2588,3 +2588,38 @@ (define-public mpark-variant
>       "MPark.Variant provides the C++17 std::variant for
> C++11/14/17.  It is
>  based on the implementation of std::variant in libc++.")
>      (license license:boost1.0)))
> +
> +(define-public tsl-hopscotch-map
> +  (package
> +    (name "tsl-hopscotch-map")
> +    (version "2.3.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/Tessil/hopscotch-map")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "012pw37w000pdxdvps0wsqrw6597cm6i6kr5rpl303qmiwqicb2p"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     (list
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'unpack 'patch-cmake-test
> +            (lambda _
> +              (let ((file (open-file "CMakeLists.txt" "a")))
> +                (display
> "\nenable_testing()\nadd_subdirectory(tests)" file)
> +                (close-port file))
> +              (substitute* "tests/CMakeLists.txt"
> +                (("set\\(Boost_USE_STATIC_LIBS.*") "")
> +                (("add_subdirectory\\(\\.\\..*")
> +                 "add_test(tsl_hopscotch_map_tests
> tsl_hopscotch_map_tests)\n")))))))
> +    (native-inputs (list boost))
> +    (home-page "https://github.com/Tessil/hopscotch-map")
> +    (synopsis "C++ implementation of a hash map and hash set using
> hopscotch hashing")
Should be shortened to fit on a single line.
> +    (description "This package provides a C++ implementation of a
> hash map and
> +a hash set using open-addressing and hopscotch hashing to resolve
> +collisions.")
The description ought to provide a little more information than the
synopsis :)
Same basically holds for packages 3..5, so I won't repeat myself.

Cheers

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 6/8] gnu: clingo: Unbundle dependencies.
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 6/8] gnu: clingo: Unbundle dependencies David Elsing
@ 2023-06-22  4:19       ` Liliana Marie Prikler
  0 siblings, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-22  4:19 UTC (permalink / raw)
  To: David Elsing, 64137

Am Sonntag, dem 18.06.2023 um 20:53 +0000 schrieb David Elsing:
> * gnu/packages/potassco.scm: (clingo)
> [arguments]<#:phases>: Patch CMakeLists.txt files to use external
> dependencies.
You can shorten this to (clingo)[#:phases] to not have the weird line
break.
> [native-inputs]: Add mpark-variant, tl-optional, tsl-hopscotch-map,
> tsl-ordered-map and tsl-sparse-map.
LGTM.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 7/8] gnu: catch2-3.1: Rename to catch2-3.3.
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 7/8] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
@ 2023-06-22  4:20       ` Liliana Marie Prikler
  0 siblings, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-22  4:20 UTC (permalink / raw)
  To: David Elsing, 64137

Am Sonntag, dem 18.06.2023 um 20:53 +0000 schrieb David Elsing:
> * gnu/packages/check.scm (catch2-3.1): Rename to catch2-3.3.
> * gnu/packages/potassco.scm (clingo): Adjust accordingly.
This ChangeLog does not nearly explain the stuff that was changed in
the patch.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v2 8/8] gnu: Add catch2-static-3.3.
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 8/8] gnu: Add catch2-static-3.3 David Elsing
@ 2023-06-22  4:24       ` Liliana Marie Prikler
  0 siblings, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-22  4:24 UTC (permalink / raw)
  To: David Elsing, 64137

Am Sonntag, dem 18.06.2023 um 20:53 +0000 schrieb David Elsing:
> * gnu/packages/check.scm (catch2-static-3.3): New variable.
Having an extra package for static catch seems overkill to me.  Since
afaik there are no actual users, you can simply omit this patch, but if
you do have a use case for static catch, I highly recommend going with
the current meson approach, as CMake seems unable to do both_libraries.

Cheers




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2
  2023-06-18 20:47   ` David Elsing
                       ` (7 preceding siblings ...)
  2023-06-18 20:53     ` [bug#64137] [PATCH v2 8/8] gnu: Add catch2-static-3.3 David Elsing
@ 2023-06-25 10:01     ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 1/7] gnu: Add mpark-variant David Elsing
                         ` (7 more replies)
  8 siblings, 8 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:01 UTC (permalink / raw)
  To: Liliana Marie Prikler, 64137

Thanks for your comments, here are the updated patches. I removed the
cmake-static package as I also don't have any need for it.




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 1/7] gnu: Add mpark-variant.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 2/7] gnu: Add tsl-hopscotch-map David Elsing
                         ` (6 subsequent siblings)
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (mpark-variant): New variable.
---
 gnu/packages/cpp.scm | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 39a34c20dd..8139a9d083 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -29,7 +29,7 @@
 ;;; Copyright © 2022 muradm <mail@muradm.net>
 ;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name>
 ;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022, 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Sughosha <Sughosha@proton.me>
@@ -2553,3 +2553,38 @@ (define-public ftxui
 @item No dependencies.
 @end itemize")
     (license license:expat)))
+
+(define-public mpark-variant
+  (package
+    (name "mpark-variant")
+    (version "1.4.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/mpark/variant")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "0gz8d5qprlfqb42cfyyc4nbwhgarhw027a9nr52h3gbdn560j0j4"))
+              (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:configure-flags #~(list "-DMPARK_VARIANT_INCLUDE_TESTS=mpark")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'find-googletest
+            (lambda _
+              (substitute* "test/CMakeLists.txt"
+                (("add_subdirectory.*3rdparty/googletest.*\n")
+                 "find_package(GTest REQUIRED)\n")
+                ((".*3rdparty/googletest.*\n") "")
+                ((".*config_compiler_and_linker.*\n") "")
+                (("gtest_main") "gtest gtest_main")))))))
+    (native-inputs (list googletest))
+    (home-page "https://github.com/mpark/variant")
+    (synopsis "Implementation of std::variant for C++11/14/17")
+    (description
+     "MPark.Variant provides the C++17 std::variant for C++11/14/17.  It is
+based on the implementation of std::variant in libc++.")
+    (license license:boost1.0)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 2/7] gnu: Add tsl-hopscotch-map.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 1/7] gnu: Add mpark-variant David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 3/7] gnu: Add tsl-sparse-map David Elsing
                         ` (5 subsequent siblings)
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tsl-hopscotch-map): New variable.
---
 gnu/packages/cpp.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 8139a9d083..afa0878bb7 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2588,3 +2588,39 @@ (define-public mpark-variant
      "MPark.Variant provides the C++17 std::variant for C++11/14/17.  It is
 based on the implementation of std::variant in libc++.")
     (license license:boost1.0)))
+
+(define-public tsl-hopscotch-map
+  (package
+    (name "tsl-hopscotch-map")
+    (version "2.3.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Tessil/hopscotch-map")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "012pw37w000pdxdvps0wsqrw6597cm6i6kr5rpl303qmiwqicb2p"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (let ((file (open-file "CMakeLists.txt" "a")))
+                (display "\nenable_testing()\nadd_subdirectory(tests)" file)
+                (close-port file))
+              (substitute* "tests/CMakeLists.txt"
+                (("set\\(Boost_USE_STATIC_LIBS.*") "")
+                (("add_subdirectory\\(\\.\\..*")
+                 "add_test(tsl_hopscotch_map_tests tsl_hopscotch_map_tests)\n")))))))
+    (native-inputs (list boost))
+    (home-page "https://github.com/Tessil/hopscotch-map")
+    (synopsis "Hash maps and hash sets using hopscotch hashing in C++")
+    (description "This package provides a C++ implementation of several hash
+map and a hash set variants using open addressing and hopscotch hashing to
+resolve collisions.  It is intended to be fast and provides additional
+features, such as heterogeneous lookups and different growth policies.")
+    (license license:expat)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 3/7] gnu: Add tsl-sparse-map.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 1/7] gnu: Add mpark-variant David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 2/7] gnu: Add tsl-hopscotch-map David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 4/7] gnu: Add tsl-ordered-map David Elsing
                         ` (4 subsequent siblings)
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tsl-sparse-map): New variable.
---
 gnu/packages/cpp.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index afa0878bb7..adf9e5b2f0 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2624,3 +2624,39 @@ (define-public tsl-hopscotch-map
 resolve collisions.  It is intended to be fast and provides additional
 features, such as heterogeneous lookups and different growth policies.")
     (license license:expat)))
+
+(define-public tsl-sparse-map
+  (package
+    (name "tsl-sparse-map")
+    (version "0.6.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Tessil/sparse-map")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "0rb7w0hzsj4qbm0dff1niaf75aag9lj0xqhgb3vg5h9hfic62ic2"))
+              (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (let ((file (open-file "CMakeLists.txt" "a")))
+                (display "\nenable_testing()\nadd_subdirectory(tests)" file)
+                (close-port file))
+              (substitute* "tests/CMakeLists.txt"
+                (("set\\(Boost_USE_STATIC_LIBS.*") "")
+                (("add_subdirectory\\(\\.\\..*")
+                 "add_test(tsl_sparse_map_tests tsl_sparse_map_tests)\n")))))))
+    (native-inputs (list boost))
+    (home-page "https://github.com/Tessil/sparse-map")
+    (synopsis "Memory efficient hash map and hash set in C++")
+    (description "This package provides a C++ implementation of a hash map and
+a hash set with open addressing and sparse quadratic probing.  It is intended
+to be memory efficient and provides additional features, such as heterogeneous
+lookups and different growth policies.")
+    (license license:expat)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 4/7] gnu: Add tsl-ordered-map.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
                         ` (2 preceding siblings ...)
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 3/7] gnu: Add tsl-sparse-map David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 5/7] gnu: Add tl-optional David Elsing
                         ` (3 subsequent siblings)
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tsl-ordered-map): New variable.
---
 gnu/packages/cpp.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index adf9e5b2f0..efce934e6d 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2660,3 +2660,39 @@ (define-public tsl-sparse-map
 to be memory efficient and provides additional features, such as heterogeneous
 lookups and different growth policies.")
     (license license:expat)))
+
+(define-public tsl-ordered-map
+  (package
+    (name "tsl-ordered-map")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Tessil/ordered-map")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0bz5zgabalb7z0j9scng4zmi95hy7iasry5gz15x6y6dsdz0qf3j"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (let ((file (open-file "CMakeLists.txt" "a")))
+                (display "\nenable_testing()\nadd_subdirectory(tests)" file)
+                (close-port file))
+              (substitute* "tests/CMakeLists.txt"
+                (("set\\(Boost_USE_STATIC_LIBS.*") "")
+                (("add_subdirectory\\(\\.\\..*")
+                 "add_test(tsl_ordered_map_tests tsl_ordered_map_tests)\n")))))))
+    (native-inputs (list boost))
+    (home-page "https://github.com/Tessil/ordered-map")
+    (synopsis "Hash map and hash set which preserve the order of insertion in C++")
+    (description "This package provides a C++ implementation of a hash map and
+a hash set which preserve the order of insertion.  It is intended for
+efficient ordered insertions and lookup, while sacrifing performance for
+ordered erase operations.")
+    (license license:expat)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 5/7] gnu: Add tl-optional.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
                         ` (3 preceding siblings ...)
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 4/7] gnu: Add tsl-ordered-map David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 6/7] gnu: clingo: Unbundle dependencies David Elsing
                         ` (2 subsequent siblings)
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/cpp.scm (tl-optional): New variable.
---
 gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index efce934e6d..7e89b9d80a 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2696,3 +2696,36 @@ (define-public tsl-ordered-map
 efficient ordered insertions and lookup, while sacrifing performance for
 ordered erase operations.")
     (license license:expat)))
+
+(define-public tl-optional
+  (package
+    (name "tl-optional")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/TartanLlama/optional")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0qkjplmhilbi1iqxx3pz0grcx5355ymk6wwd4h4309mk156xgx2q"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-cmake-test
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("FetchContent_Declare.*") "")
+                ((".*http.*catchorg/Catch2.*") "")
+                (("FetchContent_MakeAvailable\\(Catch2\\)")
+                 "find_package(Catch2 REQUIRED)")))))))
+    (native-inputs (list catch2))
+    (home-page "https://github.com/TartanLlama/optional")
+    (synopsis "Implementation of std::optional with extensions for C++11/14/17")
+    (description "tl-optional provides a single-header implementation of the
+C++17 std::optional for C++11/14/17.  It includes functional-style extensions
+and support for references.")
+    (license license:cc0)))
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 6/7] gnu: clingo: Unbundle dependencies.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
                         ` (4 preceding siblings ...)
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 5/7] gnu: Add tl-optional David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 7/7] gnu: catch2-3.1: Rename to catch2-3.3 and update to 3.3.2 David Elsing
  2023-06-25 16:06       ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake " Liliana Marie Prikler
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/potassco.scm: (clingo)[#:phases]: Patch CMakeLists.txt files to
use external dependencies.
[native-inputs]: Add mpark-variant, tl-optional, tsl-hopscotch-map,
tsl-ordered-map and tsl-sparse-map.
---
 gnu/packages/potassco.scm | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index 03d243cdc7..b8e51e7d47 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022, 2023 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@ (define-module (gnu packages potassco)
   #:use-module (guix build-system python)
   #:use-module (guix build-system pyproject)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cpp)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages pkg-config)
@@ -153,8 +155,7 @@ (define-public clingo
               (snippet
                #~(begin
                    (delete-file-recursively "clasp")
-                   ;; TODO: Unvendor other third-party stuff
-                   (delete-file-recursively "third_party/catch")))
+                   (delete-file-recursively "third_party")))
               (sha256
                (base32
                 "19s59ndcm2yj0kxlikfxnx2bmp6b7n31wq1zvwc7hyk37rqarwys"))))
@@ -173,12 +174,22 @@ (define-public clingo
             (lambda _
               (substitute* "CMakeLists.txt"
                 (("add_subdirectory\\(clasp\\)")
-                 "find_package(clasp REQUIRED)"))
+                 "find_package(clasp REQUIRED)")
+                (("add_subdirectory\\(third_party\\)")
+                 (string-append
+                  "find_package(tsl-hopscotch-map)\n"
+                  "find_package(tl-optional)\n"
+                  "find_package(mpark_variant)\n"
+                  "find_package(tsl-sparse-map)\n"
+                  "find_package(tsl-ordered-map)\n"
+                  "find_package(Catch2 3 REQUIRED)")))
               (substitute* "libclingo/CMakeLists.txt"
                 (("\"cmake/Clingo\"") "\"cmake/clingo\"")
                 (("ClingoConfig\\.cmake") "clingo-config.cmake")
                 (("ClingoConfigVersion\\.cmake")
                  "clingo-config-version.cmake"))
+              (substitute* "libgringo/CMakeLists.txt"
+                (("mpark::variant") "mpark_variant"))
               (substitute* "cmake/ClingoConfig.cmake.in"
                 (("find_package\\(Clasp") "find_package(clasp"))
               (rename-file "cmake/ClingoConfig.cmake.in"
@@ -199,7 +210,12 @@ (define-public clingo
                                 "propagator" "propgator-sequence-mining"
                                 "symbol" "visitor"))))))))))
     (inputs (list catch2-3.1 clasp libpotassco))
-    (native-inputs (list pkg-config))
+    (native-inputs (list mpark-variant
+                         pkg-config
+                         tl-optional
+                         tsl-hopscotch-map
+                         tsl-ordered-map
+                         tsl-sparse-map))
     (home-page "https://potassco.org/")
     (synopsis "Grounder and solver for logic programs")
     (description "Clingo computes answer sets for a given logic program.")
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v3 7/7] gnu: catch2-3.1: Rename to catch2-3.3 and update to 3.3.2.
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
                         ` (5 preceding siblings ...)
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 6/7] gnu: clingo: Unbundle dependencies David Elsing
@ 2023-06-25 10:03       ` David Elsing
  2023-06-25 16:06       ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake " Liliana Marie Prikler
  7 siblings, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-25 10:03 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/check.scm (catch2-3.1): Rename to catch2-3.3 and update to 3.3.2.
[outputs] Only use 'out' output.
[build-system] Use cmake-build-system.
[arguments]: Remove special phases. Add CMake options to #:configure-flags.
* gnu/packages/potassco.scm (clingo): Adjust accordingly.
---
 gnu/packages/check.scm    | 70 +++++----------------------------------
 gnu/packages/potassco.scm |  2 +-
 2 files changed, 10 insertions(+), 62 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..512b2ac070 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -38,7 +38,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
@@ -596,10 +596,10 @@ (define-public cbehave
 pattern.")
       (license license:apsl2))))
 
-(define-public catch2-3.1
+(define-public catch2-3.3
   (package
     (name "catch2")
-    (version "3.1.1")
+    (version "3.3.2")
     (home-page "https://github.com/catchorg/Catch2")
     (source (origin
               (method git-fetch)
@@ -609,66 +609,14 @@ (define-public catch2-3.1
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1qnr5b3zq8brh43f924rgnw5gmmjf9ax7kbq2crz1mlwgmdymxlp"))))
-    (outputs (list "out" "static"))
-    (build-system meson-build-system)
+                "0m6i3lr0qk303ashjpz5vpwmxf76n5d6s8jq6r6kcy6gph525zmp"))))
+    (build-system cmake-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$"))))))))
+      #:configure-flags
+      #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
+              "-DENABLE_WERROR=OFF"
+              "-DBUILD_SHARED_LIBS=ON")))
     (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
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index b8e51e7d47..4e7d715e39 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -209,7 +209,7 @@ (define-public clingo
                                 "unpool-ast-v2" "parse_term"
                                 "propagator" "propgator-sequence-mining"
                                 "symbol" "visitor"))))))))))
-    (inputs (list catch2-3.1 clasp libpotassco))
+    (inputs (list catch2-3.3 clasp libpotassco))
     (native-inputs (list mpark-variant
                          pkg-config
                          tl-optional
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2
  2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
                         ` (6 preceding siblings ...)
  2023-06-25 10:03       ` [bug#64137] [PATCH v3 7/7] gnu: catch2-3.1: Rename to catch2-3.3 and update to 3.3.2 David Elsing
@ 2023-06-25 16:06       ` Liliana Marie Prikler
       [not found]         ` <7ycz1f350w.fsf@posteo.net>
  7 siblings, 1 reply; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-06-25 16:06 UTC (permalink / raw)
  To: David Elsing, 64137

Am Sonntag, dem 25.06.2023 um 10:01 +0000 schrieb David Elsing:
> Thanks for your comments, here are the updated patches. I removed the
> cmake-static package as I also don't have any need for it.
Thanks for the updates.  I do have some minor changes for the synopses
and descriptions, but nothing major.  I'll push them once CI lights
green or next weekend :)




^ permalink raw reply	[flat|nested] 29+ messages in thread

* [bug#64137] [PATCH v4] gnu: catch2-3.1: Rename to catch2-3.3 and update to 3.3.2.
       [not found]         ` <7ycz1f350w.fsf@posteo.net>
@ 2023-06-28 16:51           ` David Elsing
  2023-07-01 10:41           ` bug#64137: [PATCH 0/2] Build catch2@3 with CMake " Liliana Marie Prikler
  1 sibling, 0 replies; 29+ messages in thread
From: David Elsing @ 2023-06-28 16:51 UTC (permalink / raw)
  To: 64137; +Cc: David Elsing

* gnu/packages/check.scm (catch2-3.1): Rename to catch2-3.3 and update to 3.3.2.
[outputs] Only use 'out' output.
[build-system] Use cmake-build-system.
[arguments]: Remove special phases. Add CMake options to #:configure-flags.
* gnu/packages/potassco.scm (clingo): Adjust accordingly.
---
 gnu/packages/check.scm    | 70 +++++----------------------------------
 gnu/packages/potassco.scm |  2 +-
 2 files changed, 10 insertions(+), 62 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..0d4c117f6f 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -38,7 +38,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
@@ -596,10 +596,10 @@ (define-public cbehave
 pattern.")
       (license license:apsl2))))
 
-(define-public catch2-3.1
+(define-public catch2-3.3
   (package
     (name "catch2")
-    (version "3.1.1")
+    (version "3.3.2")
     (home-page "https://github.com/catchorg/Catch2")
     (source (origin
               (method git-fetch)
@@ -609,66 +609,14 @@ (define-public catch2-3.1
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1qnr5b3zq8brh43f924rgnw5gmmjf9ax7kbq2crz1mlwgmdymxlp"))))
-    (outputs (list "out" "static"))
-    (build-system meson-build-system)
+                "0m6i3lr0qk303ashjpz5vpwmxf76n5d6s8jq6r6kcy6gph525zmp"))))
+    (build-system cmake-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$"))))))))
+      #:configure-flags
+      #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
+              "-DCATCH_ENABLE_WERROR=OFF"
+              "-DBUILD_SHARED_LIBS=ON")))
     (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
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index b8e51e7d47..4e7d715e39 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -209,7 +209,7 @@ (define-public clingo
                                 "unpool-ast-v2" "parse_term"
                                 "propagator" "propgator-sequence-mining"
                                 "symbol" "visitor"))))))))))
-    (inputs (list catch2-3.1 clasp libpotassco))
+    (inputs (list catch2-3.3 clasp libpotassco))
     (native-inputs (list mpark-variant
                          pkg-config
                          tl-optional
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 29+ messages in thread

* bug#64137: [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2
       [not found]         ` <7ycz1f350w.fsf@posteo.net>
  2023-06-28 16:51           ` [bug#64137] [PATCH v4] gnu: catch2-3.1: Rename to catch2-3.3 " David Elsing
@ 2023-07-01 10:41           ` Liliana Marie Prikler
  1 sibling, 0 replies; 29+ messages in thread
From: Liliana Marie Prikler @ 2023-07-01 10:41 UTC (permalink / raw)
  To: David Elsing; +Cc: 64137-done

Am Mittwoch, dem 28.06.2023 um 16:50 +0000 schrieb David Elsing:
> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
> 
> > Am Sonntag, dem 25.06.2023 um 10:01 +0000 schrieb David Elsing:
> > > Thanks for your comments, here are the updated patches. I removed
> > > the
> > > cmake-static package as I also don't have any need for it.
> > Thanks for the updates.  I do have some minor changes for the
> > synopses and descriptions, but nothing major.  I'll push them once
> > CI lights green or next weekend :)
> Ok, thanks!
> On armhf-linux, there is an error (warning) from -Werror=cast-align
> because an unsigned char* is cast to std::string*, but this is fine
> because the unsigned char array it points to is declared with
> alignas. I accidentally set -DENABLE_WERROR=OFF instead of
> -DCATCH_ENABLE_WERROR=OFF, but now the build succeeds.
Pushed and followed up with a commit that does that.

Cheers




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2023-07-01 10:42 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-17 19:27 [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
2023-06-17 19:30 ` [bug#64137] [PATCH 1/2] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
2023-06-17 19:30 ` [bug#64137] [PATCH 2/2] gnu: Add catch2-static-3.3 David Elsing
2023-06-18  6:55 ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 Liliana Marie Prikler
2023-06-18 20:47   ` David Elsing
2023-06-18 20:53     ` [bug#64137] [PATCH v2 1/8] gnu: Add mpark-variant David Elsing
2023-06-22  4:16       ` Liliana Marie Prikler
2023-06-18 20:53     ` [bug#64137] [PATCH v2 2/8] gnu: Add tsl-hopscotch-map David Elsing
2023-06-22  4:18       ` Liliana Marie Prikler
2023-06-18 20:53     ` [bug#64137] [PATCH v2 3/8] gnu: Add tsl-sparse-map David Elsing
2023-06-18 20:53     ` [bug#64137] [PATCH v2 4/8] gnu: Add tsl-ordered-map David Elsing
2023-06-18 20:53     ` [bug#64137] [PATCH v2 5/8] gnu: Add tl-optional David Elsing
2023-06-18 20:53     ` [bug#64137] [PATCH v2 6/8] gnu: clingo: Unbundle dependencies David Elsing
2023-06-22  4:19       ` Liliana Marie Prikler
2023-06-18 20:53     ` [bug#64137] [PATCH v2 7/8] gnu: catch2-3.1: Rename to catch2-3.3 David Elsing
2023-06-22  4:20       ` Liliana Marie Prikler
2023-06-18 20:53     ` [bug#64137] [PATCH v2 8/8] gnu: Add catch2-static-3.3 David Elsing
2023-06-22  4:24       ` Liliana Marie Prikler
2023-06-25 10:01     ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake and update to 3.3.2 David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 1/7] gnu: Add mpark-variant David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 2/7] gnu: Add tsl-hopscotch-map David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 3/7] gnu: Add tsl-sparse-map David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 4/7] gnu: Add tsl-ordered-map David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 5/7] gnu: Add tl-optional David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 6/7] gnu: clingo: Unbundle dependencies David Elsing
2023-06-25 10:03       ` [bug#64137] [PATCH v3 7/7] gnu: catch2-3.1: Rename to catch2-3.3 and update to 3.3.2 David Elsing
2023-06-25 16:06       ` [bug#64137] [PATCH 0/2] Build catch2@3 with CMake " Liliana Marie Prikler
     [not found]         ` <7ycz1f350w.fsf@posteo.net>
2023-06-28 16:51           ` [bug#64137] [PATCH v4] gnu: catch2-3.1: Rename to catch2-3.3 " David Elsing
2023-07-01 10:41           ` bug#64137: [PATCH 0/2] Build catch2@3 with CMake " Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).