/[gentoo-x86]/games-action/d1x-rebirth/d1x-rebirth-0.50.ebuild
Gentoo

Contents of /games-action/d1x-rebirth/d1x-rebirth-0.50.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Jan 9 17:25:00 2007 UTC (13 years, 4 months ago) by wolf31o2
Branch: MAIN
Initial import.  Original ebuild by Paul Bredbury <brebs@sent.com> and edited by me.  Closing bug #154590.
(Portage version: 2.1.2_rc4-r1)

1 wolf31o2 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4    
5     inherit autotools eutils games
6    
7     # DV is the Descent version. Used because the d2x-rebirth ebuild is similar.
8     DV="1"
9     DATE="20061025"
10     DVX=d${DV}x
11     FILE_START="${PN}_v${PV}-src-${DATE}"
12     SRC_STEM="http://www.dxx-rebirth.de/download/dxx"
13    
14     DESCRIPTION="Descent Rebirth - enhanced Descent 1 client"
15     HOMEPAGE="http://www.dxx-rebirth.de/"
16     SRC_URI="${SRC_STEM}/oss/src/${FILE_START}.tar.gz
17     ${SRC_STEM}/res/dxx-rebirth_icons.zip
18     ${SRC_STEM}/res/${PN}_hires-briefings.zip
19     ${SRC_STEM}/res/${PN}_hires-fonts.zip"
20    
21     # Licence info at bug #117344.
22     # All 3 licences apply.
23     LICENSE="D1X
24     GPL-2
25     as-is"
26     SLOT="0"
27     # Should work on amd64 also
28     KEYWORDS="~x86"
29     IUSE="awe32 debug demo mpu401 opengl mixer"
30    
31     QA_EXECSTACK="${GAMES_BINDIR:1}/${PN}"
32    
33     UIRDEPEND="media-libs/alsa-lib
34     >=media-libs/libsdl-1.2.9
35     >=media-libs/sdl-image-1.2.3-r1
36     mixer? ( media-libs/sdl-mixer )
37     >=dev-games/physfs-1.0.1
38     opengl? (
39     virtual/glu
40     virtual/opengl )
41     x11-libs/libX11"
42     UIDEPEND="x11-proto/xf86dgaproto
43     x11-proto/xf86vidmodeproto
44     x11-proto/xproto"
45     # There is no ebuild for descent1-data
46     RDEPEND="${UIRDEPEND}
47     demo? ( games-action/descent1-demodata )"
48     DEPEND="${UIRDEPEND}
49     ${UIDEPEND}
50     dev-util/scons
51     app-arch/unzip"
52    
53     S=${WORKDIR}/${PN}
54     dir=${GAMES_DATADIR}/${DVX}
55    
56     src_unpack() {
57     unpack ${A}
58     cd "${S}"
59    
60     # "sdl_only=1" does not compile otherwise:
61     # arch/sdl/clipboard.o: In function `getClipboardText':
62     # clipboard.c:(.text+0x89): undefined reference to `XGetSelectionOwner'
63     sed -i \
64     -e "s:'SDL':'SDL', 'X11':" \
65     -e "s:-O2:${CXXFLAGS}:" \
66     SConstruct || die "sed SConstruct failed"
67    
68     # Midi music - awe32 for most SoundBlaster cards
69     if use awe32 ; then
70     sed -i \
71     -e "s://#define WANT_AWE32 1:#define WANT_AWE32 1:" \
72     arch/linux/hmiplay.c || die "sed awe32 failed"
73     elif use mpu401 ; then
74     sed -i \
75     -e "s://#define WANT_MPU401 1:#define WANT_MPU401 1:" \
76     arch/linux/hmiplay.c || die "sed mpu401 failed"
77     fi
78     }
79    
80     src_compile() {
81     local opts
82     use debug && opts="${opts} debug=1"
83     use mixer && opts="${opts} sdlmixer=1"
84     use x86 || opts="${opts} no_asm=1"
85     use opengl || opts="${opts} sdl_only=1"
86     use demo && opts="${opts} shareware=1"
87    
88     # From "scons -h"
89     # sharepath must end with a slash.
90     scons \
91     ${opts} \
92     sharepath="${dir}/" \
93     || die "scons failed"
94     }
95    
96     src_install() {
97     local icon="${PN}.xpm"
98     # Reasonable set of default options.
99     # Don't bother with ${DVX}.ini file.
100     local params="-gl_trilinear -gl_anisotropy 8.0 -gl_16bpp -gl_16bittextures -gl_reticle 2 -fullscreen -menu_gameres -nomovies -nocdrom"
101    
102     local exe=${PN}-sdl
103     use opengl && exe=${PN}-gl
104     newgamesbin ${exe} ${PN} || die "newgamesbin ${exe} failed"
105     games_make_wrapper ${PN}-common "${PN} ${params}"
106     doicon "${WORKDIR}/${icon}"
107     make_desktop_entry ${PN}-common "Descent ${DV} Rebirth" "${icon}"
108    
109     insinto "${dir}"
110     doins "${WORKDIR}"/*.{pcx,fnt} || die
111    
112     dodoc *.txt
113    
114     prepgamesdirs
115     }
116    
117     pkg_postinst() {
118     games_pkg_postinst
119    
120     if use demo ; then
121     elog "${PN} has been compiled specifically for the demo data."
122     else
123     elog "Place the DOS data files in ${dir}"
124     ewarn "Re-emerge with the 'demo' USE flag if this error is shown:"
125     ewarn " Error: Not enough strings in text file"
126     fi
127     elog "To play the game with common options, run: ${PN}-common"
128     echo
129     }

  ViewVC Help
Powered by ViewVC 1.1.20