2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, python3
|
2024-05-15 15:35:15 +00:00
|
|
|
, unstableGitUpdater
|
2024-07-27 06:49:29 +00:00
|
|
|
, poetry
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2022-06-26 10:26:21 +00:00
|
|
|
pname = "sherlock";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0-unstable-2024-06-09";
|
|
|
|
format = "pyproject";
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sherlock-project";
|
2024-05-15 15:35:15 +00:00
|
|
|
repo = "sherlock";
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = "d678908c00f16c7f6c44efc0357cef713fa96739";
|
|
|
|
hash = "sha256-XAXDqbdHQta9OiupbPmmyp3TK1VLtDQ7CadsOei/6rs=";
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
patches = [
|
|
|
|
# Avoid hardcoding sherlock
|
|
|
|
./fix-sherlock-bin-test.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/sherlock_interactives.py \
|
|
|
|
--replace @sherlockBin@ "$out/bin/sherlock"
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
certifi
|
|
|
|
colorama
|
|
|
|
pandas
|
|
|
|
pysocks
|
|
|
|
requests
|
|
|
|
requests-futures
|
|
|
|
stem
|
|
|
|
torrequest
|
|
|
|
];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
mkdir -p $out/bin $out/share
|
2023-11-16 04:20:00 +00:00
|
|
|
cp -R ./sherlock $out/share
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postFixup = ''
|
|
|
|
makeWrapper ${python3.interpreter} $out/bin/sherlock \
|
2024-07-27 06:49:29 +00:00
|
|
|
--add-flags "-m" \
|
|
|
|
--add-flags "sherlock" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH:$out/share"
|
2023-11-16 04:20:00 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
|
|
|
pytestCheckHook
|
|
|
|
poetry
|
|
|
|
poetry-core
|
|
|
|
jsonschema
|
|
|
|
openpyxl
|
|
|
|
stem
|
|
|
|
pythonRelaxDepsHook
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"stem"
|
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-m"
|
|
|
|
"'not online'"
|
|
|
|
];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater {
|
|
|
|
hardcodeZeroVersion = true;
|
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://sherlock-project.github.io/";
|
|
|
|
description = "Hunt down social media accounts by username across social networks";
|
|
|
|
license = licenses.mit;
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "sherlock";
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ applePrincess ];
|
|
|
|
};
|
|
|
|
}
|