summary refs log tree commit diff
path: root/pkgs/tools/filesystems
diff options
context:
space:
mode:
authorRenaud <c0bw3b@users.noreply.github.com>2019-11-29 22:58:38 +0100
committerGitHub <noreply@github.com>2019-11-29 22:58:38 +0100
commitf0b9bd93ecf3ea7649d793164b5d3371497259f7 (patch)
treeabc4ef8b1164aec4864c36c6c73dd29e9ecc6d15 /pkgs/tools/filesystems
parent95dc1c615e5fd6b03550073e568ef5760a892ee6 (diff)
downloadnixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.tar
nixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.tar.gz
nixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.tar.bz2
nixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.tar.lz
nixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.tar.xz
nixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.tar.zst
nixpkgs-f0b9bd93ecf3ea7649d793164b5d3371497259f7.zip
cryfs: 0.9.10 -> 0.10.2
(#74296)
Diffstat (limited to 'pkgs/tools/filesystems')
-rw-r--r--pkgs/tools/filesystems/cryfs/default.nix82
-rw-r--r--pkgs/tools/filesystems/cryfs/skip-failing-test-large-malloc.patch34
-rw-r--r--pkgs/tools/filesystems/cryfs/test-no-network.patch24
3 files changed, 41 insertions, 99 deletions
diff --git a/pkgs/tools/filesystems/cryfs/default.nix b/pkgs/tools/filesystems/cryfs/default.nix
index 7eee02e220a..93a70f1f088 100644
--- a/pkgs/tools/filesystems/cryfs/default.nix
+++ b/pkgs/tools/filesystems/cryfs/default.nix
@@ -1,78 +1,78 @@
-{ stdenv, fetchFromGitHub
-, cmake, pkgconfig, coreutils
-, boost, cryptopp, curl, fuse, openssl, python, spdlog
+{ stdenv, fetchFromGitHub, fetchpatch
+, cmake, pkgconfig, python, gtest
+, boost, cryptopp, curl, fuse, openssl
 }:
 
 stdenv.mkDerivation rec {
   pname = "cryfs";
-  version = "0.9.10";
+  version = "0.10.2";
 
   src = fetchFromGitHub {
     owner  = "cryfs";
     repo   = "cryfs";
     rev    = version;
-    sha256 = "04yqpad8x0hiiwpykcn3swi0py6sg9xid6g15ny2qs4j3llin5ry";
+    sha256 = "1m6rcc82hbaiwcwcvf5xmxma8n0jal9zhcykv9xgwiax4ny0l8kz";
   };
 
-  prePatch = ''
+  patches = [
+    (fetchpatch {
+      name = "cryfs-0.10.2-install-targets.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryfs/files/cryfs-0.10.2-install-targets.patch?id=192ac7421ddd4093125f4997898fb62e8a140a44";
+      sha256 = "1jz6gpi1i7dnfm88a6n3mccwfmsmvg0d0bmp3fmqqrkbcg7in00l";
+    })
+    (fetchpatch {
+      name = "cryfs-0.10.2-unbundle-libs.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryfs/files/cryfs-0.10.2-unbundle-libs.patch?id=192ac7421ddd4093125f4997898fb62e8a140a44";
+      sha256 = "0hzss5rawcjrh8iqzc40w5yjhxdqya4gbg6dzap70180s50mahzs";
+    })
+  ];
+
+  postPatch = ''
     patchShebangs src
 
-    substituteInPlace vendor/scrypt/CMakeLists.txt \
-      --replace /usr/bin/ ""
+    # remove tests that require network access:
+    substituteInPlace test/cpp-utils/CMakeLists.txt \
+      --replace "network/CurlHttpClientTest.cpp" "" \
+      --replace "network/FakeHttpClientTest.cpp" ""
 
-    # scrypt in nixpkgs only produces a binary so we lift the patching from that so allow
-    # building the vendored version. This is very much NOT DRY.
-    # The proper solution is to have scrypt generate a dev output with the required files and just symlink
-    # into vendor/scrypt
-    for f in Makefile.in autocrap/Makefile.am libcperciva/cpusupport/Build/cpusupport.sh ; do
-      substituteInPlace vendor/scrypt/scrypt-*/scrypt/$f --replace "command -p " ""
-    done
+    # remove CLI test trying to access /dev/fuse
+    substituteInPlace test/cryfs-cli/CMakeLists.txt \
+      --replace "CliTest_IntegrityCheck.cpp" ""
 
-    # cryfs is vendoring an old version of spdlog
-    rm -rf vendor/spdlog/spdlog
-    ln -s ${spdlog} vendor/spdlog/spdlog
+    # downsize large file test as 4.5G is too big for Hydra:
+    substituteInPlace test/cpp-utils/data/DataTest.cpp \
+      --replace "(4.5L*1024*1024*1024)" "(0.5L*1024*1024*1024)"
   '';
 
-  buildInputs = [ boost cryptopp curl fuse openssl python spdlog ];
+  nativeBuildInputs = [ cmake gtest pkgconfig python ];
 
-  patches = [
-    ./test-no-network.patch  # Disable tests using external networking
-    ./skip-failing-test-large-malloc.patch
-  ];
-
-  # coreutils is needed for the vendored scrypt
-  nativeBuildInputs = [ cmake coreutils pkgconfig ];
+  buildInputs = [ boost cryptopp curl fuse openssl ];
 
   enableParallelBuilding = true;
 
   cmakeFlags = [
-    "-DCRYFS_UPDATE_CHECKS=OFF"
-    "-DBoost_USE_STATIC_LIBS=OFF" # this option is case sensitive
+    "-DCRYFS_UPDATE_CHECKS:BOOL=FALSE"
+    "-DBoost_USE_STATIC_LIBS:BOOL=FALSE" # this option is case sensitive
+    "-DUSE_SYSTEM_LIBS:BOOL=TRUE"
+    "-DBUILD_TESTING:BOOL=TRUE"
   ];
 
-  doCheck = true;
+  doCheck = (!stdenv.isDarwin); # Cryfs tests are broken on darwin
 
-  # Cryfs tests are broken on darwin
-  checkPhase = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  checkPhase = ''
     # Skip CMakeFiles directory and tests depending on fuse (does not work well with sandboxing)
-    SKIP_IMPURE_TESTS="CMakeFiles|fspp|cryfs-cli"
+    SKIP_IMPURE_TESTS="CMakeFiles|fspp|my-gtest-main"
 
-    for test in `ls -d test/*/ | egrep -v "$SKIP_IMPURE_TESTS"`; do
-      "./$test`basename $test`-test"
+    for t in $(ls -d test/*/ | egrep -v "$SKIP_IMPURE_TESTS"); do
+      "./$t$(basename $t)-test"
     done
   '';
 
-  installPhase = ''
-    # Building with BUILD_TESTING=ON is missing the install target
-    mkdir -p $out/bin
-    install -m 755 ./src/cryfs-cli/cryfs $out/bin/cryfs
-  '';
-
   meta = with stdenv.lib; {
     description = "Cryptographic filesystem for the cloud";
     homepage    = https://www.cryfs.org;
     license     = licenses.lgpl3;
-    maintainers = with maintainers; [ peterhoeg ];
+    maintainers = with maintainers; [ peterhoeg c0bw3b ];
     platforms   = with platforms; linux;
   };
 }
diff --git a/pkgs/tools/filesystems/cryfs/skip-failing-test-large-malloc.patch b/pkgs/tools/filesystems/cryfs/skip-failing-test-large-malloc.patch
deleted file mode 100644
index feb0ed9cfbb..00000000000
--- a/pkgs/tools/filesystems/cryfs/skip-failing-test-large-malloc.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From ad3f7e9fa2dececfaab43963887a2f03de52d659 Mon Sep 17 00:00:00 2001
-From: adisbladis <adis@blad.is>
-Date: Thu, 12 Oct 2017 21:45:26 +0800
-Subject: [PATCH] Skip failing test: large malloc
-
----
- test/cpp-utils/data/DataTest.cpp | 11 -----------
- 1 file changed, 11 deletions(-)
-
-diff --git a/test/cpp-utils/data/DataTest.cpp b/test/cpp-utils/data/DataTest.cpp
-index 6f9df070..bd426e62 100644
---- a/test/cpp-utils/data/DataTest.cpp
-+++ b/test/cpp-utils/data/DataTest.cpp
-@@ -191,17 +191,6 @@ TEST_F(DataTest, Inequality_DifferentLastByte) {
-   EXPECT_TRUE(data1 != data2);
- }
- 
--#ifdef __x86_64__
--TEST_F(DataTest, LargesizeSize) {
--  //Needs 64bit for representation. This value isn't in the size param list, because the list is also used for read/write checks.
--  uint64_t size = 4.5L*1024*1024*1024;
--  Data data(size);
--  EXPECT_EQ(size, data.size());
--}
--#else
--#warning This is not a 64bit architecture. Large size data tests are disabled.
--#endif
--
- TEST_F(DataTest, LoadingNonexistingFile) {
-   TempFile file(false); // Pass false to constructor, so the tempfile is not created
-   EXPECT_FALSE(Data::LoadFromFile(file.path()));
--- 
-2.14.2
-
diff --git a/pkgs/tools/filesystems/cryfs/test-no-network.patch b/pkgs/tools/filesystems/cryfs/test-no-network.patch
deleted file mode 100644
index 3392d3f855e..00000000000
--- a/pkgs/tools/filesystems/cryfs/test-no-network.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 8b1808e1278d2cb0dc56a4e98781eceeadfb9718 Mon Sep 17 00:00:00 2001
-From: adisbladis <adis@blad.is>
-Date: Thu, 12 Oct 2017 18:13:28 +0800
-Subject: [PATCH] Disable tests using external networking
-
----
- test/cpp-utils/CMakeLists.txt | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/test/cpp-utils/CMakeLists.txt b/test/cpp-utils/CMakeLists.txt
-index 5a2bc9f8..d838edba 100644
---- a/test/cpp-utils/CMakeLists.txt
-+++ b/test/cpp-utils/CMakeLists.txt
-@@ -20,7 +20,6 @@ set(SOURCES
-     tempfile/TempFileIncludeTest.cpp
-     tempfile/TempDirIncludeTest.cpp
-     tempfile/TempDirTest.cpp
--    network/CurlHttpClientTest.cpp
-     network/FakeHttpClientTest.cpp
-     io/ConsoleIncludeTest.cpp
-     io/ConsoleTest_AskYesNo.cpp
--- 
-2.14.2
-