Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/pwndbg/
Date: Mon, 20 Mar 2023 05:36:14
Message-Id: 1679290329.56a97accfb4f945a55e3893cf56e92e3aea3063f.sam@gentoo
1 commit: 56a97accfb4f945a55e3893cf56e92e3aea3063f
2 Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
3 AuthorDate: Sun Mar 19 11:18:25 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 20 05:32:09 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56a97acc
7
8 dev-util/pwndbg: add 20230319
9
10 Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 dev-util/pwndbg/Manifest | 1 +
14 dev-util/pwndbg/pwndbg-20230319.ebuild | 86 ++++++++++++++++++++++++++++++++++
15 2 files changed, 87 insertions(+)
16
17 diff --git a/dev-util/pwndbg/Manifest b/dev-util/pwndbg/Manifest
18 index f5e465a172af..41795fe22d25 100644
19 --- a/dev-util/pwndbg/Manifest
20 +++ b/dev-util/pwndbg/Manifest
21 @@ -1,2 +1,3 @@
22 DIST gdb-pt-dump-ebdc24573a4bf075cf3ab6016add9db6baacf977.tar.gz 385989 BLAKE2B b7582289f83fd0c76b8ef2a04540db979b0f599b6b711e17541e2804b93bcffe6fd611d43101c96644a7324398eea5df02326267b4e201564929de956849b719 SHA512 57701b5fdd4c69be79a451f08fa6d7cbd43a0963cfd7689443676b68ece96154ccb61121d4a770d6e519d3142f99c589df1143b0ff8308547c06fb0e87e187db
23 DIST pwndbg-20221219.tar.gz 8344938 BLAKE2B 1ecda02573ef03b569f8a46c390f5388e6db9cfbb0df84410f245e4f043e89be16b6581d0e07fe840d50cab875943dd5a30dab1c2fc40fb93c5982cecc33e490 SHA512 1578ea834d7aa1d574e559844dae1991eddc9575c4e445ae02d05f0024900c550253293cba7277ed651df613cb2a2e2028486c2b8bc52adc0dedb9d9796c58d8
24 +DIST pwndbg-20230319.tar.gz 8363103 BLAKE2B 9ad84450116b4e8e3e82107fea6d33505c61e81cde52a209865d4fea1620dd8db2e7f395e2764f9ed38e10311ea9bb77e08fb4c087bd3307ad06d3ea3489ec42 SHA512 aa84908f1dee97e04b72d4f789d78c861507a3a842ecfe00a0ab8a073d63652b8319094a28d910c916131dec3d8fd1eced00c9dc4b97220e1dd76da89baaf695
25
26 diff --git a/dev-util/pwndbg/pwndbg-20230319.ebuild b/dev-util/pwndbg/pwndbg-20230319.ebuild
27 new file mode 100644
28 index 000000000000..bd3b1a48231a
29 --- /dev/null
30 +++ b/dev-util/pwndbg/pwndbg-20230319.ebuild
31 @@ -0,0 +1,86 @@
32 +# Copyright 1999-2023 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +PYTHON_COMPAT=( python3_{9..11} )
38 +
39 +inherit python-single-r1 wrapper
40 +
41 +DESCRIPTION="A GDB plug-in that makes debugging with GDB suck less"
42 +HOMEPAGE="https://github.com/pwndbg/pwndbg"
43 +
44 +if [[ ${PV} == "99999999" ]]; then
45 + inherit git-r3
46 + EGIT_REPO_URI="https://github.com/pwndbg/pwndbg"
47 +else
48 + MY_PV="${PV:0:4}.${PV:4:2}.${PV:6:2}"
49 + GDB_PT_DUMP_COMMIT="ebdc24573a4bf075cf3ab6016add9db6baacf977"
50 + SRC_URI="
51 + https://github.com/pwndbg/pwndbg/archive/${MY_PV}.tar.gz -> ${P}.tar.gz
52 + https://github.com/martinradev/gdb-pt-dump/archive/${GDB_PT_DUMP_COMMIT}.tar.gz -> gdb-pt-dump-${GDB_PT_DUMP_COMMIT}.tar.gz
53 + "
54 + KEYWORDS="~amd64 ~x86"
55 + S="${WORKDIR}/${PN}-${MY_PV}"
56 +fi
57 +
58 +LICENSE="MIT"
59 +SLOT="0"
60 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
61 +
62 +RDEPEND="
63 + ${PYTHON_DEPS}
64 + sys-devel/gdb[python,${PYTHON_SINGLE_USEDEP}]
65 + $(python_gen_cond_dep '
66 + >=dev-libs/capstone-4.0.2[python,${PYTHON_USEDEP}]
67 + >=dev-python/psutil-5.9.4[${PYTHON_USEDEP}]
68 + >=dev-python/pycparser-2.21[${PYTHON_USEDEP}]
69 + >=dev-python/pyelftools-0.29[${PYTHON_USEDEP}]
70 + >=dev-python/pygments-2.13.0[${PYTHON_USEDEP}]
71 + >=dev-python/tabulate-0.8.10[${PYTHON_USEDEP}]
72 + >=dev-python/typing-extensions-4.3.0[${PYTHON_USEDEP}]
73 + >=dev-util/pwntools-4.9.0[${PYTHON_USEDEP}]
74 + >=dev-util/ROPgadget-7.2[${PYTHON_USEDEP}]
75 + >=dev-util/unicorn-2.0.1[python,${PYTHON_USEDEP}]
76 + ')"
77 +
78 +src_prepare() {
79 + if [[ ${PV} == *9999 ]]; then
80 + rm -r gdb-pt-dump/.git || die
81 + else
82 + sed -e "s/__version__ = '\(.*\)'/__version__ = '${PV}'/" \
83 + -i pwndbg/lib/version.py || die
84 +
85 + rm -r gdb-pt-dump || die
86 + mv "${WORKDIR}/gdb-pt-dump-${GDB_PT_DUMP_COMMIT}" gdb-pt-dump || die
87 + fi
88 +
89 + python_fix_shebang "${S}"
90 + default
91 +}
92 +
93 +src_install() {
94 + insinto /usr/share/${PN}
95 + doins -r pwndbg/ gdbinit.py # ida_script.py
96 + doins -r gdb-pt-dump/
97 +
98 + python_optimize "${ED}"/usr/share/${PN}
99 +
100 + make_wrapper "pwndbg" \
101 + "gdb -x \"${EPREFIX}/usr/share/${PN}/gdbinit.py\"" || die
102 +
103 + dodoc {README,DEVELOPING,FEATURES}.md
104 +}
105 +
106 +pkg_postinst() {
107 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
108 + einfo "\nUsage:"
109 + einfo " ~$ pwndbg <program>"
110 + ewarn "\nWARNING!!!"
111 + ewarn "Some pwndbg commands only works with libc debug symbols.\n"
112 + ewarn "See also:"
113 + ewarn " * https://github.com/pentoo/pentoo-overlay/issues/521#issuecomment-548975884"
114 + ewarn " * https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html"
115 + ewarn " * https://wiki.gentoo.org/wiki/Debugging"
116 + fi
117 +}