3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/filesystems/cryfs/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
2.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub
, cmake, pkg-config, python3
2021-12-30 22:07:14 +00:00
, boost175, curl, fuse, openssl, range-v3, spdlog
# cryptopp and gtest on standby - using the vendored ones for now
# see https://github.com/cryfs/cryfs/issues/369
, llvmPackages
2017-10-12 05:41:05 +01:00
}:
stdenv.mkDerivation rec {
pname = "cryfs";
version = "0.11.2";
2017-10-12 05:41:05 +01:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
hash = "sha256-NV2xCC8TaJaWDZSghO8EFuygL8hJLOdx67BWaJ2NKRw=";
2017-10-12 05:41:05 +01:00
};
2019-11-29 21:58:38 +00:00
postPatch = ''
2017-10-12 05:41:05 +01:00
patchShebangs src
# remove tests that require network access
2019-11-29 21:58:38 +00:00
substituteInPlace test/cpp-utils/CMakeLists.txt \
--replace "network/CurlHttpClientTest.cpp" "" \
--replace "network/FakeHttpClientTest.cpp" ""
2017-10-12 05:41:05 +01:00
2019-11-29 21:58:38 +00:00
# remove CLI test trying to access /dev/fuse
substituteInPlace test/cryfs-cli/CMakeLists.txt \
--replace "CliTest_IntegrityCheck.cpp" "" \
--replace "CliTest_Setup.cpp" "" \
--replace "CliTest_WrongEnvironment.cpp" "" \
--replace "CryfsUnmountTest.cpp" ""
2017-10-12 05:41:05 +01:00
# downsize large file test as 4.5G is too big for Hydra
2019-11-29 21:58:38 +00:00
substituteInPlace test/cpp-utils/data/DataTest.cpp \
--replace "(4.5L*1024*1024*1024)" "(0.5L*1024*1024*1024)"
2017-10-12 05:41:05 +01:00
'';
2021-03-25 11:12:49 +00:00
nativeBuildInputs = [ cmake pkg-config python3 ];
2017-10-12 05:41:05 +01:00
2021-03-25 11:12:49 +00:00
strictDeps = true;
2021-12-30 22:07:14 +00:00
buildInputs = [ boost175 curl fuse openssl range-v3 spdlog ]
++ lib.optional stdenv.cc.isClang llvmPackages.openmp;
2021-03-25 16:34:10 +00:00
#checkInputs = [ gtest ];
2017-10-12 05:41:05 +01:00
cmakeFlags = [
"-DDEPENDENCY_CONFIG='../cmake-utils/DependenciesFromLocalSystem.cmake'"
2019-11-29 21:58:38 +00:00
"-DCRYFS_UPDATE_CHECKS:BOOL=FALSE"
"-DBoost_USE_STATIC_LIBS:BOOL=FALSE" # this option is case sensitive
2021-03-25 16:34:10 +00:00
"-DBUILD_TESTING:BOOL=${if doCheck then "TRUE" else "FALSE"}"
]; # ++ lib.optional doCheck "-DCMAKE_PREFIX_PATH=${gtest.dev}/lib/cmake";
2017-10-12 05:41:05 +01:00
# macFUSE needs to be installed for the test to succeed on Darwin
doCheck = !stdenv.isDarwin;
2017-10-13 16:29:20 +01:00
2019-11-29 21:58:38 +00:00
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
2017-10-13 16:29:20 +01:00
# Skip CMakeFiles directory and tests depending on fuse (does not work well with sandboxing)
2019-11-29 21:58:38 +00:00
SKIP_IMPURE_TESTS="CMakeFiles|fspp|my-gtest-main"
2017-10-13 16:29:20 +01:00
for t in $(ls -d test/*/ | grep -E -v "$SKIP_IMPURE_TESTS") ; do
2019-11-29 21:58:38 +00:00
"./$t$(basename $t)-test"
2017-10-13 16:29:20 +01:00
done
runHook postCheck
2017-10-13 16:29:20 +01:00
'';
meta = with lib; {
2017-10-12 05:41:05 +01:00
description = "Cryptographic filesystem for the cloud";
homepage = "https://www.cryfs.org/";
changelog = "https://github.com/cryfs/cryfs/raw/${version}/ChangeLog.txt";
license = licenses.lgpl3Only;
2019-11-29 21:58:38 +00:00
maintainers = with maintainers; [ peterhoeg c0bw3b ];
2021-03-25 16:34:10 +00:00
platforms = platforms.unix;
2017-10-12 05:41:05 +01:00
};
}