~ruther/guix-local

88ce778dbf3f7c89ee26287af317b10ffab60586 — Brendan Tildesley 2 months ago 9afae09
gnu: cryfs: Update to 1.0.1.

* gnu/packages/patches/cryfs-boost-1.88-fix.patch: New file.
* gnu/packages/patches/cryfs-boost-1.89-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Update accordingly.
* gnu/packages/crypto.scm (cryfs): Update to 1.0.1.
[origin]: Add patches.
[arguments]<#:configure-flags>: Update.
<#:phases>: Update ’check and ’fix-up.
[inputs]: Remove boost-1.83; add boost.
[native-inputs]: Add googletest.
[properties]: Enable tuning.

Closes guix/guix#4539

Change-Id: I61ea925359edd1181424295380d53bf2482c7c62
Modified-by: Cayetano Santos <csantosb@inventati.org>
Signed-off-by: Cayetano Santos <csantosb@inventati.org>
M gnu/local.mk => gnu/local.mk +2 -0
@@ 1142,6 1142,8 @@ dist_patch_DATA =						\
  %D%/packages/patches/crc32c-unbundle-googletest.patch		\
  %D%/packages/patches/crda-optional-gcrypt.patch		\
  %D%/packages/patches/clucene-contribs-lib.patch               \
  %D%/packages/patches/cryfs-boost-1.88-fix.patch		\
  %D%/packages/patches/cryfs-boost-1.89-fix.patch		\
  %D%/packages/patches/csvkit-set-locale-for-tests.patch			\
  %D%/packages/patches/ctranslate2-local-build.patch		\
  %D%/packages/patches/ctune-cmake-disable-git-clone.patch		\

M gnu/packages/crypto.scm => gnu/packages/crypto.scm +27 -25
@@ 21,7 21,7 @@
;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
;;; Copyright © 2021 Ellis Kenyő <me@elken.dev>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2021, 2022 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2021, 2022, 2025 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2022 Allan Adair <allan@adair.no>
;;; Copyright © 2022, 2024-2025 Maxim Cournoyer <maxim@guixoic.coop>
;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>


@@ 1581,7 1581,7 @@ non-encrypted files.")
(define-public cryfs
  (package
    (name "cryfs")
    (version "0.11.4")
    (version "1.0.1")
    (source
     (origin
       (method url-fetch)


@@ 1589,52 1589,53 @@ non-encrypted files.")
             "https://github.com/cryfs/cryfs/releases/download/"
             version "/cryfs-" version ".tar.xz"))
       (sha256
        (base32 "0a48qijfrd02ianp19x3kz24w1pgigmlxdr5nks0gag7z5b2s7m7"))))
        (base32 "1va8l8yfyi895604i8npq2b5ha0ixiqydlrq2nck2106w52wrm3s"))
       (patches (search-patches
                 ;; https://github.com/cryfs/cryfs/pull/494
                 "cryfs-boost-1.88-fix.patch"
                 ;; https://github.com/cryfs/cryfs/pull/500
                 "cryfs-boost-1.89-fix.patch"))))
    (build-system cmake-build-system)
    (arguments
     '(#:modules ((guix build cmake-build-system)
                  (guix build utils)
                  (srfi srfi-1))
       #:configure-flags
        ;; Note: This also disables checking for security issues.
       `("-DCRYFS_UPDATE_CHECKS=OFF"
         ;; This helps us use some dependencies from Guix instead of conan.
         ;; crypto++ is still bundled: https://github.com/cryfs/cryfs/issues/369
         ;; Googletest is also since I wasn't sure how to unbundle that.
         ,(string-append "-DDEPENDENCY_CONFIG=" (getcwd)
                         "/cmake-utils/DependenciesFromLocalSystem.cmake"))
       ;; Note: This also disables checking for security issues.
       '("-DCRYFS_UPDATE_CHECKS=OFF"
         "-DBUILD_TESTING=ON")
       ;; crypto++ is still bundled: https://github.com/cryfs/cryfs/issues/369
       #:phases
       (modify-phases %standard-phases
         (add-before 'configure 'fix-up
           (lambda* (#:key tests? #:allow-other-keys)
             ;; Remove junk directory that breaks the build
             (chdir "..") (delete-file-recursively ".circleci")
             (chdir "..") ; We end up in .github somehow
             ;; Install documentation with Guix defaults.
             (substitute* "doc/CMakeLists.txt"
               (("CONFIGURATIONS Release")
                "CONFIGURATIONS Release RelWithDebInfo"))
             (when tests?
               (substitute* "CMakeLists.txt"
                 (("option.BUILD_TESTING .build test cases. OFF.")
                  "option(BUILD_TESTING \"build test cases\" ON)")))))
             ;; Disable Fuse tests.
             (substitute* "test/cryfs-cli/CMakeLists.txt"
               (("CliTest_IntegrityCheck.cpp") "")
               (("CliTest_Setup.cpp") "")
               (("CliTest_WrongEnvironment.cpp") "")
               (("CryfsUnmountTest.cpp") ""))))
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               (let ((tests (find-files "." "-test$")))
                 ;; XXX: Disable failing tests. Unfortunately there are a
                 ;; few. Some only fail in the build environment due to
                 ;; FUSE not being available.
               (setenv "HOME" "/tmp")
               (let ((tests (find-files "test/" "-test$")))
                 ;; SignalHandler/SignalCatcher tests fails
                 ;; Fuse tests can't run in build env.
                 (for-each invoke
                           (lset-difference string-contains
                                            tests
                                            '("cpp-utils-test"
                                              "cryfs-cli-test"
                                              "blobstore-test"
                                              "fspp-test"))))))))))
    (native-inputs
     (list pkg-config python-wrapper))
     (list googletest pkg-config python-wrapper))
    (inputs
     (list boost-1.83 curl fuse-2 range-v3 spdlog))
     (list boost curl fuse-2 range-v3 spdlog))
    (home-page "https://www.cryfs.org/")
    (synopsis "Encrypted FUSE filesystem for the cloud")
    (description "CryFS encrypts your files, so you can safely store them anywhere.


@@ 1643,7 1644,8 @@ others.  CryFS creates an encrypted userspace filesystem that can be mounted
via FUSE without root permissions.  It is similar to EncFS, but provides
additional security and privacy measures such as hiding file sizes and directory
structure.  However CryFS is not considered stable yet by the developers.")
    (license license:lgpl3+)))
    (license license:lgpl3+)
    (properties `((tunable? . #t)))))

(define-public b3sum
  (package

A gnu/packages/patches/cryfs-boost-1.88-fix.patch => gnu/packages/patches/cryfs-boost-1.88-fix.patch +32 -0
@@ 0,0 1,32 @@
From 91e2c9b8fd5f7a1b0e57ad1310534606ce70c338 Mon Sep 17 00:00:00 2001
From: Michael Cho <michael@michaelcho.dev>
Date: Sun, 13 Apr 2025 10:37:29 -0400
Subject: [PATCH] Fix building with Boost 1.88

---
 src/cpp-utils/process/subprocess.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/cpp-utils/process/subprocess.cpp b/src/cpp-utils/process/subprocess.cpp
index 479bfe876..396ae09ec 100644
--- a/src/cpp-utils/process/subprocess.cpp
+++ b/src/cpp-utils/process/subprocess.cpp
@@ -1,7 +1,18 @@
 #include "subprocess.h"
 #include <array>
 #include <boost/asio.hpp>
+#include <boost/version.hpp>
+#if BOOST_VERSION < 108800
 #include <boost/process.hpp>
+#else
+#define BOOST_PROCESS_VERSION 1
+#include <boost/process/v1/args.hpp>
+#include <boost/process/v1/async_pipe.hpp>
+#include <boost/process/v1/child.hpp>
+#include <boost/process/v1/exe.hpp>
+#include <boost/process/v1/io.hpp>
+#include <boost/process/v1/search_path.hpp>
+#endif
 #include <cerrno>
 #include <cstddef>
 #include <cstdio>

A gnu/packages/patches/cryfs-boost-1.89-fix.patch => gnu/packages/patches/cryfs-boost-1.89-fix.patch +22 -0
@@ 0,0 1,22 @@
From f2f3c19979545c4789647e648cc1480ce647f42a Mon Sep 17 00:00:00 2001
From: Michael Cho <michael@michaelcho.dev>
Date: Tue, 12 Aug 2025 17:01:01 -0400
Subject: [PATCH] Fix build with Boost 1.89.0

---
 cmake-utils/Dependencies.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake-utils/Dependencies.cmake b/cmake-utils/Dependencies.cmake
index e2325e575..55edf924a 100644
--- a/cmake-utils/Dependencies.cmake
+++ b/cmake-utils/Dependencies.cmake
@@ -7,7 +7,7 @@ target_link_libraries(CryfsDependencies_range-v3 INTERFACE range-v3::range-v3)
 set(Boost_USE_STATIC_LIBS OFF)
 find_package(Boost 1.84.0
         REQUIRED
-        COMPONENTS filesystem system thread chrono program_options)
+        COMPONENTS filesystem thread chrono program_options)
 add_library(CryfsDependencies_boost INTERFACE)
 target_link_libraries(CryfsDependencies_boost INTERFACE Boost::boost Boost::filesystem Boost::thread Boost::chrono Boost::program_options)
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")