2021-09-21 22:57:16 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, libewf, afflib, openssl, zlib, openjdk, perl, ant }:
|
2011-08-02 20:06:09 +00:00
|
|
|
|
2013-10-18 11:44:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-01-01 22:32:57 +00:00
|
|
|
version = "4.11.1";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "sleuthkit";
|
2013-10-18 11:44:30 +00:00
|
|
|
|
2021-09-21 22:57:16 +00:00
|
|
|
sleuthsrc = fetchFromGitHub {
|
2018-01-28 21:19:54 +00:00
|
|
|
owner = "sleuthkit";
|
|
|
|
repo = "sleuthkit";
|
2019-08-15 12:41:18 +00:00
|
|
|
rev = "${pname}-${version}";
|
2022-01-01 22:32:57 +00:00
|
|
|
sha256 = "sha256-TM8My4dAZigukwMUNDnP3aVCQ8JDdVv/KNkchDvCl9I=";
|
2011-08-02 20:06:09 +00:00
|
|
|
};
|
|
|
|
|
2021-09-21 22:57:16 +00:00
|
|
|
# Fetch libraries using a fixed output derivation
|
|
|
|
rdeps = stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
version = "1.0";
|
|
|
|
pname = "sleuthkit-deps";
|
|
|
|
nativeBuildInputs = [ openjdk ant ];
|
|
|
|
|
|
|
|
src = sleuthsrc;
|
|
|
|
|
|
|
|
# unpack, build, install
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export IVY_HOME=$NIX_BUILD_TOP/.ant
|
|
|
|
pushd bindings/java
|
|
|
|
ant retrieve-deps
|
|
|
|
popd
|
|
|
|
pushd case-uco/java
|
|
|
|
ant get-ivy-dependencies
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
export IVY_HOME=$NIX_BUILD_TOP/.ant
|
|
|
|
mkdir -m 755 -p $out/bindings/java
|
|
|
|
cp -r bindings/java/lib $out/bindings/java
|
|
|
|
mkdir -m 755 -p $out/case-uco/java
|
|
|
|
cp -r case-uco/java/lib $out/case-uco/java
|
|
|
|
cp -r $IVY_HOME/lib $out
|
|
|
|
chmod -R 755 $out/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputHashMode = "recursive";
|
|
|
|
outputHash = "0fq7v6zlgybg4v6k9wqjlk4gaqgjrpihbnr182vaqriihflav2s8";
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
};
|
|
|
|
|
|
|
|
src = sleuthsrc;
|
|
|
|
|
2018-01-28 21:19:54 +00:00
|
|
|
postPatch = ''
|
2021-02-09 22:33:57 +00:00
|
|
|
substituteInPlace tsk/img/ewf.cpp --replace libewf_handle_read_random libewf_handle_read_buffer_at_offset
|
2018-01-28 21:19:54 +00:00
|
|
|
'';
|
|
|
|
|
2013-10-18 11:44:30 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-09-21 22:57:16 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook openjdk perl ant rdeps ];
|
2013-10-18 11:44:30 +00:00
|
|
|
buildInputs = [ libewf afflib openssl zlib ];
|
|
|
|
|
2021-09-21 22:57:16 +00:00
|
|
|
# Hack to fix the RPATH
|
|
|
|
preFixup = ''
|
|
|
|
rm -rf */.libs
|
|
|
|
'';
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
export IVY_HOME="$NIX_BUILD_TOP/.ant"
|
|
|
|
export JAVA_HOME="${openjdk}"
|
|
|
|
export ant_args="-Doffline=true -Ddefault-jar-location=$IVY_HOME/lib"
|
|
|
|
|
|
|
|
# pre-positioning these jar files allows -Doffline=true to work
|
|
|
|
mkdir -p source/{bindings,case-uco}/java $IVY_HOME
|
|
|
|
cp -r ${rdeps}/bindings/java/lib source/bindings/java
|
|
|
|
chmod -R 755 source/bindings/java
|
|
|
|
cp -r ${rdeps}/case-uco/java/lib source/case-uco/java
|
|
|
|
chmod -R 755 source/case-uco/java
|
|
|
|
cp -r ${rdeps}/lib $IVY_HOME
|
|
|
|
chmod -R 755 $IVY_HOME
|
|
|
|
'';
|
2011-08-02 20:06:09 +00:00
|
|
|
|
2021-09-21 22:57:16 +00:00
|
|
|
meta = with lib; {
|
2011-08-02 20:06:09 +00:00
|
|
|
description = "A forensic/data recovery tool";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.sleuthkit.org/";
|
2021-09-21 22:57:16 +00:00
|
|
|
maintainers = with maintainers; [ raskin gfrascadorio ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.ipl10;
|
2011-08-02 20:06:09 +00:00
|
|
|
};
|
2013-10-18 11:44:30 +00:00
|
|
|
}
|