Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f0057b6924da
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7b512c15570c
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Oct 16, 2019

  1. Copy the full SHA
    80ac778 View commit details
  2. pwndbg: fix runtime python deps, fixes #71071

    pwndbg is a Python module for gdb. The built-in interpreter is used and
    pwndbg offers additional routines. Packaging this is tricky because that
    interpreter needs to be used. Using `python3.withPackages` won't work.
    By setting `NIX_PYTHONPATH`, the interpreter should pick up pwndbg and
    its dependencies.
    
    If `NIX_PYTHONPATH` does not function we can fall back to `PYTHONPATH`.
    An example of when that won't work is if pwndbg runs a script of itself
    in a subshell. `NIX_PYTHONPATH` would be  unset, but `PYTHONPATH` not.
    FRidh committed Oct 16, 2019
    Copy the full SHA
    27a9800 View commit details
  3. Merge pull request #71219 from FRidh/pwndbg

    pwndbg: fix runtime python deps, fixes #71071
    Mic92 authored Oct 16, 2019
    Copy the full SHA
    7b512c1 View commit details
Showing with 25 additions and 32 deletions.
  1. +3 −0 pkgs/development/python-modules/capstone/default.nix
  2. +21 −31 pkgs/development/tools/misc/pwndbg/default.nix
  3. +1 −1 pkgs/top-level/all-packages.nix
3 changes: 3 additions & 0 deletions pkgs/development/python-modules/capstone/default.nix
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
, buildPythonPackage
, fetchPypi
, fetchpatch
, setuptools
}:

buildPythonPackage rec {
@@ -17,6 +18,8 @@ buildPythonPackage rec {
sha256 = "3c0f73db9f8392f7048c8a244809f154d7c39f354e2167f6c477630aa517ed04";
};

propagatedBuildInputs = [ setuptools ];

patches = [
(fetchpatch {
stripLen = 2;
52 changes: 21 additions & 31 deletions pkgs/development/tools/misc/pwndbg/default.nix
Original file line number Diff line number Diff line change
@@ -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; {
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -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;