/[gentoo-x86]/sci-libs/dsdp/dsdp-5.8-r2.ebuild
Gentoo

Contents of /sci-libs/dsdp/dsdp-5.8-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Jul 11 02:31:52 2012 UTC (2 years, 3 months ago) by mr_bones_
Branch: MAIN
Changes since 1.3: +1 -2 lines
whitespace

(Portage version: 2.1.10.65/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/dsdp/dsdp-5.8-r2.ebuild,v 1.3 2012/07/09 17:51:33 bicatali Exp $
4
5 EAPI=4
6
7 inherit eutils toolchain-funcs versionator
8
9 MYP=DSDP${PV}
10
11 DESCRIPTION="Software for interior-point for semidefinite programming"
12 HOMEPAGE="http://www.mcs.anl.gov/hs/software/DSDP/"
13 SRC_URI="http://www.mcs.anl.gov/hs/software/DSDP//${MYP}.tar.gz"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86 ~amd64-linux ~ppc-macos ~x86-linux ~x86-macos ~x64-macos"
18 IUSE="doc examples"
19
20 RDEPEND="virtual/lapack"
21 DEPEND="${RDEPEND}
22 virtual/pkgconfig"
23
24 S="${WORKDIR}/${MYP}"
25
26 make_shared_lib() {
27 local soname=$(basename "${1%.a}")$(get_libname $(get_major_version))
28 einfo "Making ${soname}"
29 ${2:-$(tc-getCC)} ${LDFLAGS} \
30 -shared -Wl,-soname="${soname}" \
31 $([[ ${CHOST} == *-darwin* ]] && echo "-Wl,-install_name -Wl,${EPREFIX}/usr/$(get_libdir)/${soname}") \
32 -Wl,--whole-archive "${1}" -Wl,--no-whole-archive \
33 -o $(dirname "${1}")/"${soname}" \
34 -lm $(pkg-config --libs blas lapack) || return 1
35
36 }
37
38 src_prepare() {
39 epatch \
40 "${FILESDIR}"/${P}-readsdpa.patch \
41 "${FILESDIR}"/${P}-malloc.patch \
42 "${FILESDIR}"/${P}-gold.patch
43 # to do proper parallel compilation
44 find . -name Makefile -exec \
45 sed -i -e 's:make :$(MAKE) :g' '{}' \;
46 sed -i \
47 -e "s|#\(DSDPROOT[[:space:]]*=\).*|\1${S}|" \
48 -e "s|\(CC[[:space:]]*=\).*|\1$(tc-getCC)|" \
49 -e "s|\(OPTFLAGS[[:space:]]*=\).*|\1${CFLAGS}|" \
50 -e "s|\(CLINKER[[:space:]]*=\).*|\1 \${CC} ${LDFLAGS}|" \
51 -e "s|\(LAPACKBLAS[[:space:]]*=\).*|\1 $(pkg-config --libs blas lapack)|" \
52 -e "s|\(^ARCH[[:space:]]*=\).*|\1$(tc-getAR) cr|" \
53 -e "s|\(^RANLIB[[:space:]]*=\).*|\1$(tc-getRANLIB)|" \
54 make.include || die
55 }
56
57 src_compile() {
58 emake OPTFLAGS="${CFLAGS} -fPIC" dsdplibrary
59 make_shared_lib lib/lib${PN}.a || die "doing shared lib failed"
60 }
61
62 src_test() {
63 emake -j1 example test
64 }
65
66 src_install() {
67 dolib.so lib/lib${PN}$(get_libname $(get_major_version))
68 dosym lib${PN}$(get_libname $(get_major_version)) \
69 /usr/$(get_libdir)/lib${PN}$(get_libname)
70
71 insinto /usr/include
72 doins include/*.h src/sdp/*.h
73
74 use doc && dodoc docs/*.pdf
75
76 if use examples; then
77 insinto /usr/share/doc/${PF}
78 doins -r examples
79 fi
80 }

  ViewVC Help
Powered by ViewVC 1.1.20