summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2016-09-09 16:32:57 -0600
committerChristoph Junghans <ottxor@gentoo.org>2016-09-09 16:34:30 -0600
commit87f7cceb58a933f16ee3715d8f3eb0ce470e0376 (patch)
tree10aba4c4f512aa9dd65484e295f342c82c851824 /sys-cluster/gasnet
parentprofiles/package.mask: roll chromium mask for M55 (diff)
downloadgentoo-87f7cceb58a933f16ee3715d8f3eb0ce470e0376.tar.gz
gentoo-87f7cceb58a933f16ee3715d8f3eb0ce470e0376.tar.bz2
gentoo-87f7cceb58a933f16ee3715d8f3eb0ce470e0376.zip
sys-cluster/gasnet: build shared libs
Package-Manager: portage-2.2.28
Diffstat (limited to 'sys-cluster/gasnet')
-rw-r--r--sys-cluster/gasnet/gasnet-1.26.4-r1.ebuild73
1 files changed, 73 insertions, 0 deletions
diff --git a/sys-cluster/gasnet/gasnet-1.26.4-r1.ebuild b/sys-cluster/gasnet/gasnet-1.26.4-r1.ebuild
new file mode 100644
index 000000000000..140e3461c1f8
--- /dev/null
+++ b/sys-cluster/gasnet/gasnet-1.26.4-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools toolchain-funcs multilib
+
+MY_P="${PN^^[gasn]}-${PV}"
+DESCRIPTION="Networking middleware for partitioned global address space (PGAS) language"
+HOMEPAGE="http://gasnet.lbl.gov/"
+SRC_URI="http://gasnet.lbl.gov/${MY_P}.tar.gz"
+
+SOVER="${PV%%.*}"
+LICENSE="BSD"
+SLOT="0/${SOVER}"
+KEYWORDS="~amd64"
+IUSE="mpi static-libs threads"
+
+DEPEND="mpi? ( virtual/mpi )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+static_to_shared() {
+ local libstatic="${1}"; shift
+ local libname="${libstatic%.a}"
+ libname="${libname##*/}"
+ local soname="${libname}$(get_libname ${SOVER})"
+ local libdir="${libstatic%/*}"
+
+ einfo "Making ${soname} from ${libstatic}"
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
+ -Wl,-all_load -Wl,${libstatic} \
+ "$@" -o ${libdir}/${soname} || die "${soname} failed"
+ else
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -shared -Wl,-soname=${soname} \
+ -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
+ "$@" -o ${libdir}/${soname} || die "${soname} failed"
+ ln -s ${soname} ${libdir}/${libname}$(get_libname)
+ fi
+}
+
+src_prepare() {
+ find . \
+ \( -name Makefile.am -or -name "*.mak" \) \
+ -exec sed -i '/^docdir/s/^/#/' {} + || die
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable mpi) \
+ $(use_enable threads pthreads) \
+ CC="$(tc-getCC) ${CFLAGS} -fPIC" \
+ MPI_CC="mpicc ${CFLAGS} -fPIC" \
+ CXX="$(tc-getCXX) ${CFLAGS} -fPIC"
+}
+
+src_install() {
+ local l libs
+ default
+ for l in "${ED}/usr/$(get_libdir)"/*.a; do
+ libs=
+ [[ $l = *mpi* ]] && libs+=" -lmpi"
+ static_to_shared "${l}" ${libs}
+ done
+ use static-libs || rm -f "${ED}/usr/$(get_libdir)"/*.a || die
+}