Subject: [bug#54337] [PATCH v2 2/3] gnu: Add boost-for-cryfs.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 15 Mar 2022 09:14:01 +0100

Hi,

'Brendan Tildesley <[email-masked]> skribis:

> From: Brendan Tildesley <[email-masked]>
>
> * gnu/packages/boost.scm (boost-for-cryfs): New variable. Since
> updating boost would resulting in building 1000s of rebuilds, add a
> temporary variant to fixing a missing import resulting in "error:
> 'transform' is not a member of 'std'" when building cryfs. See:
> https://github.com/boostorg/process/commit/e08374ed95ac33865bda40602c94909e7cd9607f
>
> * gnu/packages/patches/boost-wchar-include-algorithm.patch: New
> file.
> * gnu/local.mk: Reference patch.

[...]

> +(define-public boost-for-cryfs
> +  ;; This patch applies for boost 1.77. Should not be needed in later releases.
> +  ;; See:  https://github.com/boostorg/process/commit/e08374ed95ac33865bda40602c94909e7cd9607f
> +  (package/inherit boost
> +    (name "boost-for-cryfs")
> +    (source (origin
> +              (inherit (package-source boost))
> +              (patches (search-patches "boost-wchar-include-algorithm.patch"))))))
> +
>  ;; Sadly, this is needed for irods.  It won't link with 1.69 or later.
>  (define-public boost-for-irods
>    (package
> diff --git a/gnu/packages/patches/boost-wchar-include-algorithm.patch b/gnu/packages/patches/boost-wchar-include-algorithm.patch
> new file mode 100644
> index 0000000000..c174dc5cd2
> --- /dev/null
> +++ b/gnu/packages/patches/boost-wchar-include-algorithm.patch
> @@ -0,0 +1,11 @@
> +--- a/boost/process/detail/traits/wchar_t.hpp
> ++++ b/boost/process/detail/traits/wchar_t.hpp
> +@@ -12,6 +12,8 @@
> + #include <boost/process/detail/traits/env.hpp>
> + #include <boost/process/locale.hpp>
> + 
> ++#include <algorithm>

‘guix lint’ must complain that this patch lacks a comment at the top.
:-)

Since this affect only cryfs, and since it’s just a missing include, I
wonder if we could instead add “#include <algorithm>” in the cryfs
source file(s) that include(s) Boost headers?  That way, we wouldn’t
need an extra Boost build.

Thoughts?

Ludo’.