summaryrefslogtreecommitdiff
blob: a23f0727e2cd50486f49a70d669dd746f13bb977 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/sg/sg-1.4.ebuild,v 1.1 2010/11/01 13:59:49 jlec Exp $

EAPI="3"

inherit autotools eutils multilib

DESCRIPTION="Socket Graphics tool for displaying polygons"
HOMEPAGE="http://fetk.org/codes/sg/index.html"
SRC_URI="http://www.fetk.org/codes/download/${P}.tar.gz"

SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
LICENSE="GPL-2"
IUSE="opengl"

RDEPEND="
	dev-libs/maloc
	x11-libs/openmotif
	opengl? (
		virtual/glu
		virtual/opengl
	)"
DEPEND="${RDEPEND}"

S="${WORKDIR}"/${PN}

src_prepare() {
	rm src/{gl,glu,glw} -rf
	epatch "${FILESDIR}"/${PV}-opengl.patch
	eautoreconf
}

src_configure() {
	local sg_include
	local sg_lib
	local myconf

	sg_include="${EPREFIX}"/usr/include
	sg_lib="${EPREFIX}"/usr/$(get_libdir)
	export FETK_LIBRARY="${sg_lib}"
	export FETK_MOTIF_LIBRARY="${sg_lib}"
	export FETK_GL_LIBRARY="${sg_lib}"
	export FETK_GLU_LIBRARY="${sg_lib}"
	export FETK_GLW_LIBRARY="${sg_lib}"
	export FETK_INCLUDE="${sg_include}"
	export FETK_GLW_INCLUDE="${sg_include}"
	export FETK_GLU_INCLUDE="${sg_include}"
	export FETK_GL_INCLUDE="${sg_include}"/GL
	export FETK_MOTIF_INCLUDE="${sg_include}"

	use opengl && myconf="${myconf} --enable-glforce --enable-gluforce --enable-glwforce"

	econf \
		${myconf} \
		--enable-shared \
		--disable-triplet
}

src_install() {
	emake DESTDIR="${D}" install || die
}