1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 inherit cmake-utils eutils subversion wxwidgets games
11 DESCRIPTION="Advanced source port for Doom/Heretic/Hexen/Strife"
12 HOMEPAGE="http://www.vavoom-engine.com/"
13 ESVN_REPO_URI="https://vavoom.svn.sourceforge.net/svnroot/vavoom/trunk/vavoom"
18 IUSE="allegro asm debug dedicated flac mad mikmod +models +music openal +opengl
19 +sdl +textures tools +vorbis wxwidgets"
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/allegro[opengl] )
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 wxwidgets? ( 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."
76 subversion_src_prepare
78 # Got rid of icon installation
81 source/CMakeLists.txt || die "sed CMakeLists.txt failed"
83 # Set shared data directory
85 -e "s:fl_basedir = \".\":fl_basedir = \"${datadir}\":" \
86 source/files.cpp || die "sed files.cpp failed"
91 with_allegro="-DWITH_ALLEGRO=OFF" \
92 with_sdl="-DWITH_SDL=OFF" \
93 with_vorbis=$(cmake-utils_use_with vorbis)
95 # Sdl is the default, unless sdl=off & allegro=on
96 if ! use sdl && use allegro ; then
97 with_allegro="-DWITH_ALLEGRO=ON"
99 with_sdl="-DWITH_SDL=ON"
102 # Forcibly enable vorbis support if "music" USE flag is enabled
103 if ! use vorbis && use music ; then
104 ewarn "\"music\" USE flag requires Vorbis support enabled."
105 ewarn "Forced enabling of \"vorbis\" USE flag"
106 with_vorbis="-DWITH_VORBIS=ON"
109 mycmakeargs="${mycmakeargs}
110 -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG
111 -DCMAKE_CXX_FLAGS_DEBUG=-g2
113 -DBINDIR="${GAMES_BINDIR}"
115 -DENABLE_WRAPPERS=OFF
119 $(cmake-utils_use_with opengl OPENGL)
120 $(cmake-utils_use_with openal OPENAL)
121 $(cmake-utils_use_with mad LIBMAD)
122 $(cmake-utils_use_with mikmod MIKMOD)
123 $(cmake-utils_use_with flac FLAC)
124 $(cmake-utils_use_enable debug ZONE_DEBUG)
125 $(cmake-utils_use_enable dedicated SERVER)
126 $(cmake-utils_use_enable asm ASM)
127 $(cmake-utils_use_enable wxwidgets LAUNCHER)
128 -DwxWidgets_CONFIG_EXECUTABLE=${WX_CONFIG}"
130 cmake-utils_src_configure
132 cmake-utils_src_make -j1
138 cmake-utils_src_install
140 # Enable OpenGL in desktop entry, if relevant USE flag is enabled
141 use opengl && de_cmd="${PN} -opengl"
142 doicon "source/${PN}.png" || die "doicon ${PN}.png failed"
143 make_desktop_entry "${de_cmd}" "Vavoom"
145 dodoc "docs/${PN}.txt" || die "dodoc vavoom.txt failed"
148 # The tools are always built
149 dogamesbin utils/bin/{acc,fixmd2,vcc,vlumpy} || die "dobin utils failed"
150 dodoc utils/vcc/vcc.txt || die "dodoc vcc.txt failed"
153 if use wxwidgets ; then
154 # Install graphical launcher shortcut
155 doicon utils/vlaunch/vlaunch.xpm || die "doicon vlaunch.xpm failed"
156 make_desktop_entry "vlaunch" "Vavoom Launcher" "vlaunch.xpm"
165 elog "Copy or link wad files into ${datadir}"
166 elog "(the files must be readable by the 'games' group)."
168 elog "Example setup:"
169 elog "ln -sn "${GAMES_DATADIR}"/doom-data/doom.wad "${datadir}"/"
171 elog "Example command-line:"
172 elog " vavoom -doom -opengl"
174 elog "See documentation for further details."
176 if use wxwidgets ; then
178 einfo "You've also installed a nice graphical launcher. Simply run:"
182 einfo "to enjoy it :)"
187 einfo "You have also installed some Vavoom-related utilities"
188 einfo "(useful for mod developing):"
190 einfo " - acc (ACS Script Compiler)"
191 einfo " - fixmd2 (MD2 models utility)"
192 einfo " - vcc (Vavoom C Compiler)"
193 einfo " - vlumpy (Vavoom Lump utility)"
195 einfo "See the Vavoom Wiki at http://vavoom-engine.com/wiki/ or"
196 einfo "Vavoom Forum at http://www.vavoom-engine.com/forums/"
197 einfo "for further help."