Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
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-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 12c10e256ad1
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0f9b2d9c8607
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 16, 2019

  1. pythonPackages.capstone: add missing setuptools dep

    (cherry picked from commit 80ac778)
    FRidh authored and Mic92 committed Oct 16, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Mic92 Jörg Thalheim
    Copy the full SHA
    57f68f7 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.
    
    (cherry picked from commit 27a9800)
    FRidh authored and Mic92 committed Oct 16, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Mic92 Jörg Thalheim
    Copy the full SHA
    0f9b2d9 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
@@ -5626,7 +5626,7 @@ in

pwnat = callPackage ../tools/networking/pwnat { };

pwndbg = python3Packages.callPackage ../development/tools/misc/pwndbg { };
pwndbg = callPackage ../development/tools/misc/pwndbg { };

pycangjie = pythonPackages.pycangjie;