gnu: Add java-openjfx-controls.
[jackhill/guix/guix.git] / gnu / packages / cpp.scm
index 882170a..ce9c950 100644 (file)
@@ -14,8 +14,9 @@
 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
-;;; Copyright © 2020 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
+;;; Copyright © 2020 Milkey Mouse <milkeymouse@meme.institute>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,6 +41,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
+  #:use-module (guix modules)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
@@ -49,6 +51,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web))
 
+(define-public range-v3
+  (package
+    (name "range-v3")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/ericniebler/range-v3.git")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("perl" ,perl)))
+    (inputs
+     `(("boost" ,boost)))
+    (synopsis "Range library for C++14/17/20")
+    (description "Range-v3 is an extension of the Standard Template Library that
+makes its iterators and algorithms more powerful by making them composable.
+Unlike other range-like solutions which, seek to do away with iterators, in
+range-v3 ranges are an abstraction layer on top of iterators.")
+    (home-page "https://github.com/ericniebler/range-v3/")
+    (license
+     (list
+      ;; Elements of Programming
+      (license:x11-style "file:///LICENSE.txt")
+      ;; SGI STL
+      license:sgifreeb2.0
+      ;;; LibC++ (dual-licensed)
+      license:expat
+      license:ncsa
+      ;; Others
+      license:boost1.0))))
+
+(define-public c++-gsl
+  (package
+    (name "c++-gsl")
+    (version "3.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/microsoft/GSL.git")
+         (commit
+          (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (patches
+        (search-patches
+         "c++-gsl-find-system-gtest.patch"))
+       (sha256
+        (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("pkg-config" ,pkg-config)))
+    (synopsis "Guidelines Support Library")
+    (description "c++-gsl contains functions and types that are suggested for
+use by the C++ Core Guidelines maintained by the Standard C++ Foundation.")
+    (home-page "https://github.com/microsoft/GSL/")
+    (license license:expat)))
+
 (define-public libzen
   (package
     (name "libzen")
@@ -334,7 +405,8 @@ as ordering relation.")
     (build-system cmake-build-system)
     (arguments
      '(#:configure-flags
-       (list (string-append "-DJSON_TestDataDirectory="
+       (list "-DJSON_MultipleHeaders=ON" ; For json_fwd.hpp.
+             (string-append "-DJSON_TestDataDirectory="
                             (assoc-ref %build-inputs "json_test_data")))
        #:phases (modify-phases %standard-phases
                   ;; XXX: When tests are enabled, the install phase will cause
@@ -376,7 +448,7 @@ intuitive syntax and trivial integration.")
 (define-public xtl
   (package
     (name "xtl")
-    (version "0.6.21")
+    (version "0.6.23")
     (source (origin
               (method git-fetch)
               (uri
@@ -385,7 +457,7 @@ intuitive syntax and trivial integration.")
                 (commit version)))
               (sha256
                (base32
-                "08xhyy9fm2ddkdrgb1qyd2bs371a2xr7xzar482pwphz27vr035w"))
+                "1kd9zl4h6nrsg29hq13vwp4zhfj8sa90vj40726lpw6vxz48k4di"))
               (file-name (git-file-name name version))))
     (native-inputs
      `(("googletest" ,googletest)
@@ -442,7 +514,7 @@ maintained anymore.")
 (define-public gperftools
   (package
     (name "gperftools")
-    (version "2.8")
+    (version "2.8.1")
     (source
      (origin
        (method git-fetch)
@@ -450,9 +522,13 @@ maintained anymore.")
              (url "https://github.com/gperftools/gperftools")
              (commit (string-append "gperftools-" version))))
        (sha256
-        (base32 "1rnc53kaxlljgbpsff906vdsry9jl9gcvcnmxgkprwzxq1wipyd0"))
+        (base32 "19bj2vlsbfwq7m826v2ccqg47kd7cb5vcz1yw2x0v5qzhaxbakk1"))
        (file-name (git-file-name name version))))
     (build-system gnu-build-system)
+    (arguments
+      ;; The tests are flaky when run in parallel. For more info:
+      ;; https://bugs.gnu.org/46562
+     '(#:parallel-tests? #f))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -688,7 +764,7 @@ standard GNU style syntax for options.")
 (define-public folly
   (package
     (name "folly")
-    (version "2020.10.05.00")
+    (version "2021.01.25.00")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -697,7 +773,7 @@ standard GNU style syntax for options.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0q4w4cvjxffc462hvs8h4zryq4965j7015zvkwagcm6cj6wmz3cn"))))
+                "14dl1g6vf7mc90mcync5h2lp14fwcx8n9h91pmiq6rfgv1fjjrwz"))))
     (build-system cmake-build-system)
     (arguments
      '(;; Tests must be explicitly enabled
@@ -807,3 +883,129 @@ code will be mixed in with the actual programming logic.  This implementation
 provides a number of utilities to make coding with expected cleaner.")
     (home-page "https://tl.tartanllama.xyz/")
     (license license:cc0)))
+
+(define-public magic-enum
+  (package
+    (name "magic-enum")
+    (version "0.7.2")
+    (home-page "https://github.com/Neargye/magic_enum")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "07j5zdf3vkliwrcv6k663k35akn7qp23794sz2mnvkj9hbv9s8cx"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("gcc" ,gcc-9)))
+    (synopsis "C++17 header only library for compile time reflection of enums")
+    (description "Magic Enum offers static reflection of enums, with
+conversions to and from strings, iteration and related functionality.")
+    (license license:expat)))
+
+(define-public cli11
+  (package
+    (name "cli11")
+    (version "1.9.1")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/CLIUtils/CLI11")
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32 "0hbch0vk8irgmiaxnfqlqys65v1770rxxdfn3d23m2vqyjh0j9l6"))
+        (modules '((guix build utils)))
+        (snippet
+         '(begin (delete-file-recursively "extern")
+                 #t))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags
+       '("-DCLI11_SINGLE_FILE=OFF"
+         "-DCLI11_BUILD_EXAMPLES=OFF")
+       #:imported-modules ,%cmake-build-system-modules
+       #:modules ((guix build cmake-build-system)
+                  (guix build utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'no-vendor-gtest
+           (lambda _
+             (substitute* "tests/CMakeLists.txt"
+               ;; We provide our own googletest, so this is not really a
+               ;; problem.
+               (("message\\(FATAL_ERROR \"You have requested")
+                "message(TRACE \"You have requested"))
+             (substitute* "cmake/AddGoogletest.cmake"
+               (("^add_subdirectory\\(.*googletest.*$") "find_package(GTest REQUIRED)")
+               (("^set_target_properties\\(gtest gtest_main gmock gmock_main") "")
+               (("^    PROPERTIES FOLDER \"Extern\"\\)") ""))
+             #t)))))
+    (native-inputs
+     `(("doxygen" ,doxygen)
+       ("googletest" ,googletest)))
+    (synopsis "Command line parser for C++11")
+    (description
+     "CLI11 is a command line parser for C++11 and beyond that provides a rich
+feature set with a simple and intuitive interface.")
+    (home-page "https://cliutils.github.io/CLI11/book/")
+    (license license:bsd-3)))
+
+(define-public caf
+  (package
+    (name "caf")
+    (version "0.18.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/actor-framework/actor-framework")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1c3spd6vm1h9qhlk5c4fdwi6nbqx5vwz2zvv6qp0rj1hx6xpq3cx"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags
+       '("-DCAF_ENABLE_EXAMPLES=OFF")))
+    (inputs
+     `(("openssl" ,openssl)))
+    (synopsis "C++ implementation of the actor model")
+    (description "The C++ Actor Framework (CAF) offers a high-level C++17
+programming environment using the actor model for concurrent, distributed
+computation.")
+    (home-page "https://www.actor-framework.org/")
+    (license license:bsd-3)))
+
+(define-public pcg-cpp
+  (let ((commit "5b5cac8d61339e810c5dbb4692d868a1d7ca1b2d")
+        (revision "1"))
+    (package
+      (name "pcg-cpp")
+      (version (git-version "0.98.1" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/imneme/pcg-cpp")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1s9dcd4iydlc1xj9m6f7c52nlyx99klk043sk7arqy6kp7gdaa33"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:test-target "test"
+         #:phases
+          (modify-phases %standard-phases
+            (delete 'configure))
+         #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
+      (synopsis "C++11 header only library for random number generation")
+      (description "The Permuted Congruential Generator (PCG) extends the
+Linear Congruential Generator (LCG) with a permutation function to increase
+output randomness while retaining speed, simplicity, and conciseness.")
+      (home-page "https://www.pcg-random.org")
+      (license (list license:expat license:asl2.0))))) ; dual licensed