commit:     6090e8a274dc262603738136f6886a623bd3269b
Author:     Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Sun May 11 14:31:53 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 11 14:39:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6090e8a2

dev-debug/pwndbg: Don't install docs into site-packages directory

Closes: https://bugs.gentoo.org/954386
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Part-of: https://github.com/gentoo/gentoo/pull/42030
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../pwndbg/files/pwndbg-20250418-no-docs.patch     | 22 ++++++
 dev-debug/pwndbg/pwndbg-20250418-r1.ebuild         | 85 ++++++++++++++++++++++
 2 files changed, 107 insertions(+)

diff --git a/dev-debug/pwndbg/files/pwndbg-20250418-no-docs.patch 
b/dev-debug/pwndbg/files/pwndbg-20250418-no-docs.patch
new file mode 100644
index 000000000000..c456c1384818
--- /dev/null
+++ b/dev-debug/pwndbg/files/pwndbg-20250418-no-docs.patch
@@ -0,0 +1,22 @@
+commit 73685a31c372d44ea90f44cdddeea23d135f1c67
+Author: Mario Haustein <[email protected]>
+Date:   Sun May 11 16:25:56 2025 +0200
+Upstream: https://github.com/pwndbg/pwndbg/pull/2973
+Bug: https://bugs.gentoo.org/954386
+
+    Don't install `docs/` directory into site packages directory
+
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -126,9 +126,11 @@ builtins-ignorelist = [
+ 
+ [tool.hatch.build.targets.sdist]
+ include = ["pwndbg"]
++exclude = ["docs"]
+ 
+ [tool.hatch.build.targets.wheel]
+ include = ["pwndbg"]
++exclude = ["docs"]
+ 
+ [build-system]
+ requires = ["hatchling"]

diff --git a/dev-debug/pwndbg/pwndbg-20250418-r1.ebuild 
b/dev-debug/pwndbg/pwndbg-20250418-r1.ebuild
new file mode 100644
index 000000000000..4f4114c2ad5e
--- /dev/null
+++ b/dev-debug/pwndbg/pwndbg-20250418-r1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+DISTUTILS_SINGLE_IMPL=1
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit distutils-r1 wrapper
+
+DESCRIPTION="A GDB plug-in that makes debugging with GDB suck less"
+HOMEPAGE="https://github.com/pwndbg/pwndbg";
+
+if [[ ${PV} == "99999999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/pwndbg/pwndbg";
+else
+       MY_PV="${PV:0:4}.${PV:4:2}.${PV:6:2}"
+       SRC_URI="https://github.com/pwndbg/pwndbg/archive/${MY_PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm64 ~x86"
+       S="${WORKDIR}/${PN}-${MY_PV}"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+RDEPEND="
+       dev-debug/gdb[python,${PYTHON_SINGLE_USEDEP}]
+       ~dev-python/gdb-pt-dump-0.0.0_p20240401[${PYTHON_SINGLE_USEDEP}]
+       $(python_gen_cond_dep '
+               >=dev-libs/capstone-5.0.3[python,${PYTHON_USEDEP}]
+               >=dev-python/psutil-5.9.8[${PYTHON_USEDEP}]
+               >=dev-python/pycparser-2.22[${PYTHON_USEDEP}]
+               >=dev-python/pyelftools-0.29[${PYTHON_USEDEP}]
+               >=dev-python/pygments-2.18.0[${PYTHON_USEDEP}]
+               >=dev-python/requests-2.32.3[${PYTHON_USEDEP}]
+               >=dev-python/rich-13.7.1[${PYTHON_USEDEP}]
+               >=dev-python/sortedcontainers-2.4.0[${PYTHON_USEDEP}]
+               >=dev-python/tabulate-0.9.0[${PYTHON_USEDEP}]
+               >=dev-python/typing-extensions-4.12.0[${PYTHON_USEDEP}]
+               >=dev-util/pwntools-4.14.0[${PYTHON_USEDEP}]
+               >=dev-util/ROPgadget-7.3[${PYTHON_USEDEP}]
+               >=dev-util/unicorn-2.1.3[python,${PYTHON_USEDEP}]
+       ')
+"
+
+# Tests are architectur-specific (precompiled binaries)
+RESTRICT="test"
+
+PATCHES=(
+       "${FILESDIR}/${P}-no-docs.patch"
+)
+
+src_install() {
+       distutils-r1_src_install
+
+       insinto /usr/share/${PN}
+       doins gdbinit.py
+
+       # Signal pwndbg not to create it's own python venv (Bug #918705).
+       # See: 
https://github.com/pwndbg/pwndbg/commit/139b7542cd9567eaff32bd713df971b6ac5b81de
+       touch "${ED}/usr/share/${PN}/.skip-venv" || die
+
+       python_optimize "${ED}"/usr/share/${PN}
+
+       make_wrapper "pwndbg" \
+               "gdb -x \"${EPREFIX}/usr/share/${PN}/gdbinit.py\"" || die
+
+       dodoc {README,DEVELOPING,FEATURES}.md
+       dodoc -r docs
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               einfo "\nUsage:"
+               einfo "    ~$ pwndbg <program>"
+               ewarn "\nWARNING!!!"
+               ewarn "Some pwndbg commands only works with libc debug 
symbols.\n"
+               ewarn "See also:"
+               ewarn " * 
https://github.com/pentoo/pentoo-overlay/issues/521#issuecomment-548975884";
+               ewarn " * 
https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html";
+               ewarn " * https://wiki.gentoo.org/wiki/Debugging";
+       fi
+}

Reply via email to