public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-util/pwndbg/, dev-util/pwndbg/files/
@ 2023-12-04  8:33 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2023-12-04  8:33 UTC (permalink / raw
  To: gentoo-commits

commit:     646a889ecd781bdaf6176d15f7bb56171bb70389
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Wed Nov 29 18:14:41 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec  4 08:33:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=646a889e

dev-util/pwndbg: prevent pwndbg from setting up its own venv

Bug: https://bugs.gentoo.org/918705
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Thanks-to: Stefan Gloor <code <AT> stefan-gloor.ch>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../pwndbg/files/pwndbg-20230717-no-venv.patch     | 46 ++++++++++++++++++++++
 ...g-20230717.ebuild => pwndbg-20230717-r1.ebuild} |  4 ++
 2 files changed, 50 insertions(+)

diff --git a/dev-util/pwndbg/files/pwndbg-20230717-no-venv.patch b/dev-util/pwndbg/files/pwndbg-20230717-no-venv.patch
new file mode 100644
index 000000000000..4011236240f9
--- /dev/null
+++ b/dev-util/pwndbg/files/pwndbg-20230717-no-venv.patch
@@ -0,0 +1,46 @@
+From 6a351680675123ccc0d8fb192f28f3c654979c92 Mon Sep 17 00:00:00 2001
+From: Stefan Gloor <code@stefan-gloor.ch>
+Date: Tue, 28 Nov 2023 20:24:26 +0100
+Subject: [PATCH] Use global python packages instead of virtualenv
+Bug: https://bugs.gentoo.org/918705
+
+The upstream install script creates a .venv and installs the
+dependencies there. This patch allows the normal python packages to be
+used.
+
+Signed-off-by: Stefan Gloor <code@stefan-gloor.ch>
+--- a/gdbinit.py
++++ b/gdbinit.py
+@@ -20,29 +20,6 @@ directory, file = path.split(__file__)
+ directory = path.expanduser(directory)
+ directory = path.abspath(directory)
+ 
+-# Get virtualenv's site-packages path
+-venv_path = os.environ.get("PWNDBG_VENV_PATH")
+-if not venv_path:
+-    venv_path = os.path.join(directory, ".venv")
+-
+-if not os.path.exists(venv_path):
+-    print(f"Cannot find Pwndbg virtualenv directory: {venv_path}: please re-run setup.sh")
+-    sys.exit(1)
+-
+-site_pkgs_path = glob(os.path.join(venv_path, "lib/*/site-packages"))[0]
+-
+-# add virtualenv's site-packages to sys.path and run .pth files
+-site.addsitedir(site_pkgs_path)
+-
+-# remove existing, system-level site-packages from sys.path
+-for site_packages in site.getsitepackages():
+-    if site_packages in sys.path:
+-        sys.path.remove(site_packages)
+-
+-# Set virtualenv's bin path (needed for utility tools like ropper, pwntools etc)
+-bin_path = os.path.join(venv_path, "bin")
+-os.environ["PATH"] = bin_path + os.pathsep + os.environ.get("PATH")
+-
+ # Add gdb-pt-dump directory to sys.path so it can be imported
+ gdbpt = path.join(directory, "gdb-pt-dump")
+ sys.path.append(directory)
+-- 
+2.41.0
+

diff --git a/dev-util/pwndbg/pwndbg-20230717.ebuild b/dev-util/pwndbg/pwndbg-20230717-r1.ebuild
similarity index 97%
rename from dev-util/pwndbg/pwndbg-20230717.ebuild
rename to dev-util/pwndbg/pwndbg-20230717-r1.ebuild
index 8de162e49a85..9cd280c6f445 100644
--- a/dev-util/pwndbg/pwndbg-20230717.ebuild
+++ b/dev-util/pwndbg/pwndbg-20230717-r1.ebuild
@@ -44,6 +44,10 @@ RDEPEND="
 		>=dev-util/unicorn-2.0.1[python,${PYTHON_USEDEP}]
 	')"
 
+PATCHES=(
+	"${FILESDIR}/${P}-no-venv.patch"	# Bug 918705
+)
+
 src_prepare() {
 	if [[ ${PV} == *9999 ]]; then
 		rm -r gdb-pt-dump/.git || die


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-04  8:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04  8:33 [gentoo-commits] repo/gentoo:master commit in: dev-util/pwndbg/, dev-util/pwndbg/files/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox