summary refs log tree commit diff
path: root/pkgs/tools/filesystems
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-10-13 11:04:27 +0800
committerGitHub <noreply@github.com>2017-10-13 11:04:27 +0800
commitf2e7019346eb5c65992eca474a6b332ceb558083 (patch)
treec0d0145cf75b907498d575ea956375241f89d857 /pkgs/tools/filesystems
parent829730d38f19c203ad6c9e052964a9b65ae43a2b (diff)
parent515ea69f098432e20d07f9b72c530b22344dfe61 (diff)
downloadnixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.tar
nixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.tar.gz
nixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.tar.bz2
nixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.tar.lz
nixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.tar.xz
nixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.tar.zst
nixpkgs-f2e7019346eb5c65992eca474a6b332ceb558083.zip
Merge pull request #30340 from peterhoeg/p/cryfs
cryfs: init at 0.9.7 and minor updates to dependencies (scrypt and spdlog)
Diffstat (limited to 'pkgs/tools/filesystems')
-rw-r--r--pkgs/tools/filesystems/cryfs/default.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/tools/filesystems/cryfs/default.nix b/pkgs/tools/filesystems/cryfs/default.nix
new file mode 100644
index 00000000000..07b077b9289
--- /dev/null
+++ b/pkgs/tools/filesystems/cryfs/default.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchFromGitHub
+, cmake, pkgconfig, coreutils
+, boost, cryptopp, curl, fuse, openssl, python, spdlog
+}:
+
+stdenv.mkDerivation rec {
+  name = "cryfs-${version}";
+  version = "0.9.7";
+
+  src = fetchFromGitHub {
+    owner  = "cryfs";
+    repo   = "cryfs";
+    rev    = "${version}";
+    sha256 = "1wsv4cyjkyg3cyr6vipw1mj41bln2m69123l3miav8r4mvmkfq8w";
+  };
+
+  prePatch = ''
+    patchShebangs src
+
+    substituteInPlace vendor/scrypt/CMakeLists.txt \
+      --replace /usr/bin/ ""
+
+    # 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
+
+    # cryfs is vendoring an old version of spdlog
+    rm -rf vendor/spdlog/spdlog
+    ln -s ${spdlog} vendor/spdlog/spdlog
+  '';
+
+  buildInputs = [ boost cryptopp curl fuse openssl python spdlog ];
+
+  # coreutils is needed for the vendored scrypt
+  nativeBuildInputs = [ cmake coreutils pkgconfig ];
+
+  enableParallelBuilding = true;
+
+  cmakeFlags = [
+    "-DCRYFS_UPDATE_CHECKS=OFF"
+    "-DBoost_USE_STATIC_LIBS=OFF" # this option is case sensitive
+    "-DBUILD_TESTING=ON"
+  ];
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Cryptographic filesystem for the cloud";
+    homepage    = https://www.cryfs.org;
+    license     = licenses.lgpl3;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms   = with platforms; linux;
+  };
+}