Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarf fortress on FreeBSD  (Read 5693 times)

M1cRO

  • Escaped Lunatic
    • View Profile
Dwarf fortress on FreeBSD
« on: August 07, 2011, 10:24:56 am »

Hi Toady One and All,

May be ported dwarf fortress also on FreeBSD 8,9 i386 && amd64?
I can help with it.
Logged

sockless

  • Bay Watcher
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #1 on: August 08, 2011, 12:00:40 am »

I take it that you aren't a native speaker of English?

I thought that you could run DF on FreeBSD, are you using 64-bit or 32-bit?
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

nogoodnames

  • Bay Watcher
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #2 on: August 08, 2011, 12:25:36 am »

Does the standard linux version not work for it?
Logged
Life is, in a word, volcanoes.
                        - Random human lord

M1cRO

  • Escaped Lunatic
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #3 on: August 08, 2011, 01:27:36 am »

to sockless: yup, no native speaker..

Linux version don't work for me, I use FreeBSD 9-HEAD amd64:
micro[10:25:04]> ./df
./libs/Dwarf_Fortress: error while loading shared libraries: libSDL-1.2.so.0: wrong ELF class: ELFCLASS64

on wine works, but so slowly...
Logged

dzha

  • Bay Watcher
    • View Profile
    • shff
Re: Dwarf fortress on FreeBSD
« Reply #4 on: August 08, 2011, 02:41:48 am »

to sockless: yup, no native speaker..

Linux version don't work for me, I use FreeBSD 9-HEAD amd64:
micro[10:25:04]> ./df
./libs/Dwarf_Fortress: error while loading shared libraries: libSDL-1.2.so.0: wrong ELF class: ELFCLASS64

on wine works, but so slowly...

The Linux emulation on FreeBSD does not have the necessary libraries,
maybe its possible to run it, but i have not been able to do it.

That is why i use Wine to emulate a windows environment, but it slows
the PC down so much that you can't really play it.

The frame rate is too low.

I would really appreciate it if there would be a native BSD version of DF.
« Last Edit: August 08, 2011, 02:44:00 am by dzha »
Logged
shff.wordpress.com

M1cRO

  • Escaped Lunatic
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #5 on: August 09, 2011, 01:11:10 am »

up
Logged

Dae

  • Bay Watcher
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #6 on: August 09, 2011, 07:06:41 am »

Have you considered compiling the libSDL.so for FreeBSD instead of asking for a port ? I don't know if the linux version of DF will do ultimately, but it seems your problem here is just with the SDL library shipped with DF.
Logged

dzha

  • Bay Watcher
    • View Profile
    • shff
Re: Dwarf fortress on FreeBSD
« Reply #7 on: August 11, 2011, 04:59:48 am »

Have you considered compiling the libSDL.so for FreeBSD instead of asking for a port ? I don't know if the linux version of DF will do ultimately, but it seems your problem here is just with the SDL library shipped with DF.
Nope, that does not help too.
You get some other missing things.
At the end of it you need to manually get a gazillion of things and it still does not work.
Logged
shff.wordpress.com

lordnincompoop

  • Bay Watcher
  • Allusionist
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #8 on: August 11, 2011, 05:20:52 am »

I'm not really sure how much work a port needs, but I assume it's quite a bit - and it'd be for an incredibly niche operating system. I don't it's likely you'll see a BSD port from Toady any time soon.

As for you doing it yourself, he's repeatedly stated that he doesn't want to have anyone help him out with anything (besides Baughn's SDL, that is), so that would be even less likely.

Your best bet would be to either run it through Wine like you did before, or try to track down and install the missing library.

Finding the library itself shouldn't be too hard, seeing as you already know it's libSDL-1.2 .
Logged

djn

  • Escaped Lunatic
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #9 on: September 07, 2011, 07:49:39 am »

I got it to work (minus sound) on 8.2 64-bit right now. Basically, you need to install a list of ports, and copy the included libraries to /compat/linux/usr/lib . Something like this (assuming you have security/sudo and ports-mgmt/portmaster installed):
Code: [Select]
sudo portmaster -Bd linux-f10-alsa-lib linux-f10-atk linux-f10-cairo linux-f10-expat linux-f10-fontconfig linux-f10-gtk2 linux-f10-jpeg linux-f10-pango linux-f10-png linux-f10-sdl linux-f10-sdl_image linux-f10-tiff linux-f10-xorg-libs linux-sdl_ttf linux_base-f10 linux_dri
cd dwarf_fortress_directory
sudo cp libs/lib* /compat/linux/usr/lib/
If you use the binary nvidia driver, I think you can/should? skip linux_dri in the above list ... test and see, really.

As for ports: Porting it in the classic sense should be very easy: In the best case the only thing needed would be to change some include paths for the libraries used. There might be some fun with ALSA (FreeBSD uses OSS natively), though using the SDL sound libraries would fix that, or I think there is a beta-quality userland ALSA-for-FreeBSD thing available.

Porting in the FreeBSD sense shouldn't be too hard; it would basically be a case of setting the above dependencies (and whatever else I've forgotten because I've already got it installed), and probably installing it to the usual locations (bin, lib, etc) within /compat/linux/usr/local (though I guess we could just dump it in local/dwarf_fortress/ ).
(A FreeBSD port is a few text files with the info needed to download, extract, compile if needed, install and uninstall something.)
« Last Edit: September 07, 2011, 08:03:52 am by djn »
Logged

h0x

  • Escaped Lunatic
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #10 on: February 20, 2012, 06:31:46 am »

While the mentioned solution works it's just an ugly hack requiring linux emulation. Dwarf fortress should work natively on freebsd, all that is required is for someone to modify the makefile and build it on a freebsd machine. And freebsd isn't more "extremely niche" than linux. I understand you do not wish to release the source code but building it for 64-bit linux and 32/64-bit freebsd is not rocket science.
Logged

tgwbhe

  • Escaped Lunatic
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #11 on: July 23, 2012, 06:00:25 pm »

I can confirm that djn's method works on FreeBSD 8.2.
The only difference for me was specifying some ports relative path, so here is what worked for me when installing ports:
Code: [Select]
portmaster linux_base-f10 \
graphics/linux-f10-jpeg \
graphics/linux-f10-png \
devel/linux-f10-sdl12 \
graphics/linux-f10-sdl_image \
graphics/linux-f10-tiff \
graphics/linux-sdl_ttf \
graphics/linux_dri \
audio/linux-f10-alsa-lib \
linux-f10-atk \
linux-f10-cairo \
linux-f10-expat \
linux-f10-fontconfig \
linux-f10-gtk2 \
linux-f10-pango \
linux-f10-xorg-libs \

Thanks djn for sharing your results, it helped me a lot.

Would be great to see a more native way of course.
« Last Edit: July 23, 2012, 06:03:11 pm by tgwbhe »
Logged

Nopenope

  • Bay Watcher
    • View Profile
Re: Dwarf fortress on FreeBSD
« Reply #12 on: November 22, 2014, 12:45:57 pm »

I'll take the liberty of necroing this thread for the sake of a friend of mine who uses FreeBSD 10 and wishes to run DF on it. Using all the ugly hacks above it does run, with two caveats:
-There's no sound, because libopenal and libsndfile haven't got any ports for *BSD.
-DFHack doesn't build.
If anyone has had any experience of trying to run things on FreeBSD, could they share it in this thread?
Logged