Lines 2-8
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
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-r1.ebuild,v 1.2 2010/11/08 18:45:47 xarthisius Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/media-gfx/tachyon/tachyon-0.98.9-r1.ebuild,v 1.2 2010/11/08 18:45:47 xarthisius Exp $ |
4 |
|
4 |
|
5 |
EAPI="2" |
5 |
EAPI="3" |
6 |
|
6 |
|
7 |
inherit eutils toolchain-funcs |
7 |
inherit eutils toolchain-funcs |
8 |
|
8 |
|
Lines 33-65
Link Here
|
33 |
|
33 |
|
34 |
TACHYON_MAKE_TARGET= |
34 |
TACHYON_MAKE_TARGET= |
35 |
|
35 |
|
|
|
36 |
make_arch() { |
37 |
local OS= LIBS= CFTHR= CFOGL= CFMPI= LTHR= LOGL= LMPI= CF64= |
38 |
|
39 |
# TACHYON_MAKE_TARGET needs not to match with Make-arch, since we just |
40 |
# produce that info here. This avoids patching, and the only thing |
41 |
# Make-arch does, is basically calling `make all` with some pre-set flags |
42 |
# we don't want anyway -- added bonus is that we can support more targets |
43 |
case ${TACHYON_MAKE_TARGET} in |
44 |
linux-*|linux) OS="-DLinux"; LIBS="-lm" ;; |
45 |
darwin-*|darwin) OS="-DBsd"; LIBS="" ;; |
46 |
solaris-*|solaris) OS="-DSunOS"; LIBS="-lm -lsocket -lnsl" ;; |
47 |
esac |
48 |
case ${TACHYON_MAKE_TARGET} in |
49 |
darwin-*thr*) |
50 |
# Darwin needs -framework Carbon for MPProcessorsScheduled |
51 |
CFTHR="-DTHR -DUSEPOSIXTHREADS"; LTHR="-pthread -framework Carbon" |
52 |
;; |
53 |
*-thr*) CFTHR="-DTHR -DUSEPOSIXTHREADS"; LTHR="-pthread" ;; |
54 |
esac |
55 |
case ${TACHYON_MAKE_TARGET} in |
56 |
*-ogl*) CFOGL="-DUSEOPENGL"; LOGL="-lGL -lGLU -lX11" ;; |
57 |
esac |
58 |
case ${TACHYON_MAKE_TARGET} in |
59 |
*-mpi*) CFMPI="-DMPI"; LMPI="-lmpi" ;; |
60 |
esac |
61 |
case ${CHOST} in |
62 |
sparcv9-*|sparc64-*|powerpc64-*|ppc64-*|ia64-*|x86_64-*) |
63 |
CF64="-DLP64" |
64 |
;; |
65 |
esac |
66 |
|
67 |
emake all \ |
68 |
"ARCH = gentoo-${TACHYON_MAKE_TARGET}" \ |
69 |
"CC = $(tc-getCC)" \ |
70 |
"CFLAGS = ${CFLAGS} \$(MISCFLAGS) ${OS} ${CFTHR} ${CFOGL} ${CFMPI} ${CF64}" \ |
71 |
"AR = ar" \ |
72 |
"ARFLAGS = r" \ |
73 |
"STRIP = touch" \ |
74 |
"LIBS = -L. -ltachyon \$(MISCLIB) ${LTHR} ${LOGL} ${LMPI} ${LIBS}" |
75 |
} |
76 |
|
36 |
pkg_setup() { |
77 |
pkg_setup() { |
37 |
if use threads ; then |
78 |
case "${CHOST}:$(usev threads):$(usev mpi):$(usev opengl)" in |
38 |
if use opengl ; then |
79 |
*-linux-gnu:threads::opengl) |
39 |
TACHYON_MAKE_TARGET=linux-thr-ogl |
80 |
TACHYON_MAKE_TARGET=linux-thr-ogl |
40 |
if use mpi ; then |
81 |
;; |
41 |
die "tachyon does not support MPI with OpenGL and threads" |
82 |
*-linux-gnu:threads:mpi:) |
42 |
fi |
|
|
43 |
elif use mpi ; then |
44 |
TACHYON_MAKE_TARGET=linux-mpi-thr |
83 |
TACHYON_MAKE_TARGET=linux-mpi-thr |
45 |
else |
84 |
;; |
|
|
85 |
*-linux-gnu:threads::) |
46 |
TACHYON_MAKE_TARGET=linux-thr |
86 |
TACHYON_MAKE_TARGET=linux-thr |
47 |
fi |
87 |
;; |
48 |
|
88 |
*-linux-gnu::mpi:) |
49 |
# TODO: Support for linux-athlon-thr ? |
89 |
TACHYON_MAKE_TARGET=linux-mpi |
50 |
else |
90 |
;; |
51 |
if use opengl ; then |
91 |
*-linux-gnu:::) |
52 |
# TODO: Support target: linux-lam-64-ogl |
|
|
53 |
|
54 |
die "OpenGL is only available with USE=threads!" |
55 |
elif use mpi ; then |
56 |
TACHYON_MAKE_TARGET=linux-mpi |
57 |
else |
58 |
TACHYON_MAKE_TARGET=linux |
92 |
TACHYON_MAKE_TARGET=linux |
59 |
fi |
93 |
;; |
60 |
|
94 |
*-darwin*:threads::opengl) |
61 |
# TODO: Support for linux-p4, linux-athlon, linux-ps2 ? |
95 |
TACHYON_MAKE_TARGET=darwin-thr-ogl |
62 |
fi |
96 |
;; |
|
|
97 |
*-darwin*:threads::) |
98 |
TACHYON_MAKE_TARGET=darwin-thr |
99 |
;; |
100 |
*-darwin*:::) |
101 |
TACHYON_MAKE_TARGET=darwin |
102 |
;; |
103 |
# TODO: try mpi |
104 |
*-solaris*:threads::opengl) |
105 |
TACHYON_MAKE_TARGET=solaris-thr-ogl |
106 |
;; |
107 |
*-solaris*:threads::) |
108 |
TACHYON_MAKE_TARGET=solaris-thr |
109 |
;; |
110 |
*-solaris*::mpi:) |
111 |
TACHYON_MAKE_TARGET=solaris-mpi |
112 |
;; |
113 |
*-solaris*:::) |
114 |
TACHYON_MAKE_TARGET=solaris |
115 |
;; |
116 |
*) |
117 |
die "tachyon does not support selected combination of MPI, OpenGL and threads for target ${CHOST}" |
118 |
;; |
119 |
esac |
63 |
|
120 |
|
64 |
if [[ -z "${TACHYON_MAKE_TARGET}" ]]; then |
121 |
if [[ -z "${TACHYON_MAKE_TARGET}" ]]; then |
65 |
die "No target found, check use flags" |
122 |
die "No target found, check use flags" |
Lines 85-107
Link Here
|
85 |
fi |
142 |
fi |
86 |
|
143 |
|
87 |
if use mpi ; then |
144 |
if use mpi ; then |
88 |
sed -i "s:MPIDIR=:MPIDIR=/usr:g" Make-config || die "sed failed" |
145 |
sed -i "s:MPIDIR=:MPIDIR=${EPREFIX}/usr:g" Make-config || die "sed failed" |
89 |
sed -i "s:linux-lam:linux-mpi:g" Make-config || die "sed failed" |
146 |
sed -i "s:linux-lam:linux-mpi:g" Make-config || die "sed failed" |
90 |
fi |
147 |
fi |
91 |
sed -i \ |
|
|
92 |
-e "s:-O3::g;s:-g::g;s:-pg::g" \ |
93 |
-e "s:-m32:${CFLAGS}:g" \ |
94 |
-e "s:-m64:${CFLAGS}:g" \ |
95 |
-e "s:-ffast-math::g" \ |
96 |
-e "s:STRIP = strip:STRIP = touch:g" \ |
97 |
-e "s:CC = *cc:CC = $(tc-getCC):g" \ |
98 |
-e "s:-fomit-frame-pointer::g" Make-arch || die "sed failed" |
99 |
|
148 |
|
100 |
epatch "${FILESDIR}"/${PV}-ldflags.patch |
149 |
epatch "${FILESDIR}"/${PV}-ldflags.patch |
101 |
} |
150 |
} |
102 |
|
151 |
|
103 |
src_compile() { |
152 |
src_compile() { |
104 |
emake ${TACHYON_MAKE_TARGET} || die "emake failed" |
153 |
make_arch || die "emake failed" |
105 |
} |
154 |
} |
106 |
|
155 |
|
107 |
src_install() { |
156 |
src_install() { |
Lines 112-118
Link Here
|
112 |
dohtml docs/tachyon/* || die "dohtml failed" |
161 |
dohtml docs/tachyon/* || die "dohtml failed" |
113 |
fi |
162 |
fi |
114 |
|
163 |
|
115 |
cd compile/${TACHYON_MAKE_TARGET} |
164 |
cd compile/gentoo-${TACHYON_MAKE_TARGET} |
116 |
|
165 |
|
117 |
dobin tachyon || die "dobin failed" |
166 |
dobin tachyon || die "dobin failed" |
118 |
|
167 |
|