@@ -21,6 +21,9 @@
2121, installShellFiles
2222}:
2323
24+let
25+ debuggerName = lib.strings.getName debugger;
26+in
2427buildPythonPackage rec {
2528 version = "4.3.1";
2629 pname = "pwntools";
@@ -30,11 +33,15 @@ buildPythonPackage rec {
3033 sha256 = "12ja913kz8wl4afrmpzxh9fx6j7rcwc2vqzkvfr1fxn42gkqhqf4";
3134 };
3235
33− # Upstream has set an upper bound on unicorn because of https://github.com/Gallopsled/pwntools/issues/1538,
34− # but since that is a niche use case and it requires extra work to get unicorn 1.0.2rc3 to work we relax
35− # the bound here. Check if this is still necessary when updating!
3636 postPatch = ''
37+ # Upstream has set an upper bound on unicorn because of https://github.com/Gallopsled/pwntools/issues/1538,
38+ # but since that is a niche use case and it requires extra work to get unicorn 1.0.2rc3 to work we relax
39+ # the bound here. Check if this is still necessary when updating!
3740 sed -i 's/unicorn>=1.0.2rc1,<1.0.2rc4/unicorn>=1.0.2rc1/' setup.py
41+
42+ # Upstream hardcoded the check for the command `gdb-multiarch`;
43+ # Forcefully use the provided debugger, as `gdb` (hence `pwndbg`) is built with multiarch in `nixpkgs`.
44+ sed -i 's/gdb-multiarch/${debuggerName}/' pwnlib/gdb.py
3845 '';
3946
4047 nativeBuildInputs = [
@@ -68,7 +75,7 @@ buildPythonPackage rec {
6875
6976 postFixup = ''
7077 mkdir -p "$out/bin"
71− makeWrapper "${debugger}/bin/${lib.strings.getName debugger}" "$out/bin/pwntools-gdb"
78+ makeWrapper "${debugger}/bin/${debuggerName}" "$out/bin/pwntools-gdb"
7279 '';
7380
7481 meta = with lib; {