dev-python/numpydoc: arm64 keyworded (bug #721130)
[gentoo.git] / sys-fs / cryfs / cryfs-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 CMAKE_MAKEFILE_GENERATOR="emake"
7 PYTHON_COMPAT=( python3_{6,7} )
8 inherit cmake flag-o-matic linux-info python-any-r1
9
10 if [[ ${PV} == 9999 ]] ; then
11         inherit git-r3
12         EGIT_REPO_URI="https://github.com/cryfs/cryfs"
13 else
14         SRC_URI="https://github.com/cryfs/cryfs/releases/download/${PV}/${P}.tar.xz"
15         KEYWORDS="~amd64 ~arm ~arm64 ~x86"
16         S="${WORKDIR}"
17 fi
18
19 DESCRIPTION="Encrypted FUSE filesystem that conceals metadata"
20 HOMEPAGE="https://www.cryfs.org/"
21
22 # cryfs - LGPL-3
23 # spdlog - MIT
24 # crypto++ - Boost-1.0
25 LICENSE="LGPL-3 MIT Boost-1.0"
26 SLOT="0"
27 IUSE="custom-optimization debug libressl test"
28 RESTRICT="!test? ( test )"
29
30 RDEPEND="
31         >=dev-libs/boost-1.65.1:=
32         net-misc/curl:=
33         >=sys-fs/fuse-2.8.6:0
34         !libressl? ( dev-libs/openssl:0= )
35         libressl? ( dev-libs/libressl:= )
36 "
37 DEPEND="${RDEPEND}
38         ${PYTHON_DEPS}
39 "
40
41 pkg_setup() {
42         local CONFIG_CHECK="~FUSE_FS"
43         local WARNING_FUSE_FS="CONFIG_FUSE_FS is required for cryfs support."
44
45         check_extra_config
46 }
47
48 src_prepare() {
49         cmake_src_prepare
50
51         # don't install compressed manpage
52         cmake_comment_add_subdirectory doc
53
54         # remove tests that require internet access to comply with Gentoo policy
55         sed -e "/CurlHttpClientTest.cpp/d" -e "/FakeHttpClientTest.cpp/d" \
56                 -i test/cpp-utils/CMakeLists.txt || die
57
58         # /dev/fuse access denied
59         sed -e "/CliTest_IntegrityCheck/d" \
60                 -i test/cryfs-cli/CMakeLists.txt || die
61 }
62
63 src_configure() {
64         local mycmakeargs=(
65                 -DBoost_USE_STATIC_LIBS=OFF
66                 -DCRYFS_UPDATE_CHECKS=OFF
67                 -DBUILD_SHARED_LIBS=OFF
68                 -DBUILD_TESTING=$(usex test)
69         )
70         use custom-optimization || append-flags -O3
71
72         cmake_src_configure
73 }
74
75 src_test() {
76         local TMPDIR="${T}"
77         local tests_failed=()
78
79         # fspp fuse tests hang, bug # 699044
80         for i in gitversion cpp-utils parallelaccessstore blockstore blobstore cryfs cryfs-cli ; do
81                 "${BUILD_DIR}"/test/${i}/${i}-test || tests_failed+=( "${i}" )
82         done
83
84         if [[ -n ${tests_failed[@]} ]] ; then
85                 eerror "The following tests failed:"
86                 eerror "${tests_failed[@]}"
87                 die "At least one test failed"
88         fi
89 }
90
91 src_install() {
92         # work around upstream issue with cmake not creating install target
93         # in Makefile if we enable BUILD_TESTING
94         dobin "${BUILD_DIR}/src/cryfs-cli/cryfs"
95         doman doc/man/cryfs.1
96         einstalldocs
97 }