You are not logged in.

#1 2009-01-02 06:17:45

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Help On: Dwarf Fortress!

There is a great ASCII art based game for Windows called Dwarf Fortress.  Apparently, recently they have/are porting it to Linux.  Unfortunately, or as far as I can tell, it isn't completely open-sourced yet.  However, the big problem is that it is only made to be run from it's own little directory.  I was hoping to change that for us Arch Users, so here is where I am.

I have the PKGBUILD, a replacement shell-script, and a .install file.  I am using the .install file to mainly refresh the icon cache, as I want to create a nice little menu entry in Gnome and KDE for everyone smile.

Forum thread that I am watching for info: LINK

PKGBUILD:

pkgname=dwarf-fortress
pkgver=0.28.181.40d6
pkgrel=1
pkgdesc="Dwarf Fortress is a single-player fantasy game. You can control a dwarven outpost or an adventurer in a randomly generated, persistent world.  Although Dwarf Fortress is still in a work in progress, many features have already been implemented."
arch=('i686')
url="http://www.bay12games.com/dwarves/"
license=('GPL')
groups=()
depends=('gtk2' 'sdl' 'sdl_image' 'libgl' 'fmodex' 'gcc-libs')
makedepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=dwarf-fortress.install
source=( $(echo ${url}df_$(sed 's/\<0.//' <(echo "$pkgver" | tr . _ ) )_linux.tar.bz2) )
noextract=()
md5sums=('d210c92a73f136dcd4d48dd3286f9a7a')

build() {
  install -D -m755 ${startdir}/dwarf-fortress ${pkgdir}/usr/bin/dwarf-fortress

  cd ${srcdir}/df_linux
    install -D -m644 ./sdl/sdl\ license.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
  
  cp -a ${srcdir}/df_linux ${pkgdir}/usr/share/${pkgname}
  
  cd ${pkgdir}/usr/share/${pkgname}
    rm -R ./libs ./df ./sdl
    
    chmod -R a+rw *
    chmod -R a+w ./data/save
    
    find ./ -type d -exec chmod 755 {} \;
    chmod 755 ./dwarfort.exe ./data/index
}

# vim:set ts=2 sw=2 et:

replacement shortcut ("dwarf-fortress"):

#!/bin/sh
export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
export SDL_VIDEO_CENTERED=1 # Centre the screen.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/lib" # Update library search path.
cd /usr/share/dwarf-fortress # Arch Packager: I added this in because DF spits out a "data/art/curses.png not found" error if working directory isn't where the resources are
/usr/share/dwarf-fortress/dwarfort.exe $* # Go, go, go! :)

dwarf-fortress.install:

pkgname=dwarf-fortress

post_install() {
  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  update-desktop-database -q
}

post_upgrade() {
  post_install $1
}

post_remove() {
  post_install $1
}

As of right now, I get this as an error:
Main index file missing/corrupted.  The file "index" must be in the "data" folder.  Make sure DF decompressed into its folders properly.

Any helpful insight is appreciated!

Last edited by Bionic Apple (2009-01-02 06:18:29)

Offline

#2 2009-01-02 14:51:37

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Help On: Dwarf Fortress!

Main index file missing/corrupted.  The file "index" must be in the "data" folder.  Make sure DF decompressed into its folders properly.

You should make all files and dirs world writable. It needs the dirs and there are quite a few config files, and moddable things in raws/

I'm a bit worried about losing such settings when upgrading. What happens to init.txt, does pacman put any new one in a .pacnew or do you need to specifically set it as that?

Offline

#3 2009-01-04 05:39:01

Bionic Apple
Member
Registered: 2008-08-05
Posts: 59

Re: Help On: Dwarf Fortress!

I don't know, but there should be a blacklist function somewhere...

Anyway, I did some more tests, and nil.  I used the latest version and nothing.  I also linked to the "df" script in the /usr/share/... folder using my replacement shortcut, but that had no effect.  Also, I made everthing world writable and then made everthing executable, too.  Nada.  However, the strangest thing is that even if I don't delete any files and copy pretty much everything from the source directory to /usr/share/dwarf-fortress, give everything full permissions, and execute the vanilla "df" script with /usr/share/dwarf-fortress as the working directory, it still gives me the same error.  I do not believe I had this problem before.  So, I must of did something wrong in the installation that Dwarf Fortress didn't like.

Offline

#4 2009-01-04 05:51:34

djnm
Member
From: USA
Registered: 2008-12-21
Posts: 78

Re: Help On: Dwarf Fortress!

Already done: http://aur.archlinux.org/packages.php?ID=22795
This is the only way I got it to work... I tried it every other way, but it needs to be executed from within its own folder, and everything has to be together. No splitting into /usr/share and /usr/bin.  Everything goes into /usr/bin/df_linux with /usr/bin/dwarffortress.sh launching it.

Last edited by djnm (2009-01-04 05:56:10)


br0tat0chip in #archlinux and on freenode

Offline

#5 2009-01-04 14:24:42

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Help On: Dwarf Fortress!

/usr/bin/dwarf-fortress cd's to the right directory so splitting it up is alright.

For me the install from this PKGBUILD worked when I did chmod -R 777 /usr/share/dwarf-fortress, which is exactly what djnm does too.

Offline

#6 2009-02-20 14:29:33

syntaxvorlon
Member
Registered: 2008-08-13
Posts: 62

Re: Help On: Dwarf Fortress!

Have any 64-bit users been able to get this package working?

Oh and a suggestion with respect to previous messages:
Why not make the main config file a link a file named .dfconfig or .dfrc in the home dir?

Last edited by syntaxvorlon (2009-02-21 01:11:03)

Offline

#7 2010-10-14 12:21:42

dkorzhevin
Member
From: Kiev, Ukraine
Registered: 2010-04-23
Posts: 61

Re: Help On: Dwarf Fortress!

Hello,

I have installed dwarffortress version 0.31.16 and have this error when trying to start game:

Main index file missing/corrupted.  The file "index" must be in the "data" folder.  Make sure DF decompressed into its folders properly.

Offline

#8 2010-10-14 12:45:32

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Help On: Dwarf Fortress!

This topic is over a year old, and the problem it discusses is totally unrelated to yours - two excellent reasons for you not to post in it.

For the first reason, read http://wiki.archlinux.org/index.php/For … Bumping.27.

Open a new topic. Leave the dead alone.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB