diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:21 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:48 +0100 |
commit | 048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch) | |
tree | f8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/tools/security/sherlock/default.nix | |
parent | 030c5028b07afcedce7c5956015c629486cc79d9 (diff) | |
parent | 4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff) | |
download | nixpkgs-rootfs.tar nixpkgs-rootfs.tar.gz nixpkgs-rootfs.tar.bz2 nixpkgs-rootfs.tar.lz nixpkgs-rootfs.tar.xz nixpkgs-rootfs.tar.zst nixpkgs-rootfs.zip |
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/tools/security/sherlock/default.nix')
-rw-r--r-- | pkgs/tools/security/sherlock/default.nix | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/pkgs/tools/security/sherlock/default.nix b/pkgs/tools/security/sherlock/default.nix index 05954db5162..e3d6f658aea 100644 --- a/pkgs/tools/security/sherlock/default.nix +++ b/pkgs/tools/security/sherlock/default.nix @@ -1,50 +1,61 @@ -{ stdenv, lib, fetchFromGitHub, python3, makeWrapper }: -let - pyenv = python3.withPackages (pp: with pp; [ - beautifulsoup4 - certifi - colorama - lxml - pandas - pysocks - requests - requests-futures - soupsieve - stem - torrequest - ]); -in -stdenv.mkDerivation rec { +{ lib +, fetchFromGitHub +, makeWrapper +, python3 +}: + +python3.pkgs.buildPythonApplication rec { pname = "sherlock"; - version = "0.14.3"; + version = "unstable-2023-10-06"; + format = "other"; src = fetchFromGitHub { owner = "sherlock-project"; repo = pname; - rev = "ab2f6788340903df797d8c336a97fa6e742daf77"; - hash = "sha256-AbWZa33DNrDM0FdjoFSVMnz4Ph7mUiUe/erhI3w7GQQ"; + rev = "7ec56895a37ada47edd6573249c553379254d14a"; + hash = "sha256-bK5yEdh830vgKcsU3gLH7TybLncnX6eRIiYPUiVWM74="; }; nativeBuildInputs = [ makeWrapper ]; - postPatch = '' - substituteInPlace sherlock/sherlock.py \ - --replace "os.path.dirname(__file__)" "\"$out/share\"" - ''; + propagatedBuildInputs = with python3.pkgs; [ + certifi + colorama + pandas + pysocks + requests + requests-futures + stem + torrequest + ]; 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" + cp -R ./sherlock $out/share + runHook postInstall ''; + postFixup = '' + makeWrapper ${python3.interpreter} $out/bin/sherlock \ + --add-flags $out/share/sherlock/sherlock.py \ + --prefix PYTHONPATH : "$PYTHONPATH" + ''; + + checkInputs = with python3.pkgs; [ + exrex + ]; + checkPhase = '' runHook preCheck - cd $srcRoot/sherlock - ${pyenv.interpreter} -m unittest tests.all.SherlockSiteCoverageTests --verbose + + cd $out/share/sherlock + for tests in all test_multiple_usernames; do + ${python3.interpreter} -m unittest tests.$tests --verbose + done + runHook postCheck ''; @@ -52,6 +63,7 @@ stdenv.mkDerivation rec { homepage = "https://sherlock-project.github.io/"; description = "Hunt down social media accounts by username across social networks"; license = licenses.mit; + mainProgram = "sherlock"; maintainers = with maintainers; [ applePrincess ]; }; } |