Lines 2-13
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.9.6.ebuild,v 1.1 2013/03/29 01:24:59 anarchy Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.9.6.ebuild,v 1.1 2013/03/29 01:24:59 anarchy Exp $ |
4 |
|
4 |
|
5 |
EAPI=3 |
5 |
EAPI=5 |
6 |
WANT_AUTOCONF="2.1" |
6 |
WANT_AUTOCONF="2.1" |
7 |
|
7 |
|
8 |
inherit autotools eutils multilib toolchain-funcs versionator |
8 |
inherit autotools eutils versionator multilib-minimal |
9 |
|
|
|
10 |
MIN_PV="$(get_version_component_range 2)" |
11 |
|
9 |
|
12 |
DESCRIPTION="Netscape Portable Runtime" |
10 |
DESCRIPTION="Netscape Portable Runtime" |
13 |
HOMEPAGE="http://www.mozilla.org/projects/nspr/" |
11 |
HOMEPAGE="http://www.mozilla.org/projects/nspr/" |
Lines 40-95
Link Here
|
40 |
# Respect LDFLAGS |
38 |
# Respect LDFLAGS |
41 |
sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \ |
39 |
sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \ |
42 |
"${S}"/mozilla/nsprpub/config/rules.mk || die |
40 |
"${S}"/mozilla/nsprpub/config/rules.mk || die |
|
|
41 |
|
42 |
# not all generated makefiles are put into ${S}/build |
43 |
# in-source build needs copying, we can't just set BUILD_DIR="${S}/build" |
44 |
multilib_copy_sources |
43 |
} |
45 |
} |
44 |
|
46 |
|
45 |
src_configure() { |
47 |
multilib_src_configure() { |
46 |
cd "${S}"/build |
48 |
cd build |
47 |
|
49 |
|
48 |
# We use the standard BUILD_xxx but nspr uses HOST_xxx |
50 |
# "real" cross-compiling, i.e. non-multilib needs testing - 2013-04-12 |
49 |
tc-export_build_env BUILD_CC |
51 |
if tc-is-cross-compiler; then |
50 |
export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS} |
52 |
tc-export AR CC CXX RANLIB |
51 |
tc-export AR CC CXX RANLIB |
53 |
|
52 |
[[ ${CBUILD} != ${CHOST} ]] \ |
54 |
# most probably not needed |
53 |
&& export CROSS_COMPILE=1 \ |
55 |
#export ac_cv_path_AR="${AR}" |
54 |
|| unset CROSS_COMPILE |
56 |
|
55 |
|
57 |
# build system swaps the meaning of BUILD and HOST |
56 |
local myconf |
58 |
tc-export_build_env BUILD_CC |
57 |
echo > "${T}"/test.c |
59 |
export HOST_CC=${BUILD_CC} \ |
58 |
${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die |
60 |
HOST_CFLAGS=${BUILD_CFLAGS} \ |
59 |
case $(file "${T}"/test.o) in |
61 |
HOST_LDFLAGS=${BUILD_LDFLAGS} \ |
60 |
*32-bit*x86-64*|*64-bit*|*ppc64*|*x86_64*) myconf+=" --enable-64bit";; |
62 |
CROSS_COMPILE=1 |
61 |
*32-bit*|*ppc*|*i386*) ;; |
63 |
fi |
62 |
*) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";; |
64 |
|
63 |
esac |
65 |
# econf sets --host=${CHOST}, eclasses might set --build=${CBUILD} |
|
|
66 |
# switch CHOST and CBUILD for a proper econf - do not export these |
67 |
local CHOST="${CBUILD:-${CHOST}}" |
68 |
local CTARGET="${CTARGET:-${CHOST}}" |
69 |
local CBUILD="${CTARGET}" |
64 |
|
70 |
|
65 |
# Ancient autoconf needs help finding the right tools. |
|
|
66 |
LC_ALL="C" ECONF_SOURCE="../mozilla/nsprpub" \ |
71 |
LC_ALL="C" ECONF_SOURCE="../mozilla/nsprpub" \ |
67 |
ac_cv_path_AR="${AR}" \ |
|
|
68 |
econf \ |
72 |
econf \ |
69 |
--libdir="${EPREFIX}/usr/$(get_libdir)" \ |
73 |
--libdir="${EPREFIX}/usr/$(get_libdir)" \ |
|
|
74 |
$(if has_multilib_profile; then test64=$(get_libdir) |
75 |
else test64=${CTARGET}; test64=${test64%%-*}; fi |
76 |
if [[ -z "${test64##*64}" ]]; then echo "--enable-64bit" ; fi |
77 |
) \ |
70 |
$(use_enable debug) \ |
78 |
$(use_enable debug) \ |
71 |
$(use_enable !debug optimize) \ |
79 |
$(use_enable !debug optimize) |
72 |
${myconf} |
|
|
73 |
} |
80 |
} |
74 |
|
81 |
|
75 |
src_compile() { |
82 |
multilib_src_compile() { |
76 |
cd "${S}"/build |
83 |
emake -C build || die "failed to build" |
77 |
emake || die "failed to build" |
|
|
78 |
} |
84 |
} |
79 |
|
85 |
|
80 |
src_install() { |
86 |
multilib_src_install() { |
81 |
# Their build system is royally confusing, as usual |
87 |
emake -C build DESTDIR="${D}" install || die "emake install failed" |
82 |
MINOR_VERSION=${MIN_PV} # Used for .so version |
|
|
83 |
cd "${S}"/build |
84 |
emake DESTDIR="${D}" install || die "emake install failed" |
85 |
|
86 |
cd "${ED}"/usr/$(get_libdir) |
87 |
einfo "removing static libraries as upstream has requested!" |
88 |
rm -f *.a || die "failed to remove static libraries." |
89 |
|
90 |
# install nspr-config |
91 |
dobin "${S}"/build/config/nspr-config || die "failed to install nspr-config" |
92 |
|
88 |
|
93 |
# Remove stupid files in /usr/bin |
89 |
# Remove stupid files in /usr/bin |
|
|
90 |
einfo "removing static libraries as upstream has requested!" |
91 |
rm -f "${ED}"/usr/$(get_libdir)/*.a || die "failed to remove static libraries." |
94 |
rm -f "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files" |
92 |
rm -f "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files" |
|
|
93 |
|
94 |
# Append version magic |
95 |
find "${ED}/usr/$(get_libdir)" -name "*.so" -exec mv {}{,.${PV}} \; \ |
96 |
|| die "appending version magic failed" |
97 |
|
98 |
# Install nspr-config |
99 |
is_final_abi && { |
100 |
dobin build/config/nspr-config || die "failed to install nspr-config" |
101 |
} |
95 |
} |
102 |
} |