/[gentoo-x86]/dev-libs/nspr/nspr-4.9.1-r2.ebuild
Gentoo

Contents of /dev-libs/nspr/nspr-4.9.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Jun 24 03:56:49 2012 UTC (2 years, 5 months ago) by anarchy
Branch: MAIN
Fix undefined references on x32

(Portage version: 2.1.11.1/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/nspr/nspr-4.9.1-r1.ebuild,v 1.1 2012/06/22 02:57:33 anarchy Exp $
4
5 EAPI=3
6 WANT_AUTOCONF="2.1"
7
8 inherit autotools eutils multilib toolchain-funcs versionator
9
10 MIN_PV="$(get_version_component_range 2)"
11
12 DESCRIPTION="Netscape Portable Runtime"
13 HOMEPAGE="http://www.mozilla.org/projects/nspr/"
14 SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/${P}.tar.gz"
15
16 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
17 SLOT="0"
18 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
19 IUSE="debug"
20
21 src_prepare() {
22 mkdir build inst
23 epatch "${FILESDIR}"/${PN}-4.8-config.patch
24 epatch "${FILESDIR}"/${PN}-4.6.1-config-1.patch
25 epatch "${FILESDIR}"/${PN}-4.6.1-lang.patch
26 epatch "${FILESDIR}"/${PN}-4.7.0-prtime.patch
27 epatch "${FILESDIR}"/${PN}-4.7.1-solaris.patch
28 epatch "${FILESDIR}"/${PN}-4.7.4-solaris.patch
29 epatch "${FILESDIR}"/${PN}-4.8.3-aix-gcc.patch
30 # Patch needs updating
31 #epatch "${FILESDIR}"/${PN}-4.8.3-aix-soname.patch
32 epatch "${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch
33 epatch "${FILESDIR}"/${PN}-4.8.9-link-flags.patch
34 epatch "${FILESDIR}"/${PN}-4.9.1-x32_v0.1.patch
35
36 # We must run eautoconf to regenerate configure
37 cd "${S}"/mozilla/nsprpub
38 eautoconf
39
40 # make sure it won't find Perl out of Prefix
41 sed -i -e "s/perl5//g" "${S}"/mozilla/nsprpub/configure || die
42
43 # Respect LDFLAGS
44 sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
45 "${S}"/mozilla/nsprpub/config/rules.mk || die
46 }
47
48 src_configure() {
49 cd "${S}"/build
50
51 echo > "${T}"/test.c
52 $(tc-getCC) -c "${T}"/test.c -o "${T}"/test.o
53 case $(scanelf -BF'%M' "${T}"/test.o)$(scanmacho -BF'%M' "${T}"/test.o) in
54 ELFCLASS64*|POWERPC64*|X86_64*) myconf="${myconf} --enable-64bit";;
55 ELFCLASS32*|POWERPC*|I386*|ARM*) ;;
56 *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
57 esac
58
59 myconf="${myconf} --libdir=${EPREFIX}/usr/$(get_libdir)"
60
61 LC_ALL="C" ECONF_SOURCE="../mozilla/nsprpub" econf \
62 $(use_enable debug) \
63 $(use_enable !debug optimize) \
64 ${myconf} || die "econf failed"
65 }
66
67 src_compile() {
68 cd "${S}"/build
69 if tc-is-cross-compiler; then
70 emake CC="$(tc-getBUILD_CC)" CXX="$(tc-getBUILD_CXX)" \
71 -C config nsinstall || die "failed to build"
72 mv config/{,native-}nsinstall
73 sed -s 's#/nsinstall$#/native-nsinstall#' -i config/autoconf.mk
74 rm config/nsinstall.o
75 fi
76 emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" || die "failed to build"
77 }
78
79 src_install () {
80 # Their build system is royally confusing, as usual
81 MINOR_VERSION=${MIN_PV} # Used for .so version
82 cd "${S}"/build
83 emake DESTDIR="${D}" install || die "emake install failed"
84
85 cd "${ED}"/usr/$(get_libdir)
86 for file in *.a; do
87 einfo "removing static libraries as upstream has requested!"
88 rm -f ${file} || die "failed to remove static libraries."
89 done
90
91 local n=
92 # aix-soname.patch does this already
93 [[ ${CHOST} == *-aix* ]] ||
94 for file in *$(get_libname); do
95 n=${file%$(get_libname)}$(get_libname ${MINOR_VERSION})
96 mv ${file} ${n} || die "failed to mv files around"
97 ln -s ${n} ${file} || die "failed to symlink files."
98 if [[ ${CHOST} == *-darwin* ]]; then
99 install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${n}" ${n} || die
100 fi
101 done
102
103 # install nspr-config
104 dobin "${S}"/build/config/nspr-config || die "failed to install nspr-config"
105
106 # Remove stupid files in /usr/bin
107 rm -f "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files"
108 }

  ViewVC Help
Powered by ViewVC 1.1.20