about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarkus Kowalewski <markus.kowalewski@gmail.com>2024-06-29 13:20:31 +0000
committerGitHub <noreply@github.com>2024-06-29 13:20:31 +0000
commit947213464b0ab2b61db89e061b009e7bc27955a2 (patch)
tree70c1dc1b8f495e42b525baa48d4d7bff4c53d026
parent153864b4ef7cfaa89ec5386028aa3ac51089f07d (diff)
parentb657832db7f9d52b756bd15006a1985c38f0db46 (diff)
Merge pull request #314811 from markuskowa/add-saunafs
saunasfs: init at 4.2.0
-rw-r--r--pkgs/by-name/sa/saunafs/package.nix72
-rw-r--r--pkgs/by-name/sa/saunafs/sfstool.patch13
-rw-r--r--pkgs/top-level/all-packages.nix4
3 files changed, 89 insertions, 0 deletions
diff --git a/pkgs/by-name/sa/saunafs/package.nix b/pkgs/by-name/sa/saunafs/package.nix
new file mode 100644
index 0000000000000..bd35411481745
--- /dev/null
+++ b/pkgs/by-name/sa/saunafs/package.nix
@@ -0,0 +1,72 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  asciidoc,
+  jemalloc,
+  boost,
+  fmt,
+  fuse3,
+  spdlog,
+  yaml-cpp,
+  isa-l,
+  judy,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "saunafs";
+  version = "4.2.0";
+
+  src = fetchFromGitHub {
+    owner = "leil-io";
+    repo = "saunafs";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-rEiiBHB1wRqpnSgFgqVGwA3kOwiDx6MgyTmWyIQHATU=";
+  };
+
+  patches = [
+    ./sfstool.patch
+
+  ];
+
+  outputs = [
+    "out"
+    "man"
+    "dev"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    asciidoc
+  ];
+  buildInputs = [
+    fmt
+    spdlog
+    yaml-cpp
+    fuse3
+    boost
+    jemalloc
+    isa-l
+    judy
+  ];
+
+  cmakeFlags = [
+    (lib.cmakeBool "ENABLE_WERROR" false)
+    (lib.cmakeBool "ENABLE_DOC" false)
+    (lib.cmakeBool "ENABLE_CLIENT_LIB" true)
+    (lib.cmakeBool "ENABLE_JEMALLOC" true)
+  ];
+
+  postInstall = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
+    rm $out/lib/*.a
+  '';
+
+  meta = with lib; {
+    description = "Distributed POSIX file system";
+    homepage = "https://saunafs.com";
+    platforms = platforms.linux;
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.markuskowa ];
+  };
+})
diff --git a/pkgs/by-name/sa/saunafs/sfstool.patch b/pkgs/by-name/sa/saunafs/sfstool.patch
new file mode 100644
index 0000000000000..90c5f840489d1
--- /dev/null
+++ b/pkgs/by-name/sa/saunafs/sfstool.patch
@@ -0,0 +1,13 @@
+diff --git a/src/tools/sfstools.sh b/src/tools/sfstools.sh
+index c6c41197..9a59814f 100755
+--- a/src/tools/sfstools.sh
++++ b/src/tools/sfstools.sh
+@@ -1,5 +1,6 @@
+ #!/usr/bin/env bash
+ 
+-tool=$(basename $0)
++tool="$(basename $0)"
++dir="$(dirname $0)"
+ 
+-${tool/saunafs/saunafs } "$@"
++$dir/saunafs ${tool/sfs/} "$@"
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 28f987a534bc8..c202166f41a8b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2882,6 +2882,10 @@ with pkgs;
     inherit (darwin) autoSignDarwinBinariesHook;
   };
 
+  saunafs = callPackage ../by-name/sa/saunafs/package.nix {
+    boost = boost185;
+  };
+
   mucommander = callPackage ../applications/file-managers/mucommander { };
 
   nnn = callPackage ../applications/file-managers/nnn { };