1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 inherit cmake-utils eutils wxwidgets games
11 DESCRIPTION="Advanced source port for Doom/Heretic/Hexen/Strife"
12 HOMEPAGE="http://www.vavoom-engine.com/"
13 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="allegro asm debug dedicated flac mad mikmod +models +music openal +opengl
19 +sdl +textures tools +vorbis wxwindows"
21 # From econf: "Vavoom requires Allegro or SDL to compile"
22 # SDL,like Allegro are *software* renderers in this game.
23 # So, if not selected through proper USEs, the default is SDL,
24 # without opengl (vavoom can run in software-mode only).
25 # To enable it, enable proper USE.
26 # OpenGL is the normally-desired hardware renderer, selected on command-line
27 # (through "-opengl" switch). This switch is also added to the desktop entry,
28 # if "opengl" USE flag is enabled
30 SDLDEPEND=">=media-libs/libsdl-1.2[X,alsa,opengl?]
31 media-libs/sdl-mixer[timidity]"
32 ALLEGDEPEND=">=media-libs/allegro-4.0[X,alsa]"
33 OPENGLDEPEND="opengl? ( virtual/opengl )
35 allegro? ( media-libs/allegrogl )
36 !sdl? ( !allegro? ( ${SDLDEPEND} ) )"
37 DEPEND="media-libs/libpng
40 !sdl? ( allegro? ( ${ALLEGDEPEND} ) )
41 !sdl? ( !allegro? ( !dedicated? ( ${OPENGLDEPEND} ) ) )
42 opengl? ( ${OPENGLDEPEND} )
43 vorbis? ( media-libs/libvorbis )
44 flac? ( media-libs/flac )
45 mad? ( media-libs/libmad )
46 mikmod? ( media-libs/libmikmod )
47 openal? ( media-libs/openal )
48 wxwindows? ( x11-libs/wxGTK:2.8 )"
50 allegro? ( media-sound/timidity++ )"
51 PDEPEND="models? ( >=games-fps/vavoom-models-1.4.3 )
52 music? ( games-fps/vavoom-music )
53 textures? ( games-fps/vavoom-textures )"
55 datadir=${GAMES_DATADIR}/${PN}
57 CMAKE_IN_SOURCE_BUILD=true
62 # Print some warning if needed
63 if use sdl && use allegro ; then
65 ewarn "Both 'allegro' and 'sdl' USE flags enabled. Using SDL as default."
66 elif ! use sdl && ! use allegro ; then
68 ewarn "Both 'allegro' and 'sdl' USE flags disabled. Using SDL as default."
71 ! use opengl && ewarn "'opengl' USE flag disabled. OpenGL is recommended, for best graphics."
75 # Got rid of icon installation
78 source/CMakeLists.txt || die "sed CMakeLists.txt failed"
80 # Set shared data directory
82 -e "s:fl_basedir = \".\":fl_basedir = \"${datadir}\":" \
83 source/files.cpp || die "sed files.cpp failed"
88 with_allegro="-DWITH_ALLEGRO=OFF" \
89 with_sdl="-DWITH_SDL=OFF" \
90 with_vorbis=$(cmake-utils_use_with vorbis)
92 # Sdl is the default, unless sdl=off & allegro=on
93 if ! use sdl && use allegro ; then
94 with_allegro="-DWITH_ALLEGRO=ON"
96 with_sdl="-DWITH_SDL=ON"
99 # Forcibly enable vorbis support if "music" USE flag is enabled
100 if ! use vorbis && use music ; then
101 ewarn "\"music\" USE flag requires Vorbis support enabled."
102 ewarn "Forced enabling of \"vorbis\" USE flag"
103 with_vorbis="-DWITH_VORBIS=ON"
106 mycmakeargs="${mycmakeargs}
107 -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG
108 -DCMAKE_CXX_FLAGS_DEBUG=-g2
110 -DBINDIR="${GAMES_BINDIR}"
112 -DENABLE_WRAPPERS=OFF
116 $(cmake-utils_use_with opengl OPENGL)
117 $(cmake-utils_use_with openal OPENAL)
118 $(cmake-utils_use_with mad LIBMAD)
119 $(cmake-utils_use_with mikmod MIKMOD)
120 $(cmake-utils_use_with flac FLAC)
121 $(cmake-utils_use_enable debug ZONE_DEBUG)
122 $(cmake-utils_use_enable dedicated SERVER)
123 $(cmake-utils_use_enable asm ASM)
124 $(cmake-utils_use_enable wxwindows LAUNCHER)
125 -DwxWidgets_CONFIG_EXECUTABLE=${WX_CONFIG}"
127 cmake-utils_src_configure
129 cmake-utils_src_make -j1
135 cmake-utils_src_install
137 # Enable OpenGL in desktop entry, if relevant USE flag is enabled
138 use opengl && de_cmd="${PN} -opengl"
139 doicon "source/${PN}.png" || die "doicon ${PN}.png failed"
140 make_desktop_entry "${de_cmd}" "Vavoom"
142 dodoc "docs/${PN}.txt" || die "dodoc vavoom.txt failed"
145 # The tools are always built
146 dogamesbin utils/bin/{acc,fixmd2,vcc,vlumpy} || die "dobin utils failed"
147 dodoc utils/vcc/vcc.txt || die "dodoc vcc.txt failed"
150 if use wxwindows ; then
151 # Install graphical launcher shortcut
152 doicon utils/vlaunch/vlaunch.xpm || die "doicon vlaunch.xpm failed"
153 make_desktop_entry "vlaunch" "Vavoom Launcher" "vlaunch.xpm"
162 elog "Copy or link wad files into ${datadir}"
163 elog "(the files must be readable by the 'games' group)."
165 elog "Example setup:"
166 elog "ln -sn "${GAMES_DATADIR}"/doom-data/doom.wad "${datadir}"/"
168 elog "Example command-line:"
169 elog " vavoom -doom -opengl"
171 elog "See documentation for further details."
173 if use wxwindows ; then
175 einfo "You've also installed a nice graphical launcher. Simply run:"
179 einfo "to enjoy it :)"
184 einfo "You have also installed some Vavoom-related utilities"
185 einfo "(useful for mod developing):"
187 einfo " - acc (ACS Script Compiler)"
188 einfo " - fixmd2 (MD2 models utility)"
189 einfo " - vcc (Vavoom C Compiler)"
190 einfo " - vlumpy (Vavoom Lump utility)"
192 einfo "See the Vavoom Wiki at http://vavoom-engine.com/wiki/ or"
193 einfo "Vavoom Forum at http://www.vavoom-engine.com/forums/"
194 einfo "for further help."