*/*: Bump copyright on files touched this year
[gentoo.git] / dev-libs / dmalloc / dmalloc-5.5.2-r4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 inherit autotools eutils multilib
7
8 DESCRIPTION="A Debug Malloc Library"
9 HOMEPAGE="http://dmalloc.com"
10 SRC_URI="http://dmalloc.com/releases/${P}.tgz"
11
12 LICENSE="CC-BY-SA-3.0"
13 SLOT="0"
14 KEYWORDS="~alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
15 IUSE="static-libs threads"
16
17 DEPEND="sys-apps/texinfo"
18 RDEPEND=""
19
20 DOCS=( NEWS README docs/NOTES docs/TODO )
21
22 src_prepare() {
23         # - Build objects twice, once -fPIC for shared.
24         # - Use DESTDIR.
25         # - Fix SONAME and NEEDED.
26         epatch "${FILESDIR}"/${P}-Makefile.in.patch
27         # - Broken test, always returns false.
28         epatch "${FILESDIR}"/${P}-cxx.patch
29         # - Add threads support.
30         use threads && epatch "${FILESDIR}"/${P}-threads.patch
31         # Respect CFLAGS/LDFLAGS. #337429
32         sed -i Makefile.in \
33                 -e '/libdmalloc/ s:$(CC):& $(CFLAGS) $(LDFLAGS):g' \
34                 || die "sed Makefile.in"
35         # - Run autoconf for -cxx.patch.
36         eautoconf
37 }
38
39 src_configure() {
40         econf --enable-cxx --enable-shlib $(use_enable threads)
41 }
42
43 src_compile() {
44         default
45
46         cd docs
47         makeinfo dmalloc.texi || die
48 }
49
50 src_test() {
51         emake heavy
52 }
53
54 src_install() {
55         default
56
57         newdoc ChangeLog.1 ChangeLog
58         insinto /usr/share/doc/${PF}
59         doins docs/dmalloc.pdf
60         dohtml RELEASE.html docs/dmalloc.html
61         doinfo docs/dmalloc.info
62
63         # add missing symlinks, lazy
64         dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so
65         dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV%%.*}
66
67         for lib in cxx th thcxx; do
68                 dosym lib${PN}${lib}.so.${PV} /usr/$(get_libdir)/lib${PN}${lib}.so
69                 dosym lib${PN}${lib}.so.${PV} \
70                         /usr/$(get_libdir)/lib${PN}${lib}.so.${PV%%.*}
71         done
72
73         if ! use static-libs; then
74                 rm "${D}"/usr/$(get_libdir)/lib${PN}*.a || die
75         fi
76 }