summaryrefslogtreecommitdiff
blob: 7a9a57bd5f273aeec85932eddb790480d1066982 (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Extensible NMEA-0183 (GPS) data parser in standard C"
HOMEPAGE="http://nmeap.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="doc"

BDEPEND="doc? ( app-doc/doxygen )"

PATCHES=( "${FILESDIR}/${P}-fix-unitialized-variable.patch" )

src_prepare() {
	default

	# Repsect users CFLAGS for the static lib archive
	sed -i -e 's/CFLAGS =/CFLAGS +=/' -e 's/-g -O0 -Werror//' src/Makefile || die

	# Don't build test programs, as they are not needed
	sed -i -e '/TST/d' Makefile || die

	# Silent output of Doxygen and update it, since it is quite old
	if use doc; then
		sed -i -e 's/QUIET.*/QUIET = YES/' Doxyfile || die
		doxygen -u Doxyfile 2>/dev/null || die
	fi
}

src_compile() {
	local myemakeopts=(
		AR="$(tc-getAR)"
		CC="$(tc-getCC)"
	)

	emake "${myemakeopts[@]}"

	if use doc; then
		doxygen Doxyfile || die
	fi
}

src_install() {
	dolib.a lib/libnmeap.a

	doheader inc/nmeap.h inc/nmeap_def.h

	if use doc; then
		local HTML_DOCS=( "doc/tutorial.html" "doc/html" )
	fi

	einstalldocs
}