# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.9.6.ebuild,v 1.1 2013/03/29 01:24:59 anarchy Exp $ EAPI=5 WANT_AUTOCONF="2.1" inherit autotools eutils flag-o-matic versionator multilib-minimal DESCRIPTION="Netscape Portable Runtime" HOMEPAGE="http://www.mozilla.org/projects/nspr/" SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/${P}.tar.gz" LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" IUSE="debug" src_prepare() { mkdir build inst epatch "${FILESDIR}"/${PN}-4.6.1-lang.patch epatch "${FILESDIR}"/${PN}-4.7.0-prtime.patch epatch "${FILESDIR}"/${PN}-4.7.1-solaris.patch epatch "${FILESDIR}"/${PN}-4.7.4-solaris.patch epatch "${FILESDIR}"/${PN}-4.8.3-aix-gcc.patch epatch "${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch epatch "${FILESDIR}"/${PN}-4.8.9-link-flags.patch # We do not need to pass -L$libdir via nspr-config --libs epatch "${FILESDIR}"/${PN}-4.9.5_nspr_config.patch # We must run eautoconf to regenerate configure cd "${S}"/mozilla/nsprpub eautoconf # make sure it won't find Perl out of Prefix sed -i -e "s/perl5//g" "${S}"/mozilla/nsprpub/configure || die # Respect LDFLAGS sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \ "${S}"/mozilla/nsprpub/config/rules.mk || die # not all generated makefiles are put into ${S}/build # in-source build needs copying, we can't just set BUILD_DIR="${S}/build" multilib_copy_sources } multilib_src_configure() { cd build # respect optimization flags local OPT=$(get-flag -O?) filter-flags -O? # "real" cross-compiling, i.e. non-multilib needs testing - 2013-04-12 if tc-is-cross-compiler; then tc-export AR CC CXX RANLIB # most probably not needed #export ac_cv_path_AR="${AR}" # build system swaps the meaning of BUILD and HOST tc-export_build_env BUILD_CC export HOST_CC=${BUILD_CC} \ HOST_CFLAGS=${BUILD_CFLAGS} \ HOST_LDFLAGS=${BUILD_LDFLAGS} \ CROSS_COMPILE=1 fi # econf sets --host=${CHOST}, eclasses might set --build=${CBUILD} # switch CHOST and CBUILD for a proper econf - do not export these local CHOST="${CBUILD:-${CHOST}}" local CTARGET="${CTARGET:-${CHOST}}" local CBUILD="${CTARGET}" LC_ALL="C" ECONF_SOURCE="../mozilla/nsprpub" \ econf \ --libdir="${EPREFIX}/usr/$(get_libdir)" \ $(if has_multilib_profile; then test64=$(get_libdir) else test64=${CTARGET}; test64=${test64%%-*}; fi if [[ -z "${test64##*64}" ]]; then echo "--enable-64bit" ; fi ) \ $(use_enable debug) \ $(use_enable !debug optimize ${OPT}) } multilib_src_compile() { emake -C build || die "failed to build" } multilib_src_install() { emake -C build DESTDIR="${D}" install || die "emake install failed" # Remove stupid files in /usr/bin einfo "removing static libraries as upstream has requested!" rm -f "${ED}"/usr/$(get_libdir)/*.a || die "failed to remove static libraries." rm -f "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files" # Append version magic find "${ED}/usr/$(get_libdir)" -name "*.so" -exec mv {}{,.${PV}} \; \ || die "appending version magic failed" # Install nspr-config is_final_abi && { dobin build/config/nspr-config || die "failed to install nspr-config" } }