2012-03-25 16:54:11 +04:00
|
|
|
# Copyright 1999-2012 Gentoo Foundation
|
2011-11-09 11:33:19 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2012-09-27 10:27:31 +04:00
|
|
|
# $Header: /var/cvsroot/gentoo-x86/sci-libs/netcdf/netcdf-4.1.3.ebuild,v 1.5 2012/09/27 04:53:04 mattst88 Exp $
|
2011-11-09 11:33:19 +04:00
|
|
|
|
|
|
|
EAPI=4
|
|
|
|
|
2012-03-25 16:54:11 +04:00
|
|
|
AUTOTOOLS_AUTORECONF=true
|
|
|
|
|
|
|
|
inherit autotools-utils fortran-2
|
2011-11-09 11:33:19 +04:00
|
|
|
|
|
|
|
DESCRIPTION="Scientific library and interface for array oriented data access"
|
|
|
|
HOMEPAGE="http://www.unidata.ucar.edu/software/netcdf/"
|
|
|
|
SRC_URI="ftp://ftp.unidata.ucar.edu/pub/netcdf/${P}.tar.gz"
|
|
|
|
|
|
|
|
LICENSE="UCAR-Unidata"
|
|
|
|
SLOT="0"
|
2012-09-27 10:27:31 +04:00
|
|
|
KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris"
|
2011-11-09 11:33:19 +04:00
|
|
|
IUSE="cxx dap doc fortran hdf5 static-libs"
|
|
|
|
|
2012-03-25 16:54:11 +04:00
|
|
|
RDEPEND="
|
|
|
|
fortran? ( virtual/fortran )
|
2011-11-09 11:33:19 +04:00
|
|
|
dap? ( net-misc/curl )
|
|
|
|
hdf5? ( >=sci-libs/hdf5-1.8.6[zlib,szip,fortran?] )"
|
|
|
|
|
|
|
|
DEPEND="${RDEPEND}
|
2012-03-30 12:07:08 +04:00
|
|
|
>=sys-devel/libtool-2.4
|
2011-11-09 11:33:19 +04:00
|
|
|
doc? ( virtual/latex-base )
|
|
|
|
fortran? ( dev-lang/cfortran )"
|
|
|
|
|
|
|
|
DOCS=(README RELEASE_NOTES)
|
|
|
|
|
|
|
|
PATCHES=(
|
|
|
|
"${FILESDIR}"/${PN}-4.1.1-parallel-build.patch
|
|
|
|
"${FILESDIR}"/${PN}-4.1.1-fortran.patch
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_setup() {
|
|
|
|
if use fortran; then
|
|
|
|
FORTRAN_STANDARD="77 90"
|
|
|
|
fortran-2_pkg_setup
|
|
|
|
fi
|
|
|
|
if use hdf5 && has_version sci-libs/hdf5[mpi]; then
|
|
|
|
export CC=mpicc
|
|
|
|
use cxx && export CXX=mpicxx
|
|
|
|
use fortran && export FC=mpif90 F77=mpif77
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
# use system cfortran
|
2012-03-30 12:07:08 +04:00
|
|
|
rm -f "${S}"/fortran/cfortran.h || die
|
2011-11-09 11:33:19 +04:00
|
|
|
# check for szip is libsz, not libszip
|
2012-03-30 12:07:08 +04:00
|
|
|
# we don't build udunits and libcf we take them from system
|
|
|
|
sed -i \
|
|
|
|
-e 's/\[szip\]/\[sz\]/' \
|
|
|
|
-e '/udunits libcf/d' \
|
|
|
|
"${S}"/configure.ac || die
|
2011-11-09 11:33:19 +04:00
|
|
|
if ! use doc; then
|
2012-03-30 12:07:08 +04:00
|
|
|
sed -i -e '/$(NC_TEST4) /s/man4//' "${S}"/Makefile.am || die
|
2011-11-09 11:33:19 +04:00
|
|
|
fi
|
|
|
|
autotools-utils_src_prepare
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
myeconfargs=(
|
|
|
|
--docdir="${EPREFIX}"/usr/share/doc/${PF}
|
|
|
|
$(use_enable dap)
|
|
|
|
$(use_enable fortran f77)
|
|
|
|
$(use_enable fortran f90)
|
|
|
|
$(use_enable cxx)
|
|
|
|
$(use_enable hdf5 netcdf-4)
|
|
|
|
)
|
|
|
|
autotools-utils_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
# hack to allow parallel build
|
|
|
|
if use doc; then
|
|
|
|
autotools-utils_src_compile pdf
|
|
|
|
autotools-utils_src_compile -j1 -C man4
|
|
|
|
fi
|
|
|
|
autotools-utils_src_compile
|
|
|
|
}
|