/[gentoo-x86]/media-gfx/tachyon/tachyon-0.98.9-r2.ebuild
Gentoo

Contents of /media-gfx/tachyon/tachyon-0.98.9-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat May 5 07:00:19 2012 UTC (2 years, 4 months ago) by jdhore
Branch: MAIN
Changes since 1.2: +2 -2 lines
dev-util/pkgconfig -> virtual/pkgconfig

(Portage version: 2.2.0_alpha101/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-gfx/tachyon/tachyon-0.98.9-r2.ebuild,v 1.2 2012/03/24 16:12:53 grobian Exp $
4
5 EAPI="4"
6
7 inherit eutils toolchain-funcs
8
9 DESCRIPTION="A portable, high performance parallel ray tracing system"
10 HOMEPAGE="http://jedi.ks.uiuc.edu/~johns/raytracer/"
11 SRC_URI="http://jedi.ks.uiuc.edu/~johns/raytracer/files/${PV}/${P}.tar.gz"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~x86 ~x64-macos ~x86-macos"
16 IUSE="doc examples jpeg mpi opengl png threads"
17
18 CDEPEND="jpeg? ( virtual/jpeg )
19 mpi? ( virtual/mpi )
20 opengl? ( virtual/opengl )
21 png? ( media-libs/libpng )"
22 DEPEND="${CDEPEND}
23 virtual/pkgconfig"
24 RDEPEND="${CDEPEND}"
25
26 REQUIRED_USE="^^ ( opengl mpi )"
27
28 S="${WORKDIR}/${PN}/unix"
29
30 # TODO: Test on alpha, ia64, ppc
31 # TODO: add other architectures
32 # TODO: X, Motif, MBOX, Open Media Framework, Spaceball I/O, MGF ?
33
34 TACHYON_MAKE_TARGET=
35
36 pkg_setup() {
37 local ostarget
38 case ${CHOST} in
39 powerpc*-darwin*) ostarget=macosx ;;
40 *86*-darwin*) ostarget=macosx-x86 ;;
41 *) ostarget=linux ;;
42 esac
43
44 if use threads ; then
45 if use opengl ; then
46 TACHYON_MAKE_TARGET=${ostarget}-thr-ogl
47 elif use mpi ; then
48 TACHYON_MAKE_TARGET=${ostarget}-mpi-thr
49 else
50 TACHYON_MAKE_TARGET=${ostarget}-thr
51 fi
52
53 # TODO: Support for linux-athlon-thr ?
54 else
55 if use mpi ; then
56 TACHYON_MAKE_TARGET=${ostarget}-mpi
57 else
58 TACHYON_MAKE_TARGET=${ostarget}
59 fi
60 fi
61
62 if [[ -z "${TACHYON_MAKE_TARGET}" ]]; then
63 die "No target found, check use flags"
64 else
65 einfo "Using target: ${TACHYON_MAKE_TARGET}"
66 fi
67 }
68
69 src_prepare() {
70 if use jpeg ; then
71 sed -i \
72 -e "s:USEJPEG=:USEJPEG=-DUSEJPEG:g" \
73 -e "s:JPEGLIB=:JPEGLIB=-ljpeg:g" Make-config \
74 || die "sed failed"
75 fi
76
77 if use png ; then
78 sed -i \
79 -e "s:USEPNG=:USEPNG=-DUSEPNG:g" \
80 -e "s:PNGINC=:PNGINC=$(pkg-config libpng --cflags):g" \
81 -e "s:PNGLIB=:PNGLIB=$(pkg-config libpng --libs):g" Make-config \
82 || die "sed failed"
83 fi
84
85 if use mpi ; then
86 sed -i "s:MPIDIR=:MPIDIR=/usr:g" Make-config || die "sed failed"
87 sed -i "s:linux-lam:linux-mpi:g" Make-config || die "sed failed"
88 fi
89 sed -i \
90 -e "s:-O3::g;s:-g::g;s:-pg::g" \
91 -e "s:-m32:${CFLAGS}:g" \
92 -e "s:-m64:${CFLAGS}:g" \
93 -e "s:-ffast-math::g" \
94 -e "s:STRIP = strip:STRIP = touch:g" \
95 -e "s:CC = *cc:CC = $(tc-getCC):g" \
96 -e "s:-fomit-frame-pointer::g" Make-arch || die "sed failed"
97
98 epatch "${FILESDIR}"/${PV}-ldflags.patch
99 }
100
101 src_compile() {
102 emake ${TACHYON_MAKE_TARGET} || die "emake failed"
103 }
104
105 src_install() {
106 cd ..
107 dodoc Changes README || die "dodoc failed"
108
109 if use doc ; then
110 dohtml docs/tachyon/* || die "dohtml failed"
111 fi
112
113 cd compile/${TACHYON_MAKE_TARGET}
114
115 dobin tachyon || die "dobin failed"
116
117 if use examples; then
118 cd "${S}/../scenes"
119 insinto "/usr/share/${PN}/examples"
120 doins * || die "doins failed"
121 fi
122 }

  ViewVC Help
Powered by ViewVC 1.1.20