Gentoo Forums
Gentoo Forums
Quick Search: in
UFO-AI newere ebuilds / Portage refresh?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
NagaDrag
Tux's lil' helper
Tux's lil' helper


Joined: 09 Dec 2006
Posts: 88

PostPosted: Mon Feb 05, 2007 12:02 pm    Post subject: UFO-AI newere ebuilds / Portage refresh? Reply with quote

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
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 6506

PostPosted: Mon Feb 05, 2007 12:32 pm    Post subject: Reply with quote

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:
# 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
}
Back to top
View user's profile Send private message
Sivert
n00b
n00b


Joined: 24 Aug 2005
Posts: 14

PostPosted: Tue Feb 06, 2007 10:08 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
tboloo
Guru
Guru


Joined: 20 Jan 2006
Posts: 403
Location: Grodzisq, Poland

PostPosted: Tue Feb 06, 2007 12:08 pm    Post subject: Reply with quote

I'm probably missing something trivial, but when I try to run ufo-ai I get :
Code:

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:

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:

 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:

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.

_________________
The clock is ticking, brothers and sisters, counting down to Armageddon.
Back to top
View user's profile Send private message
tboloo
Guru
Guru


Joined: 20 Jan 2006
Posts: 403
Location: Grodzisq, Poland

PostPosted: Sun Feb 11, 2007 3:47 pm    Post subject: Reply with quote

.::BUMP::.
Anyone ??
I've searched ufp-ai's forum, double-checked everything but the error persists ...
_________________
The clock is ticking, brothers and sisters, counting down to Armageddon.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum