1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic games
8 DESCRIPTION="An online MMORPG written in C and SDL"
9 HOMEPAGE="http://www.eternal-lands.com"
10 SRC_URI="https://dev.gentoo.org/~rich0/distfiles/elc_1.9.2-20110618.tar.bz2
11 https://dev.gentoo.org/~rich0/distfiles/eternal-lands.png"
13 LICENSE="eternal_lands"
15 KEYWORDS="~amd64 ~x86 ~x86-fbsd"
16 IUSE="debug doc kernel_linux"
18 RDEPEND="x11-libs/libX11
31 media-libs/cal3d[-16bit-indices]
33 >=games-rpg/eternal-lands-data-1.9.2"
36 >=app-eselect/eselect-opengl-1.0.6-r1
38 doc? ( app-doc/doxygen
41 #ECVS_SERVER="cvs.elc.berlios.de:/cvsroot/elc"
43 #ECVS_USER="anonymous"
46 #ECVS_CVS_OPTIONS="-dP -z3"
47 #ECVS_BRANCH="elc_1_8_0"
49 #S="${WORKDIR}/${ECVS_MODULE}"
54 OPTIONS="-DDATA_DIR="\\\\\"${GAMES_DATADIR}/${PN}/\\\\\"""
55 S_CLIENT="${WORKDIR}/elc"
62 # Add debugging options
64 OPTIONS="${OPTIONS} -DMEMORY_DEBUG"
68 # Clean compile flags (make Gentoo friendly)
70 -e "s@CFLAGS=\$(PLATFORM) \$(CWARN) -O0 -ggdb -pipe@CFLAGS = ${CFLAGS} ${OPTIONS} @g" \
71 -e "s@CXXFLAGS=\$(PLATFORM) \$(CXXWARN) -O0 -ggdb -pipe@CXXFLAGS = ${CXXFLAGS} ${OPTIONS} @g" \
72 -e 's/lopenal/lopenal -l alut/' \
73 Makefile.linux || die "sed failed"
76 -e 's/#browser/browser/g' \
77 -e "s/browser = mozilla/#browser = ${BROWSER}/g" \
78 -e "s@#data_dir = /usr/local/games/el/@#data_dir = ${GAMES_DATADIR}/${PN}/@g" \
79 el.ini || die "sed failed"
81 # Support BSD in the Linux makefile - it's easier
82 use kernel_linux || sed -i \
83 -e 's/^CFLAGS=.*/& -DBSD/' \
84 Makefile.linux || die "sed failed"
86 # Clean up library flag order for --as-needed
87 # sed -i -e 's/@$(LINK) $(CFLAGS) $(LDFLAGS) -o $(EXE) $(OBJS)/@$(LINK) $(CFLAGS) -o $(EXE) $(OBJS) $(LDFLAGS)/' Makefile.linux
89 # Finally, update the server
90 sed -i -e '/#server_address =/ s/.*/#server_address = game.eternal-lands.com/' \
91 el.ini || die "sed failed"
93 sed -i -e 's:FEATURES:EL_FEATURES:' make.defaults
94 sed -i -e 's:FEATURES:EL_FEATURES:' Makefile.linux
97 sed -i -e 's/#\(EL_FEATURES += MEMORY_DEBUG\)/\1/' make.defaults
98 sed -i -e 's/#\(EL_FEATURES += MEMORY_DEBUG\)/\1/' Makefile.linux
101 cp Makefile.linux Makefile
103 epatch "${FILESDIR}/${PN}-1.9.2-glext.patch"
104 # epatch "${FILESDIR}/${PN}-1.9.1-libpng.patch"
106 # Fix for Gentoo zlib OF redefine
108 sed -i '1i#define OF(x) x' `find -name "*.c"` || die "sed failed"
112 emake || die "make failed"
115 emake docs || die "Failed to create documentation, try with USE=-doc"
116 mv ./docs/html/ ../client || die "Failed to move documentation directory"
121 doicon "${DISTDIR}/eternal-lands.png" ${PN}.png
123 newgamesbin el.x86.linux.bin el \
124 || die "newgamesbin failed"
125 make_desktop_entry el "Eternal Lands" \
126 || die "make_desktop_entry failed"
128 insinto "${GAMES_DATADIR}/${PN}"
130 doins -r *.ini *.txt commands.lst \
131 || die "doins failed"
142 elog "Auto Update is now enabled in Eternal Lands"
143 elog "If an update occurs then the client will suddenly exit"
144 elog "Updates only happen when the game first loads"
145 elog "Please don't report this behaviour as a bug"
147 # Ensure that the files are writable by the game group for auto
149 chmod -R g+rw "${ROOT}/${GAMES_DATADIR}/${PN}"
151 # Make sure new files stay in games group
152 find "${ROOT}/${GAMES_DATADIR}/${PN}" -type d -exec chmod g+sx {} \;