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.10.2.ebuild,v 1.7 2013/12/07 19:52:23 ago Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.10.2.ebuild,v 1.7 2013/12/07 19:52:23 ago 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 multilib flag-o-matic 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 18-23
Link Here
|
18 |
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" |
16 |
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" |
19 |
IUSE="debug" |
17 |
IUSE="debug" |
20 |
|
18 |
|
|
|
19 |
RDEPEND="abi_x86_32? ( |
20 |
!<=app-emulation/emul-linux-x86-baselibs-20131008-r6 |
21 |
!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] |
22 |
)" |
23 |
DEPEND="${RDEPEND}" |
24 |
|
21 |
src_prepare() { |
25 |
src_prepare() { |
22 |
mkdir build inst |
26 |
mkdir build inst |
23 |
cd "${S}"/nspr/ |
27 |
cd "${S}"/nspr/ |
Lines 40-95
Link Here
|
40 |
# Respect LDFLAGS |
44 |
# Respect LDFLAGS |
41 |
sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \ |
45 |
sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \ |
42 |
"${S}"/nspr/config/rules.mk || die |
46 |
"${S}"/nspr/config/rules.mk || die |
|
|
47 |
|
48 |
# not all generated makefiles are put into ${S}/build |
49 |
# in-source build needs copying, we can't just set BUILD_DIR="${S}/build" |
50 |
multilib_copy_sources |
43 |
} |
51 |
} |
44 |
|
52 |
|
45 |
src_configure() { |
53 |
multilib_src_configure() { |
46 |
cd "${S}"/build |
54 |
cd build |
47 |
|
55 |
|
48 |
# We use the standard BUILD_xxx but nspr uses HOST_xxx |
56 |
# respect optimization flags |
49 |
tc-export_build_env BUILD_CC |
57 |
local OPT=$(get-flag -O?) |
50 |
export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS} |
58 |
filter-flags -O? |
|
|
59 |
|
51 |
tc-export AR CC CXX RANLIB |
60 |
tc-export AR CC CXX RANLIB |
52 |
[[ ${CBUILD} != ${CHOST} ]] \ |
61 |
|
53 |
&& export CROSS_COMPILE=1 \ |
62 |
# "real" cross-compiling, i.e. non-multilib needs testing - 2013-04-12 |
54 |
|| unset CROSS_COMPILE |
63 |
if tc-is-cross-compiler; then |
55 |
|
64 |
tc-export_build_env BUILD_CC |
56 |
local myconf |
65 |
# build system swaps the meaning of BUILD and HOST |
57 |
echo > "${T}"/test.c |
66 |
export HOST_CC=${BUILD_CC} \ |
58 |
${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die |
67 |
HOST_CFLAGS=${BUILD_CFLAGS} \ |
59 |
case $(file "${T}"/test.o) in |
68 |
HOST_LDFLAGS=${BUILD_LDFLAGS} \ |
60 |
*32-bit*x86-64*|*64-bit*|*ppc64*|*x86_64*) myconf+=" --enable-64bit";; |
69 |
CROSS_COMPILE=1 |
61 |
*32-bit*|*ppc*|*i386*) ;; |
70 |
fi |
62 |
*) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";; |
71 |
|
63 |
esac |
72 |
# econf sets --host=${CHOST}, eclasses might set --build=${CBUILD} |
|
|
73 |
# switch CHOST and CBUILD for a proper econf - do not export these |
74 |
local CHOST="${CBUILD:-${CHOST}}" |
75 |
local CTARGET="${CTARGET:-${CHOST}}" |
76 |
local CBUILD="${CTARGET}" |
64 |
|
77 |
|
65 |
# Ancient autoconf needs help finding the right tools. |
78 |
# Ancient autoconf needs help finding the right tools. |
66 |
LC_ALL="C" ECONF_SOURCE="../nspr" \ |
79 |
LC_ALL="C" ECONF_SOURCE="../nspr" \ |
67 |
ac_cv_path_AR="${AR}" \ |
80 |
ac_cv_path_AR="${AR}" \ |
68 |
econf \ |
81 |
econf \ |
69 |
--libdir="${EPREFIX}/usr/$(get_libdir)" \ |
82 |
--libdir="${EPREFIX}/usr/$(get_libdir)" \ |
|
|
83 |
$(if has_multilib_profile; then test64=$(get_libdir) |
84 |
else test64=${CTARGET}; test64=${test64%%-*}; fi |
85 |
if [[ -z "${test64##*64}" ]]; then echo "--enable-64bit" ; fi |
86 |
) \ |
70 |
$(use_enable debug) \ |
87 |
$(use_enable debug) \ |
71 |
$(use_enable !debug optimize) \ |
88 |
$(use_enable !debug optimize ${OPT}) |
72 |
${myconf} |
|
|
73 |
} |
89 |
} |
74 |
|
90 |
|
75 |
src_compile() { |
91 |
multilib_src_compile() { |
76 |
cd "${S}"/build |
92 |
emake -C build |
77 |
emake || die "failed to build" |
|
|
78 |
} |
93 |
} |
79 |
|
94 |
|
80 |
src_install() { |
95 |
multilib_src_install() { |
81 |
# Their build system is royally confusing, as usual |
96 |
emake -C build DESTDIR="${D}" install |
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 |
|
97 |
|
93 |
# Remove stupid files in /usr/bin |
98 |
# Remove stupid files in /usr/bin |
|
|
99 |
einfo "removing static libraries as upstream has requested!" |
100 |
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" |
101 |
rm -f "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files" |
|
|
102 |
|
103 |
#Append version magic |
104 |
find "${ED}/usr/$(get_libdir)" -name "*.so" -exec mv {}{,.${PV}} \; \ |
105 |
|| die "appending version magic failed" |
106 |
|
107 |
# create symlinks |
108 |
local i |
109 |
for i in $(find "${ED}/usr/$(get_libdir)" -name "*.so*" | sed "s:.${PV}::g"); do |
110 |
dosym "${i##*/}.${PV}" "/usr/$(get_libdir)/${i##*/}" |
111 |
done |
112 |
|
113 |
# Install nspr-config |
114 |
is_final_abi && { |
115 |
dobin build/config/nspr-config |
116 |
} |
95 |
} |
117 |
} |