dev-qt/qtpositioning: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-libs / cmpfit / cmpfit-1.2-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit toolchain-funcs
7
8 DESCRIPTION="MINPACK-1 Least Squares Fitting Library in C"
9 HOMEPAGE="http://www.physics.wisc.edu/~craigm/idl/cmpfit.html"
10 SRC_URI="http://www.physics.wisc.edu/~craigm/idl/down/${P}.tar.gz"
11
12 LICENSE="public-domain minpack"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
15 IUSE="static-libs"
16
17 DOCS=( README DISCLAIMER )
18
19 src_compile() {
20         if use static-libs; then
21                 $(tc-getCC) ${CFLAGS} -c mpfit.c || die "non-PIC compilation failed"
22                 $(tc-getAR) cr libmpfit.a mpfit.o || die "creation of static archive failed"
23         fi
24         $(tc-getCC) ${CFLAGS} -fPIC -c mpfit.c -o mpfit.so || die "PIC compilation failed"
25         $(tc-getCC) ${LDFLAGS} -shared -Wl,-soname=libmpfit.so mpfit.so -lm -o libmpfit.so || die "linking failed"
26 }
27
28 src_test() {
29         $(tc-getCC) ${CFLAGS} testmpfit.c -L. -lmpfit -lm -o testmpfit || die
30         LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH} ./testmpfit || die
31 }
32
33 src_install() {
34         dolib.so libmpfit.so
35         use static-libs && dolib.a libmpfit.a
36         doheader mpfit.h
37         einstalldocs
38 }