/[gentoo-x86]/games-roguelike/tome/tome-2.3.5.ebuild
Gentoo

Contents of /games-roguelike/tome/tome-2.3.5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon May 28 12:23:39 2012 UTC (2 years, 2 months ago) by tupone
Branch: MAIN
Changes since 1.6: +6 -3 lines
Fix build without X11. Bug #369279

(Portage version: 2.1.10.63/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/games-roguelike/tome/tome-2.3.5.ebuild,v 1.6 2011/03/01 07:25:39 mr_bones_ Exp $
4
5 EAPI=2
6 inherit eutils games
7
8 MY_PV=${PV//./}
9 DESCRIPTION="save the world from Morgoth and battle evil (or become evil ;])"
10 HOMEPAGE="http://t-o-m-e.net/"
11 SRC_URI="http://t-o-m-e.net/dl/src/tome-${MY_PV}-src.tar.bz2"
12
13 LICENSE="Moria"
14 SLOT="0"
15 KEYWORDS="~amd64 ppc x86"
16 IUSE="X Xaw3d gtk sdl"
17
18 RDEPEND=">=sys-libs/ncurses-5
19 X? ( x11-libs/libX11 )
20 Xaw3d? ( x11-libs/libXaw )
21 sdl? (
22 media-libs/sdl-ttf
23 media-libs/sdl-image
24 media-libs/libsdl )
25 gtk? ( >=x11-libs/gtk+-2.12.8:2 ) "
26 DEPEND="${RDEPEND}
27 x11-misc/makedepend"
28
29 S=${WORKDIR}/tome-${MY_PV}-src/src
30
31 src_prepare() {
32 mv makefile.std makefile
33 epatch "${FILESDIR}/${PV}-gentoo-paths.patch" \
34 "${FILESDIR}"/${P}-noX.patch
35 sed -i \
36 -e "s:xx:x:" \
37 ../lib/edit/p_info.txt
38 sed -i \
39 -e "s:GENTOO_DIR:${GAMES_STATEDIR}:" files.c init2.c \
40 || die "sed failed"
41
42 find .. -name .cvsignore -exec rm -f \{\} \;
43 find ../lib/edit -type f -exec chmod a-x \{\} \;
44 }
45
46 src_compile() {
47 local GENTOO_INCLUDES="" GENTOO_DEFINES="-DUSE_GCU " GENTOO_LIBS="-lncurses"
48 if use sdl || use X || use gtk || use Xaw3d; then
49 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_EGO_GRAPHICS -DUSE_TRANSPARENCY \
50 -DSUPPORT_GAMMA"
51 fi
52 if use sdl || use X || use Xaw3d; then
53 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_PRECISE_CMOVIE -DUSE_UNIXSOCK "
54 fi
55 if use sdl; then
56 GENTOO_INCLUDES="${GENTOO_INCLUDES} $(sdl-config --cflags)"
57 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_SDL "
58 GENTOO_LIBS="${GENTOO_LIBS} $(sdl-config --libs) -lSDL_image -lSDL_ttf"
59 fi
60 if use X; then
61 GENTOO_INCLUDES="${GENTOO_INCLUDES} -I/usr/X11R6/include "
62 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_X11 "
63 GENTOO_LIBS="${GENTOO_LIBS} -L/usr/X11R6/lib -lX11 "
64 fi
65 if use Xaw3d; then
66 GENTOO_INCLUDES="${GENTOO_INCLUDES} -I/usr/X11R6/include "
67 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_XAW "
68 GENTOO_LIBS="${GENTOO_LIBS} -L/usr/X11R6/lib -lXaw -lXmu -lXt -lX11 "
69 fi
70 if use gtk; then
71 GENTOO_INCLUDES="${GENTOO_INCLUDES} $(pkg-config gtk+-2.0 --cflags)"
72 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_GTK2 "
73 GENTOO_LIBS="${GENTOO_LIBS} $(pkg-config gtk+-2.0 --libs) "
74 GTK_SRC_FILE="main-gtk2.c"
75 GTK_OBJ_FILE="main-gtk2.o"
76 else
77 GTK_SRC_FILE=""
78 GTK_OBJ_FILE=""
79 fi
80 if use amd64; then
81 GENTOO_DEFINES="${GENTOO_DEFINES} -DLUA_NUM_TYPE=int "
82 fi
83 GENTOO_INCLUDES="${GENTOO_INCLUDES} -Ilua -I."
84 GENTOO_DEFINES="${GENTOO_DEFINES} -DUSE_LUA"
85 make \
86 INCLUDES="${GENTOO_INCLUDES}" \
87 DEFINES="${GENTOO_DEFINES}" \
88 depend || die "make depend failed"
89 emake ./tolua || die "emake ./tolua failed"
90 emake \
91 COPTS="${CFLAGS}" \
92 INCLUDES="${GENTOO_INCLUDES}" \
93 DEFINES="${GENTOO_DEFINES}" \
94 LIBS="${GENTOO_LIBS}" \
95 BINDIR="${GAMES_BINDIR}" \
96 LIBDIR="${GAMES_DATADIR}/${PN}" \
97 GTK_SRC_FILE="${GTK_SRC_FILE}" \
98 GTK_OBJ_FILE="${GTK_OBJ_FILE}" \
99 || die "emake failed"
100 }
101
102 src_install() {
103 make \
104 DESTDIR="${D}" \
105 OWNER="${GAMES_USER}" \
106 BINDIR="${GAMES_BINDIR}" \
107 LIBDIR="${GAMES_DATADIR}/${PN}" install \
108 || die "make install failed"
109 cd ..
110 dodoc *.txt
111
112 dodir "${GAMES_STATEDIR}"
113 touch "${D}/${GAMES_STATEDIR}/${PN}-scores.raw"
114 prepgamesdirs
115 fperms g+w "${GAMES_STATEDIR}/${PN}-scores.raw"
116 #FIXME: something has to be done about this.
117 fperms g+w "${GAMES_DATADIR}/${PN}/data"
118 }
119
120 pkg_postinst() {
121 games_pkg_postinst
122 echo
123 ewarn "ToME ${PV} is not save-game compatible with 2.3.0 and previous versions."
124 echo
125 ewarn "If you have older save files and you wish to continue those games,"
126 ewarn "you'll need to remerge the version of ToME with which you started"
127 ewarn "those save-games."
128 }

  ViewVC Help
Powered by ViewVC 1.1.20