media-sound/asunder: Revbump to handle .desktop file properly.
[gentoo.git] / dev-util / leaktracer / leaktracer-2.4-r3.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit toolchain-funcs
6
7 # Upstream-package has no version in it's name.
8 # We therefore repackage it directly, together with the patches.
9 PATCH_LEVEL="2"
10
11 DESCRIPTION="trace and analyze memory leaks in C++ programs"
12 HOMEPAGE="http://www.andreasen.org/LeakTracer/"
13 SRC_URI="mirror://gentoo/${P}-gentoo_p${PATCH_LEVEL}.tbz2"
14
15 LICENSE="public-domain"
16 SLOT="0"
17 KEYWORDS="~amd64 ~ppc ~x86"
18
19 DEPEND="dev-lang/perl
20         sys-devel/gdb"
21 RDEPEND="${DEPEND}"
22
23 # leaktracer is being realized using LD_PRELOAD and segfaults
24 # when being run in the sandbox and the library is _not_ in
25 # /usr/$(get_libdir) which is not possible before installation
26 RESTRICT="test"
27
28 src_prepare() {
29         eapply -p1 "${WORKDIR}/patches/01_all_gcc-cflags.patch"
30         eapply -p0 "${WORKDIR}/patches/05_all_libdir.patch"
31         eapply -p1 "${WORKDIR}/patches/15_all_printf.patch"
32
33         sed -i \
34                 -e "s|%LIBDIR%|$(get_libdir)|" \
35                 LeakCheck || die "sed for setting lib path failed"
36
37         eapply_user
38 }
39
40 src_compile() {
41         emake CXX=$(tc-getCXX)
42 }
43
44 src_install() {
45         dobin LeakCheck leak-analyze
46         dolib.so LeakTracer.so
47         dodoc README test.cc
48         docinto html
49         dodoc README.html
50 }
51
52 pkg_postinst() {
53         elog "To use LeakTracer, run LeakCheck my_prog and then leak-analyze my_prog leak.out"
54         elog "Please refer to README file for more info."
55 }