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

Collapse All | Expand All

(-)/usr/portage/dev-libs/ntl/ntl-6.1.0.ebuild (-27 / +20 lines)
Lines 22-75 Link Here
22
S="${WORKDIR}/${P}/src"
22
S="${WORKDIR}/${P}/src"
23
23
24
src_prepare() {
24
src_prepare() {
25
	# fix parallel make
25
	# Add controls to build static library or not. Sanitize the use of make
26
	sed -i -e "s/make/make ${MAKEOPTS}/g" WizardAux || die
26
	# and split the install target for the documentation.
27
	epatch "${FILESDIR}"/${PN}-6.2.1-static_and_sanity.patch
28
	# multilib fix
29
	sed -i -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):g" DoConfig
27
	cd ..
30
	cd ..
28
	# enable compatibility with singular
31
	# enable compatibility with singular
29
	epatch "$FILESDIR/${PN}-6.0.0-singular.patch"
32
	epatch "${FILESDIR}"/${PN}-6.0.0-singular.patch
30
	# implement a call back framework (submitted upstream)
33
	# implement a call back framework (submitted upstream)
31
	epatch "$FILESDIR/${PN}-6.0.0-sage-tools.patch"
34
	epatch "${FILESDIR}"/${PN}-6.0.0-sage-tools.patch
32
	# sanitize the makefile and allow the building of shared library
33
	epatch "$FILESDIR/${PN}-5.5.2-shared-r1.patch"
34
	replace-flags -O[3-9] -O2
35
	replace-flags -O[3-9] -O2
35
}
36
}
36
37
37
src_configure() {
38
src_configure() {
39
	# control the building of the static library
40
	local BUILDSTATIC="off"
41
	use static-libs && BUILDSTATIC="on"
42
38
	perl DoConfig \
43
	perl DoConfig \
39
		PREFIX="${EPREFIX}"/usr \
44
		PREFIX="${EPREFIX}"/usr \
40
		CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" \
45
		CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" \
41
		CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
46
		CXX="$(tc-getCXX)" SHARED=on \
42
		AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
47
		AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
43
		NTL_STD_CXX=on NTL_GMP_LIP=on NTL_GF2X_LIB=on \
48
		NTL_STD_CXX=on NTL_GMP_LIP=on NTL_GF2X_LIB=on \
49
		STATIC="${BUILDSTATIC}" \
44
		|| die "DoConfig failed"
50
		|| die "DoConfig failed"
45
}
51
}
46
52
47
src_compile() {
53
src_compile() {
54
	tc-export CC
48
	# split the targets to allow parallel make to run properly
55
	# split the targets to allow parallel make to run properly
49
	emake setup1 setup2 || die "emake setup failed"
56
	emake setup1 setup2 || die "emake setup failed"
50
	emake setup3 || die "emake setup failed"
57
	emake setup3 || die "emake setup failed"
51
	sh Wizard on || die "Tuning wizard failed"
58
	sh Wizard on || die "Tuning wizard failed"
52
	if use static-libs || use test; then
59
	# this target now can build both shared and static libraries
53
		emake ntl.a  || die "emake static failed"
60
	emake ntl.a  || die "emake failed to build the libraries"
54
	fi
55
	local trg=so
56
	[[ ${CHOST} == *-darwin* ]] && trg=dylib
57
	emake shared${trg} || die "emake shared failed"
58
}
61
}
59
62
60
src_install() {
63
src_install() {
61
	if use static-libs; then
64
	emake PREFIX="${ED}usr" install
62
		newlib.a ntl.a libntl.a || die "installation of static library failed"
65
	if use doc; then
63
	fi
66
		emake PREFIX="${ED}usr" install-doc
64
	dolib.so lib*$(get_libname) || die "installation of shared library failed"
65
66
	cd ..
67
	insinto /usr/include
68
	doins -r include/NTL || die "installation of the headers failed"
69
70
	dodoc README
71
	if use doc ; then
72
		dodoc doc/*.txt || die
73
		dohtml doc/* || die
74
	fi
67
	fi
75
}
68
}

Return to bug 522918