Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 465964 | Differences between
and this patch

Collapse All | Expand All

(-)nspr-4.9.6.ebuild (-41 / +52 lines)
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 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 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
	# respect optimization flags
49
	tc-export_build_env BUILD_CC
51
	local OPT=$(get-flag -O?)
50
	export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS}
52
	filter-flags -O?
51
	tc-export AR CC CXX RANLIB
53
52
	[[ ${CBUILD} != ${CHOST} ]] \
54
	# "real" cross-compiling, i.e. non-multilib needs testing - 2013-04-12
53
		&& export CROSS_COMPILE=1 \
55
	if tc-is-cross-compiler; then
54
		|| unset CROSS_COMPILE
56
		tc-export AR CC CXX RANLIB
55
57
56
	local myconf
58
		# most probably not needed
57
	echo > "${T}"/test.c
59
		#export ac_cv_path_AR="${AR}"
58
	${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die
60
59
	case $(file "${T}"/test.o) in
61
		# build system swaps the meaning of BUILD and HOST
60
		*32-bit*x86-64*|*64-bit*|*ppc64*|*x86_64*) myconf+=" --enable-64bit";;
62
		tc-export_build_env BUILD_CC
61
		*32-bit*|*ppc*|*i386*) ;;
63
		export	HOST_CC=${BUILD_CC} \
62
		*) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
64
				HOST_CFLAGS=${BUILD_CFLAGS} \
63
	esac
65
				HOST_LDFLAGS=${BUILD_LDFLAGS} \
66
				CROSS_COMPILE=1
67
	fi
68
69
	# econf sets --host=${CHOST}, eclasses might set --build=${CBUILD}
70
	# switch CHOST and CBUILD for a proper econf - do not export these
71
	local CHOST="${CBUILD:-${CHOST}}"
72
	local CTARGET="${CTARGET:-${CHOST}}"
73
	local CBUILD="${CTARGET}"
64
74
65
	# Ancient autoconf needs help finding the right tools.
66
	LC_ALL="C" ECONF_SOURCE="../mozilla/nsprpub" \
75
	LC_ALL="C" ECONF_SOURCE="../mozilla/nsprpub" \
67
	ac_cv_path_AR="${AR}" \
68
	econf \
76
	econf \
69
		--libdir="${EPREFIX}/usr/$(get_libdir)" \
77
		--libdir="${EPREFIX}/usr/$(get_libdir)" \
78
		$(if has_multilib_profile; then test64=$(get_libdir)
79
		  else test64=${CTARGET}; test64=${test64%%-*}; fi
80
		  if [[ -z "${test64##*64}" ]]; then echo "--enable-64bit" ; fi
81
		) \
70
		$(use_enable debug) \
82
		$(use_enable debug) \
71
		$(use_enable !debug optimize) \
83
		$(use_enable !debug optimize ${OPT})
72
		${myconf}
73
}
84
}
74
85
75
src_compile() {
86
multilib_src_compile() {
76
	cd "${S}"/build
87
	emake -C build || die "failed to build"
77
	emake || die "failed to build"
78
}
88
}
79
89
80
src_install() {
90
multilib_src_install() {
81
	# Their build system is royally confusing, as usual
91
	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
92
93
	# Remove stupid files in /usr/bin
93
	# Remove stupid files in /usr/bin
94
	einfo "removing static libraries as upstream has requested!"
95
	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"
96
	rm -f "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files"
97
98
	# Append version magic
99
	find "${ED}/usr/$(get_libdir)" -name "*.so" -exec mv {}{,.${PV}} \; \
100
		|| die "appending version magic failed"
101
102
	# Install nspr-config
103
	is_final_abi && { 
104
		dobin build/config/nspr-config || die "failed to install nspr-config"
105
	}
95
}
106
}

Return to bug 465964