about summary refs log tree commit diff
path: root/pkgs/by-name/sc
diff options
context:
space:
mode:
authora-n-n-a-l-e-e <150648636+a-n-n-a-l-e-e@users.noreply.github.com>2024-01-16 23:03:23 -0800
committerGitHub <noreply@github.com>2024-01-16 23:03:23 -0800
commit1e36102604aad0137a0628341566f97fd11f370a (patch)
treec5f66c86ef90c004909f221363ce59415f449ea2 /pkgs/by-name/sc
parent24f8634807fda7afa43a480c737e9e271a676b70 (diff)
parent5ec01e69b48345d32cf8f2a6e02782a727167451 (diff)
Merge pull request #278750 from shard77/patch-1
scalpel: init at 2.1
Diffstat (limited to 'pkgs/by-name/sc')
-rw-r--r--pkgs/by-name/sc/scalpel/package.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/by-name/sc/scalpel/package.nix b/pkgs/by-name/sc/scalpel/package.nix
new file mode 100644
index 0000000000000..94246fff86826
--- /dev/null
+++ b/pkgs/by-name/sc/scalpel/package.nix
@@ -0,0 +1,56 @@
+{ lib
+, fetchFromGitHub
+, stdenv
+, autoconf
+, automake
+, libtool
+, tre
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "scalpel";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "sleuthkit";
+    repo = "scalpel";
+    rev = "35e1367ef2232c0f4883c92ec2839273c821dd39";
+    hash = "sha256-0lqU1CAcWXNw9WFa29BXla1mvABlzWV+hcozZyfR0oE=";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    libtool
+    tre
+  ];
+
+  postPatch = ''
+    sed -i \
+      -e 's|#define\s*SCALPEL_DEFAULT_CONFIG_FILE\s.*"scalpel.conf"|#define SCALPEL_DEFAULT_CONFIG_FILE "${placeholder "out"}/share/scalpel/scalpel.conf"|' \
+      src/scalpel.h
+  '';
+
+  env.CXXFLAGS = "-std=c++14" + lib.optionalString  stdenv.cc.isClang " -Wno-error=reserved-user-defined-literal";
+
+  preConfigure = ''
+    ./bootstrap
+  '';
+
+  configureFlags = [
+    "--with-pic"
+  ];
+
+  postInstall = ''
+    install -Dm644 scalpel.conf -t $out/share/scalpel/
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/sleuthkit/scalpel";
+    description = "Recover files based on their headers, footers and internal data structures, based on Foremost";
+    mainProgram = "scalpel";
+    maintainers = with maintainers; [ shard7 ];
+    platforms = platforms.unix;
+    license = with licenses; [ asl20 ];
+  };
+})