/[gentoo-x86]/dev-libs/gmp/gmp-5.0.2_p1.ebuild
Gentoo

Contents of /dev-libs/gmp/gmp-5.0.2_p1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Mon Feb 13 10:42:49 2012 UTC (2 years, 9 months ago) by xarthisius
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +2 -2 lines
ppc64 stable wrt #395193

(Portage version: 2.2.0_alpha86/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/gmp-5.0.2_p1.ebuild,v 1.11 2012/02/01 21:10:31 ranger Exp $
4
5 inherit flag-o-matic eutils libtool toolchain-funcs
6
7 MY_PV=${PV/_p*}
8 MY_P=${PN}-${MY_PV}
9 PLEVEL=${PV/*p}
10 DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
11 HOMEPAGE="http://gmplib.org/"
12 SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.bz2
13 doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
14
15 LICENSE="LGPL-3"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
18 IUSE="doc cxx static-libs"
19
20 DEPEND="sys-devel/m4"
21 RDEPEND=""
22
23 S=${WORKDIR}/${MY_P}
24
25 src_unpack() {
26 unpack ${MY_P}.tar.bz2
27 cd "${S}"
28 [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
29 epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
30 epatch "${FILESDIR}"/${PN}-5.0.0-s390.diff
31 epatch "${FILESDIR}"/${MY_P}-unnormalised-dividends.patch
32 has x32 $(get_all_abis) && epatch "${FILESDIR}"/${PN}-5.0.2*x32*.patch
33
34 # disable -fPIE -pie in the tests for x86 #236054
35 if use x86 && gcc-specs-pie ; then
36 epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
37 fi
38
39 # note: we cannot run autotools here as gcc depends on this package
40 elibtoolize
41
42 # GMP uses the "ABI" env var during configure as does Gentoo (econf).
43 # So, to avoid patching the source constantly, wrap things up.
44 mv configure configure.wrapped || die
45 cat <<-\EOF > configure
46 #!/bin/sh
47 exec env ABI="$GMPABI" "${0}.wrapped" "$@"
48 EOF
49 chmod a+rx configure
50 }
51
52 src_compile() {
53 # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
54 # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
55 if [[ ${CHOST} == hppa2.0-* ]] ; then
56 export GMPABI="1.0"
57 fi
58
59 # ABI mappings (needs all architectures supported)
60 case ${ABI} in
61 32|x86) GMPABI=32;;
62 64|amd64|n64) GMPABI=64;;
63 [onx]32) GMPABI=${ABI};;
64 esac
65 export GMPABI
66
67 tc-export CC
68 econf \
69 --localstatedir=/var/state/gmp \
70 --disable-mpbsd \
71 $(use_enable cxx) \
72 $(use_enable static-libs static) \
73 || die
74
75 emake || die
76 }
77
78 src_install() {
79 emake DESTDIR="${D}" install || die
80
81 # should be a standalone lib
82 rm -f "${D}"/usr/$(get_libdir)/libgmp.la
83 # this requires libgmp
84 local la="${D}/usr/$(get_libdir)/libgmpxx.la"
85 use static-libs \
86 && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
87 || rm -f "${la}"
88
89 dodoc AUTHORS ChangeLog NEWS README
90 dodoc doc/configuration doc/isa_abi_headache
91 dohtml -r doc
92
93 use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
94 }
95
96 pkg_preinst() {
97 preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
98 }
99
100 pkg_postinst() {
101 preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
102 }

  ViewVC Help
Powered by ViewVC 1.1.20