summaryrefslogtreecommitdiff
path: root/dev-debug/leaktracer/leaktracer-2.4-r3.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-19 20:08:27 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-19 20:08:27 +0000
commit2b2f431a0021b4787ca3c028cefb30ad81347778 (patch)
tree951e0155f53027c8fd29eaba26df4f08292668d5 /dev-debug/leaktracer/leaktracer-2.4-r3.ebuild
parentd725480af7cbc67d784e5d96f973fa41e9030123 (diff)
gentoo auto-resync : 19:01:2024 - 20:08:27
Diffstat (limited to 'dev-debug/leaktracer/leaktracer-2.4-r3.ebuild')
-rw-r--r--dev-debug/leaktracer/leaktracer-2.4-r3.ebuild56
1 files changed, 56 insertions, 0 deletions
diff --git a/dev-debug/leaktracer/leaktracer-2.4-r3.ebuild b/dev-debug/leaktracer/leaktracer-2.4-r3.ebuild
new file mode 100644
index 000000000000..e0ba6140a682
--- /dev/null
+++ b/dev-debug/leaktracer/leaktracer-2.4-r3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+# Upstream-package has no version in it's name.
+# We therefore repackage it directly, together with the patches.
+PATCH_LEVEL="2"
+
+DESCRIPTION="Trace and analyze memory leaks in C++ programs"
+HOMEPAGE="https://andreasen.org/LeakTracer/"
+SRC_URI="mirror://gentoo/${P}-gentoo_p${PATCH_LEVEL}.tbz2"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+DEPEND="dev-lang/perl
+ dev-debug/gdb"
+RDEPEND="${DEPEND}"
+
+# leaktracer is being realized using LD_PRELOAD and segfaults
+# when being run in the sandbox and the library is _not_ in
+# /usr/$(get_libdir) which is not possible before installation
+RESTRICT="test"
+
+src_prepare() {
+ eapply -p1 "${WORKDIR}/patches/01_all_gcc-cflags.patch"
+ eapply -p0 "${WORKDIR}/patches/05_all_libdir.patch"
+ eapply -p1 "${WORKDIR}/patches/15_all_printf.patch"
+
+ sed -i \
+ -e "s|%LIBDIR%|$(get_libdir)|" \
+ LeakCheck || die "sed for setting lib path failed"
+
+ eapply_user
+}
+
+src_compile() {
+ emake CXX="$(tc-getCXX)"
+}
+
+src_install() {
+ dobin LeakCheck leak-analyze
+ dolib.so LeakTracer.so
+ dodoc README test.cc
+ docinto html
+ dodoc README.html
+}
+
+pkg_postinst() {
+ elog "To use LeakTracer, run LeakCheck my_prog and then leak-analyze my_prog leak.out"
+ elog "Please refer to README file for more info."
+}