diff --git a/pkgs/development/python-modules/capstone/default.nix b/pkgs/development/python-modules/capstone/default.nix index 2bd22ebf0d9b..035632f9cf25 100644 --- a/pkgs/development/python-modules/capstone/default.nix +++ b/pkgs/development/python-modules/capstone/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , fetchpatch +, setuptools }: buildPythonPackage rec { @@ -17,6 +18,8 @@ buildPythonPackage rec { sha256 = "3c0f73db9f8392f7048c8a244809f154d7c39f354e2167f6c477630aa517ed04"; }; + propagatedBuildInputs = [ setuptools ]; + patches = [ (fetchpatch { stripLen = 2; 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 a50fa7b2a043..eb6854327422 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;