diff --git a/pkgs/development/tools/misc/pwndbg/default.nix b/pkgs/development/tools/misc/pwndbg/default.nix index 7182144fd200..9af43e4b7471 100644 --- a/pkgs/development/tools/misc/pwndbg/default.nix +++ b/pkgs/development/tools/misc/pwndbg/default.nix @@ -1,33 +1,12 @@ { stdenv +, python3 , fetchFromGitHub , makeWrapper , gdb -, future -, isort -, psutil -, pycparser -, pyelftools -, python-ptrace -, ROPGadget -, six -, unicorn -, pygments -, }: +}: -stdenv.mkDerivation rec { - pname = "pwndbg"; - version = "2019.01.25"; - - src = fetchFromGitHub { - owner = "pwndbg"; - repo = "pwndbg"; - rev = version; - sha256 = "0k7n6pcrj62ccag801yzf04a9mj9znghpkbnqwrzz0qn3rs42vgs"; - }; - - nativeBuildInputs = [ makeWrapper ]; - - propagatedBuildInputs = [ +let + pythonPath = with python3.pkgs; makePythonPath [ future isort psutil @@ -40,16 +19,27 @@ stdenv.mkDerivation rec { pygments ]; +in stdenv.mkDerivation rec { + pname = "pwndbg"; + version = "2019.01.25"; + format = "other"; + + src = fetchFromGitHub { + owner = "pwndbg"; + repo = "pwndbg"; + rev = version; + sha256 = "0k7n6pcrj62ccag801yzf04a9mj9znghpkbnqwrzz0qn3rs42vgs"; + }; + + nativeBuildInputs = [ makeWrapper ]; + installPhase = '' mkdir -p $out/share/pwndbg cp -r *.py pwndbg $out/share/pwndbg + chmod +x $out/share/pwndbg/gdbinit.py makeWrapper ${gdb}/bin/gdb $out/bin/pwndbg \ - --add-flags "-q -x $out/share/pwndbg/gdbinit.py" - ''; - - preFixup = '' - sed -i "/import sys/a import sys; sys.path[0:0] = '$PYTHONPATH'.split(':')" \ - $out/share/pwndbg/gdbinit.py + --add-flags "-q -x $out/share/pwndbg/gdbinit.py" \ + --set NIX_PYTHONPATH ${pythonPath} ''; meta = with stdenv.lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 370f526493d0..6990caffd6b3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5711,7 +5711,7 @@ in pwnat = callPackage ../tools/networking/pwnat { }; - pwndbg = python3Packages.callPackage ../development/tools/misc/pwndbg { }; + pwndbg = callPackage ../development/tools/misc/pwndbg { }; pycangjie = pythonPackages.pycangjie;