Merge pull request #71219 from FRidh/pwndbg
pwndbg: fix runtime python deps, fixes #71071
This commit is contained in:
commit
7b512c1557
3 changed files with 25 additions and 32 deletions
|
@ -2,6 +2,7 @@
|
|||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, fetchpatch
|
||||
, setuptools
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
@ -17,6 +18,8 @@ buildPythonPackage rec {
|
|||
sha256 = "3c0f73db9f8392f7048c8a244809f154d7c39f354e2167f6c477630aa517ed04";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ setuptools ];
|
||||
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
stripLen = 2;
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue