guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add libexpected.


From: guix-commits
Subject: branch master updated: gnu: Add libexpected.
Date: Sat, 05 Dec 2020 22:12:41 -0500

This is an automated email from the git hooks/post-receive script.

brettgilio pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 937bc58  gnu: Add libexpected.
937bc58 is described below

commit 937bc5841429f40a64e6b25d5d4c2fe3276789f1
Author: Brett Gilio <brettg@gnu.org>
AuthorDate: Sat Dec 5 21:10:59 2020 -0600

    gnu: Add libexpected.
    
    * gnu/packages/cpp.scm (libexpected): New variable.
    * gnu/packages/patches/libexpected-nofetch.patch: Add patch.
    * gnu/local.mk: Reference patch.
---
 gnu/local.mk                                   |  1 +
 gnu/packages/cpp.scm                           | 38 ++++++++++++++++++++++++++
 gnu/packages/patches/libexpected-nofetch.patch | 27 ++++++++++++++++++
 3 files changed, 66 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index f838ebe..cbfefcc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1257,6 +1257,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \
   %D%/packages/patches/libcanberra-wayland-crash.patch \
   %D%/packages/patches/libcyaml-libyaml-compat.patch           \
+  %D%/packages/patches/libexpected-nofetch.patch                \
   %D%/packages/patches/libgeotiff-adapt-test-script-for-proj-6.2.patch         
\
   %D%/packages/patches/libgit2-mtime-0.patch                   \
   %D%/packages/patches/libgnome-encoding.patch                 \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index f0d8cd2..2591d33 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -731,3 +731,41 @@ of C++14 components that complements @code{std} and 
Boost.")
     ;; 32-bit is not supported: https://github.com/facebook/folly/issues/103
     (supported-systems '("aarch64-linux" "x86_64-linux"))
     (license license:asl2.0)))
+
+(define-public libexpected
+  (package
+    (name "libexpected")
+    (version "1.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/TartanLlama/expected";)
+             (commit (string-append "v" version))
+             ;; NOTE: Requires TL_CMAKE from custom
+             ;; repository. Should not affect reproducibility.
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       ;; NOTE: This patch will be unnecessary on subsequent tags.
+       (patches (search-patches "libexpected-nofetch.patch"))
+       (sha256
+        (base32 "1ckzfrljzzdw9wf8hvdfjz4wjx5na57iwxc48mbv9rf5067m21a5"))))
+    (build-system cmake-build-system)
+    ;; TODO: Clean up install phase.
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "./tests"))))))
+    (native-inputs
+     `(("catch2" ,catch-framework2)))
+    (synopsis "C++11/14/17 std::expected with functional-style extensions")
+    (description "@code{std::expected} is proposed as the preferred way to
+represent objects which will either have an expected value, or an unexpected
+value giving information about why something failed.  Unfortunately, chaining
+together many computations which may fail can be verbose, as error-checking
+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)))
diff --git a/gnu/packages/patches/libexpected-nofetch.patch 
b/gnu/packages/patches/libexpected-nofetch.patch
new file mode 100644
index 0000000..e1d104f
--- /dev/null
+++ b/gnu/packages/patches/libexpected-nofetch.patch
@@ -0,0 +1,27 @@
+Description: Disable FetchContent module
+ No online operations are permitted during build package.
+Author: Nicholas Guriev <guriev-ns@ya.ru>
+Last-Update: Wed, 22 Jan 2020 21:51:33 +0300
+
+Modified by Brett Gilio <brettg@gnu.org> on Dec 5, 2020
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -4,16 +4,7 @@ project(tl-expected VERSION 1.0.0 LANGUAGES CXX)
+ 
+ option(EXPECTED_ENABLE_TESTS "Enable tests." ON)
+ 
+-include(FetchContent)
+-FetchContent_Declare(
+-  tl_cmake
+-  GIT_REPOSITORY https://github.com/TartanLlama/tl-cmake.git
+-)
+-FetchContent_GetProperties(tl_cmake)
+-if(NOT tl_cmake_POPULATED)
+-  FetchContent_Populate(tl_cmake)
+-  set(CMAKE_MODULE_PATH ${tl_cmake_SOURCE_DIR} ${CMAKE_MODULE_PATH})
+-endif()
++set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tl-cmake 
${CMAKE_MODULE_PATH})
+ include(add-tl)
+ 
+ tl_add_library(expected SOURCES 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]