net-voip/ekiga: ppc64 stable wrt bug #598916
[gentoo.git] / sci-electronics / systemc / systemc-2.2.0-r2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 inherit versionator multilib toolchain-funcs
8
9 DESCRIPTION="A C++ based modeling platform for VLSI and system-level co-design"
10 HOMEPAGE="http://www.systemc.org/"
11 SRC_URI="${P}.tgz"
12
13 SLOT="0"
14 LICENSE="SOPLA-2.3"
15 IUSE=""
16 KEYWORDS="~amd64 ~x86"
17
18 RESTRICT="fetch test"
19
20 pkg_nofetch() {
21         elog "${PN} developers require end-users to accept their license agreement"
22         elog "by registering on their Web site (${HOMEPAGE})."
23         elog "Please download ${A} manually and place it in ${DISTDIR}."
24 }
25
26 src_prepare() {
27         sed -i -e "s:lib-\$(TARGET_ARCH):$(get_libdir):g" $(find . -name Makefile.in) || die "Patching Makefile.in failed"
28
29         sed -i -e "s:OPT_CXXFLAGS=\"-O3\":OPT_CXXFLAGS=\"${CXXFLAGS}\":g" configure || die "Patching configure failed"
30
31         sed -i -e '/#include "sysc\/utils\/sc_report.h"/a \
32 #include <cstdlib> \
33 #include <cstring>' src/sysc/utils/sc_utils_ids.cpp  || die "Patching failed"
34
35         for sfile in src/sysc/qt/md/*.s ; do
36                 sed -i -e '$a \
37 #if defined(__linux__) && defined(__ELF__) \
38 .section .note.GNU-stack,"",%progbits \
39 #endif' "${sfile}" || die "Patching ${sfile} failed"
40         done
41 }
42
43 src_configure() {
44         econf --disable-dependency-tracking CXX=$(tc-getCXX)
45 }
46
47 src_compile() {
48         cd src
49         default
50 }
51
52 src_install() {
53         dodoc AUTHORS ChangeLog INSTALL NEWS README RELEASENOTES
54         doins -r docs
55         cd src
56         default
57 }
58
59 pkg_postinst() {
60         elog "If you want to run the examples, you need to :"
61         elog "    tar xvfz ${PORTAGE_ACTUAL_DISTDIR}/${A}"
62         elog "    cd ${P}"
63         elog "    find examples -name 'Makefile.*' -exec sed -i -e 's/-lm/-lm -lpthread/' '{}' \;"
64         elog "    ./configure"
65         elog "    cd examples"
66         elog "    make check"
67 }