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

EAPI=7

inherit autotools

DESCRIPTION="Open Dynamics Engine SDK"
HOMEPAGE="http://ode.org/"
SRC_URI="https://bitbucket.org/odedevs/ode/downloads/${P}.tar.gz"

LICENSE="|| ( LGPL-2.1+ BSD )"
SLOT="0/6"
KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~x86-linux"
IUSE="debug doc double-precision examples gyroscopic static-libs"

RDEPEND="
	examples? (
		virtual/glu
		virtual/opengl
	)
"
DEPEND="${RDEPEND}"
BDEPEND="doc? ( app-doc/doxygen )"

MY_EXAMPLES_DIR=/usr/share/doc/${PF}/examples

DOCS=( CHANGELOG.txt README.md )

PATCHES=(
	"${FILESDIR}"/${PN}-0.14-gcc7.patch
)

src_prepare() {
	default

	sed -i \
		-e "s:\$.*/drawstuff/textures:${MY_EXAMPLES_DIR}:" \
		drawstuff/src/Makefile.am \
		ode/demo/Makefile.am || die
	eautoreconf
}

src_configure() {
	# use bash (bug #335760)
	CONFIG_SHELL=/bin/bash \
	econf \
		--enable-shared \
		$(use_enable static-libs static) \
		$(use_enable debug asserts) \
		$(use_enable double-precision) \
		$(use_enable examples demos) \
		$(use_enable gyroscopic) \
		$(use_with examples drawstuff X11)
}

src_compile() {
	emake
	if use doc ; then
		cd ode/doc || die
		doxygen Doxyfile || die
	fi
}

src_install() {
	default

	find "${ED}" -name '*.la' -delete || die

	if use doc ; then
		docinto html
		dodoc docs/*
	fi

	if use examples ; then
		docompress -x ${MY_EXAMPLES_DIR}

		insinto ${MY_EXAMPLES_DIR}
		exeinto ${MY_EXAMPLES_DIR}

		doexe drawstuff/dstest/dstest
		doins ode/demo/*.{c,cpp,h} \
			drawstuff/textures/*.ppm \
			drawstuff/dstest/dstest.cpp \
			drawstuff/src/{drawstuff.cpp,internal.h,x11.cpp}

		cd ode/demo || die

		local f
		for f in *.c* ; do
			doexe .libs/${f%.*}
		done
	fi
}