nixpkgs/pkgs/tools/security/sherlock/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.4 KiB
Nix
Raw Normal View History

2021-08-09 06:03:42 +00:00
{ stdenv, lib, fetchFromGitHub, python3, makeWrapper }:
let
pyenv = python3.withPackages (pp: with pp; [
beautifulsoup4
certifi
colorama
lxml
2023-04-03 02:20:09 +00:00
pandas
2021-08-09 06:03:42 +00:00
pysocks
requests
requests-futures
soupsieve
stem
torrequest
]);
in
stdenv.mkDerivation rec {
pname = "sherlock";
2023-04-03 02:20:09 +00:00
version = "0.14.3";
2021-08-09 06:03:42 +00:00
src = fetchFromGitHub {
owner = "sherlock-project";
repo = pname;
2023-04-03 02:20:09 +00:00
rev = "ab2f6788340903df797d8c336a97fa6e742daf77";
hash = "sha256-AbWZa33DNrDM0FdjoFSVMnz4Ph7mUiUe/erhI3w7GQQ";
2021-08-09 06:03:42 +00:00
};
nativeBuildInputs = [ makeWrapper ];
postPatch = ''
substituteInPlace sherlock/sherlock.py \
--replace "os.path.dirname(__file__)" "\"$out/share\""
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share
cp ./sherlock/*.py $out/bin/
cp --recursive ./sherlock/resources/ $out/share
makeWrapper ${pyenv.interpreter} $out/bin/sherlock --add-flags "$out/bin/sherlock.py"
runHook postInstall
'';
checkPhase = ''
runHook preCheck
cd $srcRoot/sherlock
${pyenv.interpreter} -m unittest tests.all.SherlockSiteCoverageTests --verbose
runHook postCheck
'';
meta = with lib; {
homepage = "https://sherlock-project.github.io/";
description = "Hunt down social media accounts by username across social networks";
license = licenses.mit;
maintainers = with maintainers; [ applePrincess ];
};
}