gentoo

ToME4 on Gentoo

Gentoo supports recent ToME4 betas out of the box. (You lucky Portage-toting stiff, you.)

Preparation

While optional, preparing your system to receive the will of Maj'Eyal may help in warding off fatal runtime errors post-installation. "Segmentation fault", this is how you die!

  • ToME4 and transitive dependencies thereof (e.g., SDL 2.0) require an estimated 400MB with official soundtrack and 200MB without. In either case, ensure you have sufficient disk space.
  • Consider reducing CFLAGS, CPPFLAGS, CXXFLAGS, and LDFLAGS optimizations. While "fun" (in the sense of irrecoverably breaking your system), extreme optimizations tend to harm the stability and performance of ToME4, SDL 2.0, and friends. This author currently runs ToME4 stably under:

CFLAGS="-march=native -O2 -pipe"

  • Consider updating all previously installed packages to their newest and hopefully stablest versions. That is, update world.
    • Synchronize the Portage tree. If using eix (...which, of course, you do):

eix-sync

    • Otherwise:

emerge --sync

    • Update everything, including (and most importantly) the kitchen sink.

emerge -uDNav world

Installation

Unofficial overlay raiagent currently hosts the most recent ToME4 ebuilds. Full installation under default USE flags takes roughly an hour and 400MB of free space. Your mileage may vary. ("On with the dreary show, you rogue!")

emerge -av layman gentoolkit

  • (Optional.) Describe all USE flags supported by SDL 2.0 and related libraries.

equery uses libsdl sdl-image sdl-ttf tome4

  • (Optional.) Enable SDL 2.0-specific USE flags. We recommend enabling at least "xinput" and "xrandr", currently not enabled by default.

echo "media-libs/libsdl xinput xrandr" >> /etc/portage/package.use

  • (Optional.) Enable ToME4-specific USE flags. By default, ToME4 installs an officially heart-rending soundtrack. (No, really: it rends hearts.) Preventing this saves about 200MB on download and installation at the cost of the Blood God Shibboleth vengefully mauling a baby kitten.

echo "games-roguelike/tome4 -music" >> /etc/portage/package.use

layman -a raiagent gamerlay

  • If you just installed layman above, notify Portage of its installation. (Yes, do this only after adding your first overlay.)

echo "source /var/lib/layman/make.conf" >> /etc/make.conf

  • Synchronize the latest SDL and ToME4 ebuilds.

layman -S

  • Unmask ToME4 and friends.

echo ">=media-libs/libsdl-2.0.0_pre7024\n~media-libs/sdl-image-9999\n~media-libs/sdl-ttf-9999\n>=games-roguelike/tome4-1.0.3" >> /etc/portage/package.accept_keywords

  • Install the latest stable ToME4 beta. This is it, man.

emerge -av tome4

FAQ

Are There Any Other Versions?

Why, yes! raiagent retains a number of older betas and (occasionally) unstable newer betas. To list either:

  • Install eix, a highly efficient Portage tree search engine.

emerge -av eix

  • Update the eix cache.

eix-update

  • List all available ToME4 versions.

eix tome4

To install older versions -- say, ToME4 beta 40:

echo ">=games-roguelike/tome4-1.0.0_beta41" >> /etc/portage/package.mask
emerge -av tome4

To install unstable newer versions -- say, ToME4 beta 69666 [note: may not exist as of this writing]:

echo "=games-roguelike/tome4-1.0.0_beta69666" >> /etc/portage/package.unmask
emerge -av tome4

Satisfy your craving for antiquity or feed the need for cutting-edge pain. The unadvisable choice is yours.

Why Doesn't It Work?

Did you meticulously follow with OCD-like obsession (and/or plodding apathy) the instructions in both Preparation and Installation? Yes, everything? Including the incantatory canticle to Blaarg Junior, the Wretched Baal Spawn of Hatemon-du, as enscribed by Cantos XXX, Section DEADBEEF, Subsection FEEDFACE?

Thought you'd miss that one.

It Still Doesn't Work.

Try installing an older stable version or newer unstable version. For obvious reasons, we recommend the former first.

It Still Still Doesn't Work.

Alas, my wee lass. You may have hit the last of its kind: a vanishingly rare ToME4 bug. (Don't look at the Bugs forum.)

You needn't panic. We have top men working on it now. (Top. Men.) And you can help. So what's the nature of your issue?

"Segmentation fault" (Is That Good?)

No, it's terrible.

We need you to post a "gdb" backtrace to the Bugs forum. If you've never produced a backtrace before, this will be a bit of a process. But we know you're up to it, despite the tedious and largely unfulfilling nature of this task.

  • Enable core dumps in your kernel configuration (General Setup ---> Configure standard kernel features ---> Enable ELF core dumps).

cd /usr/src/linux; make menuconfig

  • Recompile your kernel.

make && make modules_install

  • Do whatever it is you people do to install the resulting kernel image to your bootloader: e.g.,

mount /boot; cp arch/x86/boot/bzImage /boot/kernel-3.14.15

  • Reset. Still working? Greaaat.
  • Add "-ggdb" to CFLAGS in "/etc/make.conf" to enable gdb backtracing.

CFLAGS="-march=k8-sse3 -O2 -ggdb"

  • Add "splitdebug" to FEATURES in "/etc/make.conf" to disable gcc stripping.

FEATURES="candy ccache multilib-strict strict splitdebug"

  • Ensure the "debug" USE flag is not enabled in "/etc/make.conf". (You should either have "-debug" or no "debug" at all.)
  • Recompile ToME4... and all packages ToME4 transitively depends on. Got popcorn? Good. You'll need that popcorn. Like you never have before.

emerge -aev tome4

  • Congratulations! You can now coerce ToME4 into excreting core dumps. It's not as fun as actually playing ToME4... but it's something.
  • Temporarily enable core dumps for this shell session.

ulimit -c unlimited

  • Run ToME4 before ToME4 runs you.

cd /usr/share/tome4; ./t-engine

  • Log a backtrace of the inevitable core dump to "crash.txt", replacing "whatever-the-bloody-core-dump-is-called" with the core dump's filename.

gdb t-engine --core "whatever-the-bloody-core-dump-is-called" --batch --quiet -ex "thread apply all bt full" -ex "quit" > crash.txt

For further inquiries, see How to Get Meaningful Backtraces in Gentoo.

Something Else Is Happening.

Assuming it's not holding a rusty knife to your throat (...we really can't help; sorry), see Discussion.

Discussion

See Behold! A Gentoo Ebuild: The Time Is at Hand for further excavations into depravity and the build files from whence it burbles.