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"
16 LICENSE="LGPL-3 BSD-2 MIT"
21 if [[ "${PV}" == 9999 ]] ; then
23 EGIT_REPO_URI="https://github.com/cryfs/cryfs"
25 SRC_URI="https://github.com/cryfs/cryfs/releases/download/${PV}/${P}.tar.xz"
26 KEYWORDS="amd64 ~arm arm64 x86"
30 RDEPEND=">=dev-libs/boost-1.56:=
31 >=dev-libs/crypto++-5.6.3:=
34 !libressl? ( dev-libs/openssl:0= )
35 libressl? ( dev-libs/libressl:= )"
40 cmake-utils_src_prepare
42 # remove tests that require internet access to comply with Gentoo policy
43 sed -i -e '/CurlHttpClientTest.cpp/d' -e '/FakeHttpClientTest.cpp/d' test/cpp-utils/CMakeLists.txt || die
45 # remove non-applicable warning
46 sed -i -e '/WARNING! This is a debug build. Performance might be slow./d' src/cryfs-cli/Cli.cpp || die
50 # upstream restricts installing files to Release configuration
51 # (CMAKE_BUILD_TYPE does not affect anything else)
52 local CMAKE_BUILD_TYPE
54 CMAKE_BUILD_TYPE=Release
56 "-DBoost_USE_STATIC_LIBS=off"
57 "-DCRYFS_UPDATE_CHECKS=$(usex update-check)"
58 "-DBUILD_TESTING=$(usex test)"
60 use custom-optimization || append-flags -O3
62 cmake-utils_src_configure
73 for i in gitversion cpp-utils parallelaccessstore blockstore blobstore fspp cryfs cryfs-cli ; do
74 "${BUILD_DIR}"/test/${i}/${i}-test || tests_failed+=( "${i}" )
79 if [[ -n ${tests_failed[@]} ]] ; then
80 eerror "The following tests failed:"
81 eerror "${tests_failed[@]}"
82 die "At least one test failed"
87 # work around upstream issue with cmake not creating install target
88 # in Makefile if we enable BUILD_TESTING
89 dobin "${BUILD_DIR}/src/cryfs-cli/cryfs"
90 gzip -cd "${BUILD_DIR}/doc/cryfs.1.gz" > "${T}/cryfs.1" || die