summaryrefslogtreecommitdiff
blob: ef6d2b6390c18cdf40c31440caa33affe53e6ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

PYTHON_COMPAT=( python2_7 )

AUTOTOOLS_AUTORECONF=true

FORTRAN_STANDARD="95"
FORTRAN_NEEDED=fortran

inherit autotools-utils fortran-2 python-single-r1

DESCRIPTION="Reference implementation of the Dirfile, format for time-ordered binary data"
HOMEPAGE="http://getdata.sourceforge.net/"
SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.bz2"

SLOT="0"
LICENSE="LGPL-2.1"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 debug fortran lzma python perl static-libs"

REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="${PYTHON_DEPS}
	bzip2? ( app-arch/bzip2 )
	lzma? ( app-arch/xz-utils )
	perl? ( dev-lang/perl )"
RDEPEND="${DEPEND}"

PATCHES=(
	"${FILESDIR}"/${P}-serial-test.patch
	"${FILESDIR}"/${P}-out-of-source.patch
	)

src_configure() {
	local myeconfargs=()
	use perl && myeconfargs+=( --with-perl-dir=vendor )
	myeconfargs+=(
		--disable-idl
		--without-libslim
		--with-libz
		--docdir="${EPREFIX}/usr/share/doc/${P}"
		$(use_enable debug)
		$(use_enable fortran)
		$(use_enable fortran fortran95)
		$(use_enable python)
		$(use_enable perl)
		$(use_with bzip2 libbz2)
		$(use_with lzma liblzma)
	)
	autotools-utils_src_configure
}

src_compile() {
	autotools-utils_src_compile

	if use python; then
		python_copy_sources
		building() {
			cd "${BUILD_DIR}"/bindings/python || die
			sed "s:-lpython...:$(python_get_LIBS):g" -i Makefile || die
			emake \
				PYTHON_VERSION="${EPYTHON#python}" \
				NUMPY_CPPFLAGS="-I${EPREFIX}$(python_get_sitedir)/numpy/core/include" \
				PYTHON_CPPFLAGS="-I${EPREFIX}$(python_get_includedir)" \
				pyexecdir="${EPREFIX}$(python_get_sitedir)" \
				pythondir="${EPREFIX}$(python_get_sitedir)"
		}
		python_foreach_impl building
	fi
}

src_install() {
	autotools-utils_src_install
	if use python; then
		installation() {
			cd "${BUILD_DIR}"/bindings/python || die
			emake \
				DESTDIR="${D}" \
				PYTHON_VERSION="${EPYTHON#python}" \
				NUMPY_CPPFLAGS="-I${EPREFIX}$(python_get_sitedir)/numpy/core/include" \
				PYTHON_CPPFLAGS="-I${EPREFIX}$(python_get_includedir)" \
				pyexecdir="${EPREFIX}$(python_get_sitedir)" \
				pythondir="${EPREFIX}$(python_get_sitedir)" \
				install
				find \
					"${ED}/$(python_get_sitedir)" \
					-type f \( -name "*.a" -o -name "*.la" \) -delete || die
		}
		python_foreach_impl installation
	fi
}