1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 CMAKE_MAKEFILE_GENERATOR=emake
6 PYTHON_COMPAT=( python{2_7,3_{5,6}} )
8 inherit cmake-utils python-any-r1 flag-o-matic
10 DESCRIPTION="Encrypted FUSE filesystem that conceals metadata"
11 HOMEPAGE="https://www.cryfs.org/"
14 IUSE="custom-optimization libressl test update-check"
15 RESTRICT="!test? ( test )"
17 LICENSE="LGPL-3 BSD-2 MIT"
22 if [[ "${PV}" == 9999 ]] ; then
24 EGIT_REPO_URI="https://github.com/cryfs/cryfs"
26 SRC_URI="https://github.com/cryfs/cryfs/releases/download/${PV}/${P}.tar.xz"
27 KEYWORDS="amd64 ~arm arm64 x86"
31 RDEPEND=">=dev-libs/boost-1.56:=
32 >=dev-libs/crypto++-5.6.3:=
35 !libressl? ( dev-libs/openssl:0= )
36 libressl? ( dev-libs/libressl:= )"
41 cmake-utils_src_prepare
43 # remove tests that require internet access to comply with Gentoo policy
44 sed -i -e '/CurlHttpClientTest.cpp/d' -e '/FakeHttpClientTest.cpp/d' test/cpp-utils/CMakeLists.txt || die
46 # remove non-applicable warning
47 sed -i -e '/WARNING! This is a debug build. Performance might be slow./d' src/cryfs-cli/Cli.cpp || die
51 # upstream restricts installing files to Release configuration
52 # (CMAKE_BUILD_TYPE does not affect anything else)
53 local CMAKE_BUILD_TYPE
55 CMAKE_BUILD_TYPE=Release
57 "-DBoost_USE_STATIC_LIBS=off"
58 "-DCRYFS_UPDATE_CHECKS=$(usex update-check)"
59 "-DBUILD_TESTING=$(usex test)"
61 use custom-optimization || append-flags -O3
63 cmake-utils_src_configure
74 for i in gitversion cpp-utils parallelaccessstore blockstore blobstore fspp cryfs cryfs-cli ; do
75 "${BUILD_DIR}"/test/${i}/${i}-test || tests_failed+=( "${i}" )
80 if [[ -n ${tests_failed[@]} ]] ; then
81 eerror "The following tests failed:"
82 eerror "${tests_failed[@]}"
83 die "At least one test failed"
88 # work around upstream issue with cmake not creating install target
89 # in Makefile if we enable BUILD_TESTING
90 dobin "${BUILD_DIR}/src/cryfs-cli/cryfs"
91 gzip -cd "${BUILD_DIR}/doc/cryfs.1.gz" > "${T}/cryfs.1" || die