commit:     24515f0803c027a23995d666117fca78f35f6f69
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 19 18:42:08 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 19 18:42:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24515f08

sys-fs/cryfs: fix build w/ boost-1.89

Closes: https://bugs.gentoo.org/963108
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/cryfs/cryfs-1.0.1-r2.ebuild              | 179 ++++++++++++++++++++++++
 sys-fs/cryfs/files/cryfs-1.0.1-boost-1.89.patch |  26 ++++
 2 files changed, 205 insertions(+)

diff --git a/sys-fs/cryfs/cryfs-1.0.1-r2.ebuild 
b/sys-fs/cryfs/cryfs-1.0.1-r2.ebuild
new file mode 100644
index 000000000000..eac851af74f5
--- /dev/null
+++ b/sys-fs/cryfs/cryfs-1.0.1-r2.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+inherit cmake eapi9-ver flag-o-matic linux-info python-any-r1
+
+if [[ ${PV} == 9999 ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/cryfs/cryfs";
+else
+       
SRC_URI="https://github.com/cryfs/cryfs/releases/download/${PV}/${P}.tar.xz";
+       S=${WORKDIR}
+       KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
+fi
+
+DESCRIPTION="Encrypted FUSE filesystem that conceals metadata"
+HOMEPAGE="https://www.cryfs.org/";
+
+LICENSE="LGPL-3 MIT"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       >=dev-libs/boost-1.84.0:=
+       dev-libs/crypto++:=
+       dev-libs/libfmt:=
+       dev-libs/spdlog:=
+       >=sys-fs/fuse-2.8.6:0
+"
+DEPEND="
+       ${RDEPEND}
+       dev-cpp/range-v3
+       net-misc/curl
+       test? (
+               dev-cpp/gtest
+       )
+"
+BDEPEND="
+       ${PYTHON_DEPS}
+       virtual/pkgconfig
+       $(python_gen_any_dep '
+               dev-python/versioneer[${PYTHON_USEDEP}]
+       ')
+"
+
+PATCHES=(
+       # TODO: upstream:
+       "${FILESDIR}"/cryfs-1.0.1-unbundle-vendored-libs.patch
+
+       # backports
+       "${FILESDIR}"/cryfs-1.0.1-boost-1.88.patch
+
+       # https://github.com/cryfs/cryfs/pull/500
+       "${FILESDIR}"/cryfs-1.0.1-boost-1.89.patch
+)
+
+python_check_deps() {
+       python_has_version "dev-python/versioneer[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+       local CONFIG_CHECK="~FUSE_FS"
+       local WARNING_FUSE_FS="CONFIG_FUSE_FS is required for cryfs support."
+
+       check_extra_config
+       python-any-r1_pkg_setup
+}
+
+src_prepare() {
+       cmake_src_prepare
+
+       # don't install compressed manpage
+       cmake_comment_add_subdirectory doc
+
+       # We use the package instead for >=py3.12 compat, bug #908997
+       rm src/gitversion/versioneer.py || die
+
+       # Hook up ctest properly for better maintainer quality of life
+       sed -i -e '/option(BUILD_TESTING/aenable_testing()' CMakeLists.txt || 
die
+       sed -i -e '/BUILD_TESTING/a  include(GoogleTest)' test/CMakeLists.txt 
|| die
+       sed -i -e 's/add_test/gtest_discover_tests/' test/*/CMakeLists.txt || 
die
+}
+
+src_configure() {
+       # ODR violations (bug #880563)
+       # ./CMakeLists.txt
+       # """
+       # We don't use LTO because crypto++ has problems with it,
+       # see https://github.com/weidai11/cryptopp/issues/1031 and
+       # https://www.cryptopp.com/wiki/Link_Time_Optimization
+       # """
+       filter-lto
+
+       local mycmakeargs=(
+               # Upstream inconsistently specifies their libraries as STATIC
+               # Leading to issues when static libraries without PIC are linked
+               # with PIC shared libraries.
+               -DBUILD_SHARED_LIBS=OFF
+               -DBUILD_TESTING=$(usex test)
+               -DCRYFS_UPDATE_CHECKS=OFF
+               -DUSE_SYSTEM_LIBS=ON
+       )
+
+       append-cppflags -DNDEBUG
+
+       # bug 907096
+       use elibc_musl && append-flags -D_LARGEFILE64_SOURCE
+
+       cmake_src_configure
+}
+
+src_test() {
+       local TMPDIR="${T}"
+
+       local CMAKE_SKIP_TESTS=(
+               # Cannot test mounting filesystems in sandbox
+               # Filesystem did not call onMounted callback, probably wasn't 
successfully mounted.
+               # bug #808849
+               CliTest.WorksWithCommasInBasedir
+               CliTest_IntegrityCheck.givenIncorrectFilesystemId_thenFails
+               CliTest_IntegrityCheck.givenIncorrectFilesystemKey_thenFails
+               CliTest_Setup.AutocreateBasedir
+               CliTest_Setup.AutocreateMountpoint
+               CliTest_Setup.ConfigfileGiven
+               CliTest_Setup.ExistingLogfileGiven
+               CliTest_Setup.NoSpecialOptions
+               CliTest_Setup.NotexistingLogfileGiven
+               
CliTest_Unmount.givenMountedFilesystem_whenUnmounting_thenSucceeds
+               
RunningInForeground/CliTest_WrongEnvironment.BaseDir_AllPermissions
+               
RunningInForeground/CliTest_WrongEnvironment.BaseDir_DoesntExist_Create
+               
RunningInForeground/CliTest_WrongEnvironment.MountDir_AllPermissions
+               
RunningInForeground/CliTest_WrongEnvironment.MountDir_DoesntExist_Create
+               RunningInForeground/CliTest_WrongEnvironment.NoErrorCondition
+               
RunningInForeground_ExternalConfigfile/CliTest_WrongEnvironment.BaseDir_AllPermissions
+               
RunningInForeground_ExternalConfigfile/CliTest_WrongEnvironment.BaseDir_DoesntExist_Create
+               
RunningInForeground_ExternalConfigfile/CliTest_WrongEnvironment.MountDir_AllPermissions
+               
RunningInForeground_ExternalConfigfile/CliTest_WrongEnvironment.MountDir_DoesntExist_Create
+               
RunningInForeground_ExternalConfigfile/CliTest_WrongEnvironment.NoErrorCondition
+               
RunningInForeground_ExternalConfigfile_LogIsNotStderr/CliTest_WrongEnvironment.BaseDir_AllPermissions
+               
RunningInForeground_ExternalConfigfile_LogIsNotStderr/CliTest_WrongEnvironment.BaseDir_DoesntExist_Create
+               
RunningInForeground_ExternalConfigfile_LogIsNotStderr/CliTest_WrongEnvironment.MountDir_AllPermissions
+               
RunningInForeground_ExternalConfigfile_LogIsNotStderr/CliTest_WrongEnvironment.MountDir_DoesntExist_Create
+               
RunningInForeground_ExternalConfigfile_LogIsNotStderr/CliTest_WrongEnvironment.NoErrorCondition
+               
RunningInForeground_LogIsNotStderr/CliTest_WrongEnvironment.BaseDir_AllPermissions
+               
RunningInForeground_LogIsNotStderr/CliTest_WrongEnvironment.BaseDir_DoesntExist_Create
+               
RunningInForeground_LogIsNotStderr/CliTest_WrongEnvironment.MountDir_AllPermissions
+               
RunningInForeground_LogIsNotStderr/CliTest_WrongEnvironment.MountDir_DoesntExist_Create
+               
RunningInForeground_LogIsNotStderr/CliTest_WrongEnvironment.NoErrorCondition
+               # Filesystem did not call onMounted callback, probably wasn't 
successfully mounted.
+               # fuse: failed to open /dev/fuse: Permission denied
+               
CliTest_IntegrityCheck.givenFilesystemWithRolledBackBasedir_whenMounting_thenFails
+               
CliTest_IntegrityCheck.whenRollingBackBasedirWhileMounted_thenUnmounts
+               # Tests that hang due to being unable to open fuse
+               # bug #699044
+               # fuse: failed to open /dev/fuse: Permission denied
+               Fuse*
+       )
+
+       cmake_src_test
+}
+
+src_install() {
+       cmake_src_install
+       doman doc/man/cryfs.1
+       doman doc/man/cryfs-unmount.1
+}
+
+pkg_postinst() {
+       if ver_replacing -lt 1.0.0; then
+               elog "Filesystems created with CryFS 0.11.x and CryFS 1.0.0 are 
fully compatible with each other."
+               elog "This means filesystems created with 0.10.x or 0.11.x can 
be mounted without requiring a migration."
+               elog "Filesystems created with 1.0.0 or 0.11.x can be mounted 
by CryFS 0.10.x,"
+               elog "but only if you configure it to use a cipher supported by 
CryFS 0.10.x, e.g. AES-256-GCM."
+               elog "The new default, XChaCha20-Poly1305, is not supported by 
CryFS 0.10.x."
+       fi
+}

diff --git a/sys-fs/cryfs/files/cryfs-1.0.1-boost-1.89.patch 
b/sys-fs/cryfs/files/cryfs-1.0.1-boost-1.89.patch
new file mode 100644
index 000000000000..775fb7e20599
--- /dev/null
+++ b/sys-fs/cryfs/files/cryfs-1.0.1-boost-1.89.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/963108
+https://github.com/cryfs/cryfs/pull/500
+
+From f2f3c19979545c4789647e648cc1480ce647f42a Mon Sep 17 00:00:00 2001
+From: Michael Cho <[email protected]>
+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")
+

Reply via email to