Page 1 of 1

UFO-AI newere ebuilds / Portage refresh?

Posted: Mon Feb 05, 2007 12:02 pm
by NagaDrag
UFO AI ( www.ufoai.net )

great game, nice and free remake of the original UFO game

Problem is, the UFO-AI linux version in portage is only available for version 0.10

I am currently running version 2.0 RC6 under Window$, and I did not have much luck figuring out how the linux version installs

I downloaded the DATA FILES and the SOURCE file from sourceforge.

What im also confused on is : Windows install is over 200 MB, Linux is just about ~100MB

Would someone who figured it out either post an ebuild, add it to portage, or help me figure out how to compile it, and what I need

--NagaDrag

Posted: Mon Feb 05, 2007 12:32 pm
by PaulBredbury
It's currently distro-unfriendly because it's meant to be installed and run within ~, rather than /usr/whatever. It therefore requires some patches to the source code, to find & write files in the proper places. Here is my unfinished and broken ebuild, if it's of interest.

/usr/local/portage/games-strategy/ufo-ai/ufo-ai-2.0_rc6.ebuild

Code: Select all

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# Doesn't find the .so files

inherit eutils flag-o-matic toolchain-funcs games

MY_PV=${PV/_rc/-RC}
MY_P="ufoai-${MY_PV}"
MY_SF="mirror://sourceforge/ufoai"

DESCRIPTION="UFO: Alien Invasion - X-COM inspired strategy game"
HOMEPAGE="http://www.ufoai.net/"
SRC_URI="${MY_SF}/${MY_P}-source.tar.bz2
	${MY_SF}/base.tar.bz2
	${MY_SF}/hullbr3ach.tar.gz
	${MY_SF}/music.tar.bz2
	${MY_SF}/skins-phopue.tar.gz
	${MY_SF}/ufoai_dru_tex.zip"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="alsa arts debug dedicated dga ipv6 mmx nls oss paranoid tools"

# Info at http://ufo.myexp.de/wiki/index.php/Compile_for_Linux
# and http://ufo.myexp.de/wiki/index.php/Debian
RDEPEND=">=media-libs/libsdl-1.2
	>=media-libs/sdl-ttf-2
	virtual/opengl
	virtual/glu
	media-libs/jpeg
	media-libs/libvorbis
	media-libs/libogg
	nls? ( sys-devel/gettext )
	x11-libs/libXxf86dga
	x11-libs/libXxf86vm"
DEPEND="${RDEPEND}
	app-arch/unzip
	x11-proto/xextproto"

S=${WORKDIR}/${MY_P}-source
dir=${GAMES_DATADIR}/${PN}
libdir=${GAMES_LIBDIR}/${PN}

src_unpack() {
	unpack ${A}
	cd "${S}"

	rm -f docs/readme.solaris

	# Use shared directories
	sed -i \
		-e "s:\"basedir\", \".\":\"basedir\", \"${dir}\":" \
		-e "s:FS_AddGameDirectory(va(\"\%s/\" BASEDIRNAME, fs_basedir->string));:FS_AddGameDirectory(va(\"%s/\" BASEDIRNAME, fs_basedir->string));\n\tFS_AddGameDirectory(\"${libdir}\");:" \
		-e "s:FS_AddGameDirectory(va(\"\%s/\%s\", fs_basedir->string, dir));:FS_AddGameDirectory(va(\"\%s/\%s\", fs_basedir->string, dir));\n\tFS_AddGameDirectory(\"${libdir}\");:" \
		qcommon/files.c || die "sed files.c failed"
}

src_compile() {
	yesno() { useq $1 && echo yes || echo no ; }

	local target="release"
	use debug && target="debug"

	emake \
		BUILD_DEDICATED=$(yesno dedicated) \
		BUILD_ALSA=$(yesno alsa) \
		BUILD_OSS=$(yesno oss) \
		BUILD_ARTS=$(yesno arts) \
		HAVE_IPV6=$(yesno ipv6) \
		HAVE_GETTEXT=$(yesno nls) \
		BUILD_WITH_DGA=$(yesno dga) \
		BUILD_WITH_VIDMODE=$(yesno X) \
		BUILD_WITH_MMX=$(yesno mmx) \
		BUILD_PARANOID=$(yesno paranoid) \
		BUILD_COMPILETOOLS=$(yesno tools) \
		CC="$(tc-getCC)" \
		BUILD_RELEASE_DIR=release \
		BUILD_DEBUG_DIR=release \
		build_${target} || die "emake ${target} failed"
}

src_install() {
	exeinto "${libdir}"
	doexe release/*.so || die "doexe *.so failed"

	newgamesbin release/ufo ${PN}.bin || die "newgamesbin failed"
	games_make_wrapper ${PN}{,.bin} "${dir}"

	if use dedicated ; then
		newgamesbin release/ufoded ${PN}-ded.bin \
			|| die "newgamesbin ufoded failed"
		games_make_wrapper ${PN}-ded{,.bin} "${dir}"
	fi

	insinto "${dir}"
	doins -r "${WORKDIR}"/{base,exterior,hullbr3ach,interior,music,skins-phopue} \
		|| die "doins -r failed"

	dodoc docs/*

	prepgamesdirs
}

Posted: Tue Feb 06, 2007 10:08 am
by Sivert
It's svn is updated daily so there's no point in doing ebuild for it. Get it from svn to some dir and compile it.

Posted: Tue Feb 06, 2007 12:08 pm
by tboloo
I'm probably missing something trivial, but when I try to run ufo-ai I get :

Code: Select all

bolek@abt ~ $ ufo-ai
Adding game dir: /usr/share/games/ufo-ai/base
Adding game dir: /usr/games/lib/ufo-ai
using /home/bolek/.ufoai/base for writing
Adding game dir: /home/bolek/.ufoai/base
execing default.cfg
execing config.cfg
execing keys.cfg
Console initialized.

------- sound initialization -------
Loading snd_sdl sound driver
Load library failed: snd_sdl.so: cannot open shared object file: No such file or directory
------- Loading ref_glx.so -------
LoadLibrary("ref_glx.so"): can't open /etc/ufo.conf - setting search path to .
LoadLibrary("ref_glx.so") failed: ./ref_glx.so: cannot open shared object file: No such file or directory
Dumped console text to /home/bolek/.ufoai/base/gl_debug.txt.
recursive shutdown
Error: Couldn't initialize OpenGL renderer!
Consult gl_debug.txt for further information.
but

Code: Select all

bolek@abt ~ $ locate snd_sdl.so
/usr/games/lib/ufo-ai/snd_sdl.so
bolek@abt ~ $ locate ref_glx.so
/usr/games/lib/ufo-ai/ref_glx.so
and the output of gl_debug.txt is as follows

Code: Select all

 1 ------- sound initialization -------
 2 Loading snd_sdl sound driver
 3 Load library failed: snd_sdl.so: cannot open shared object file: No such file or
 4  directory
 5 ------- Loading ref_glx.so -------
 6 LoadLibrary("ref_glx.so"): can't open /etc/ufo.conf - setting search path to .
 7 LoadLibrary("ref_glx.so") failed: ./ref_glx.so: cannot open shared object file:
 8 No such file or directory
 9 Dumped console text to /home/bolek/.ufoai/base/gl_debug.txt.
.::EDIT::.
I placed snd_sdl.so in /usr/lib directory, changed permissions and the error that I get now is as follows

Code: Select all

bolek@abt ~ $ ufo-ai
Adding game dir: /usr/share/games/ufo-ai/base
Adding game dir: /usr/games/lib/ufo-ai
using /home/bolek/.ufoai/base for writing
Adding game dir: /home/bolek/.ufoai/base
execing default.cfg
execing config.cfg
execing keys.cfg
Console initialized.

------- sound initialization -------
Loading snd_sdl sound driver
Soundsystem: SDL.
SDL version: 1.2.11
SDL audio driver is "alsa".
Bits: 16
Frequency: 48000
Samples: 4096
Channels: 2
sound sampling rate: 48000
------- Loading ref_glx.so -------
LoadLibrary("ref_glx.so") failed: ./ref_glx.so: cannot open shared object file: No such file or directory
Dumped console text to /home/bolek/.ufoai/base/gl_debug.txt.
SDL audio device shut down.
recursive shutdown
Error: Couldn't initialize OpenGL renderer!
Consult gl_debug.txt for further information.

Posted: Sun Feb 11, 2007 3:47 pm
by tboloo
.::BUMP::.
Anyone ??
I've searched ufp-ai's forum, double-checked everything but the error persists ...