1 |
commit: 8f6bafda622ff863a67766217b59adaae31c6ff9 |
2 |
Author: Austin English <wizardedit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 10 19:07:03 2017 +0000 |
4 |
Commit: Austin English <wizardedit <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 10 19:09:27 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f6bafda |
7 |
|
8 |
dev-util/valgrind: add 9999 ebuild |
9 |
|
10 |
Package-Manager: Portage-2.3.6, Repoman-2.3.2 |
11 |
|
12 |
dev-util/valgrind/valgrind-9999.ebuild | 107 +++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 107 insertions(+) |
14 |
|
15 |
diff --git a/dev-util/valgrind/valgrind-9999.ebuild b/dev-util/valgrind/valgrind-9999.ebuild |
16 |
new file mode 100644 |
17 |
index 00000000000..6414792ca62 |
18 |
--- /dev/null |
19 |
+++ b/dev-util/valgrind/valgrind-9999.ebuild |
20 |
@@ -0,0 +1,107 @@ |
21 |
+# Copyright 1999-2017 Gentoo Foundation |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI="6" |
25 |
+inherit autotools flag-o-matic toolchain-funcs multilib pax-utils |
26 |
+ |
27 |
+DESCRIPTION="An open-source memory debugger for GNU/Linux" |
28 |
+HOMEPAGE="http://www.valgrind.org" |
29 |
+LICENSE="GPL-2" |
30 |
+SLOT="0" |
31 |
+IUSE="mpi" |
32 |
+ |
33 |
+if [[ ${PV} == "9999" ]]; then |
34 |
+ EGIT_REPO_URI="git://sourceware.org/git/${PN}.git/" |
35 |
+ inherit git-r3 |
36 |
+else |
37 |
+ SRC_URI="ftp://sourceware.org/pub/valgrind/${P}.tar.bz2" |
38 |
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos" |
39 |
+fi |
40 |
+ |
41 |
+DEPEND="mpi? ( virtual/mpi )" |
42 |
+RDEPEND="${DEPEND}" |
43 |
+ |
44 |
+src_prepare() { |
45 |
+ # Correct hard coded doc location |
46 |
+ sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die |
47 |
+ |
48 |
+ # Don't force multiarch stuff on OSX, bug #306467 |
49 |
+ sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die |
50 |
+ |
51 |
+ # Respect CFLAGS, LDFLAGS |
52 |
+ eapply "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch |
53 |
+ |
54 |
+ # Changing Makefile.all.am to disable SSP |
55 |
+ eapply "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch |
56 |
+ |
57 |
+ # Allow users to test their own patches |
58 |
+ eapply_user |
59 |
+ |
60 |
+ # Regenerate autotools files |
61 |
+ eautoreconf |
62 |
+} |
63 |
+ |
64 |
+src_configure() { |
65 |
+ local myconf |
66 |
+ |
67 |
+ # Respect ar, bug #468114 |
68 |
+ tc-export AR |
69 |
+ |
70 |
+ # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression" |
71 |
+ # while compiling insn_sse.c in none/tests/x86 |
72 |
+ # -fstack-protector more undefined references to __guard and __stack_smash_handler |
73 |
+ # because valgrind doesn't link to glibc (bug #114347) |
74 |
+ # -m64 -mx32 for multilib-portage, bug #398825 |
75 |
+ # -ggdb3 segmentation fault on startup |
76 |
+ filter-flags -fomit-frame-pointer |
77 |
+ filter-flags -fstack-protector |
78 |
+ filter-flags -m64 -mx32 |
79 |
+ replace-flags -ggdb3 -ggdb2 |
80 |
+ |
81 |
+ if use amd64 || use ppc64; then |
82 |
+ ! has_multilib_profile && myconf="${myconf} --enable-only64bit" |
83 |
+ fi |
84 |
+ |
85 |
+ # Force bitness on darwin, bug #306467 |
86 |
+ use x86-macos && myconf="${myconf} --enable-only32bit" |
87 |
+ use x64-macos && myconf="${myconf} --enable-only64bit" |
88 |
+ |
89 |
+ # Don't use mpicc unless the user asked for it (bug #258832) |
90 |
+ if ! use mpi; then |
91 |
+ myconf="${myconf} --without-mpicc" |
92 |
+ fi |
93 |
+ |
94 |
+ econf ${myconf} |
95 |
+} |
96 |
+ |
97 |
+src_install() { |
98 |
+ emake DESTDIR="${D}" install |
99 |
+ |
100 |
+ if [[ ${PV} == "9999" ]]; then |
101 |
+ # Otherwise FAQ.txt won't exist: |
102 |
+ emake -C docs FAQ.txt |
103 |
+ mv docs/FAQ.txt . || die "Couldn't move FAQ.txt" |
104 |
+ fi |
105 |
+ |
106 |
+ dodoc AUTHORS FAQ.txt NEWS README* |
107 |
+ |
108 |
+ pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux |
109 |
+ |
110 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
111 |
+ # fix install_names on shared libraries, can't turn them into bundles, |
112 |
+ # as dyld won't load them any more then, bug #306467 |
113 |
+ local l |
114 |
+ for l in "${ED}"/usr/lib/valgrind/*.so ; do |
115 |
+ install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}" |
116 |
+ done |
117 |
+ fi |
118 |
+} |
119 |
+ |
120 |
+pkg_postinst() { |
121 |
+ elog "Valgrind will not work if glibc does not have debug symbols." |
122 |
+ elog "To fix this you can add splitdebug to FEATURES in make.conf" |
123 |
+ elog "and remerge glibc. See:" |
124 |
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=214065" |
125 |
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=274771" |
126 |
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=388703" |
127 |
+} |