Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4

Author Topic: [linux] Install script  (Read 12481 times)

adanos

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #15 on: March 14, 2014, 01:44:49 pm »

I am a bit overwhelmed right now :P

Code: [Select]
Unicorn% ldd hack/libdfhack-client.so
linux-gate.so.1 =>  (0xf7784000)
libprotobuf-lite.so => not found
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf76e2000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf76cb000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf75e6000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf75ba000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf759c000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73f2000)
/lib/ld-linux.so.2 (0xf7785000)
Unicorn% grep LD_LIB -i dfhack
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack"

Code: [Select]
grep LD_PRELOAD -riI does not respond.

Anyway, I not sure how to use these defined ,,things'' [LD_PRELOAD, LD_LIB]. Google says its kind of path. Maybe hardcoded variable for debugging..
..
And right, I just noticed that there is issue with mine DwarfTherapist and pnglib [When I am downloading from both sources; http://dffd.wimbli.com/download.php?id=5315&f=MasterworkDF+V4i.7z or by git clone https://github.com/splintermind/masterwork-dwarf-fortress.git error appears]

Code: [Select]
Unicorn% ./DwarfTherapist
bin/release/DwarfTherapist: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory

But it is not a problem.. I'd like just to run Masterwork with linked dfhack.. and then I can simply use built-in profession's editor
« Last Edit: March 14, 2014, 01:48:15 pm by adanos »
Logged

yaymeh

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #16 on: March 14, 2014, 02:15:04 pm »

Code: [Select]
grep LD_PRELOAD -riI does not respond.
Whoops... that was the brute force one, you probably got lots more files in your directory than I would have guessed  :D

Anyway, it looks like everything should work. If you still get the same error message, you should probably ask about it wherever your flavor of linux is maintained - or you can try the dfhack threat.
Logged

jcd

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #17 on: March 16, 2014, 07:43:14 am »

umm, while having an easy way to install MWDF in linux is nice, the wine performance drop is substantial i'm afraid. (at least in my own machines)

tried with 2 different old-ish pc's (just used the 'normal' MWDFv.4i .zip, same savegame, 3x3 embark with river, near the end of the first year) through a properly configured wine.

results:
laptop, amd E2 1,65GHz, 4Gb Ram, arch linux, wine: ~14 fps
laptop, amd E2 1,65GHz, 4Gb Ram, windows 7: ~26 fps

desktop, Core 2 Duo 2.4GHz, 4Gb Ram, arch linux, wine: ~24 fps
desktop, Core 2 Duo 2.4GHz, 4Gb Ram, windows 7: ~45-50 fps

plus, one needs to also run therapist via wine, since the linux therapist will not access the wine-DF.

--
conclusion: makes no sense running MWDF through wine if you have access to a host windows OS, unless using a very powerful machine so that fps become irrelevant.

what i would really like, would be a way to port MWDF to the linux version of DF.
as for the MW gui control, i don't mind running one via wine, or in any other way possible, like console version, or just manipulating a .config file, that is then used by a script that will apply the options.

i guess, the easiest way for this to happen 'd be me to do it, but i'm afraid i don't have the time..
« Last Edit: March 16, 2014, 07:44:52 am by jcd »
Logged

yaymeh

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #18 on: March 16, 2014, 07:51:23 am »

Uhm... what? That's sort of the point of this script - installing MW so it runs with native DF + Therapist etc on linux.

The only thing that needs wine is the configuration utility.

edit: now I'm confused :3
« Last Edit: March 16, 2014, 07:56:02 am by yaymeh »
Logged

jcd

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #19 on: March 16, 2014, 08:06:11 am »

no you are quite sane.  ;)
it was me that i was confused, since i just skimmed the thread and i saw about wine being needed.
i take it all back, you are awesome and i will be following and trying this.  :)

=====

EDIT

tested and works for me.
at least it worked when i decided to remember to run it in zsh.

dwarf therapist works if run with sudo, but not otherwise. that is fine though.

fps for the laptop on linux are about the same as with windows 7.
i call that a win!
thx a lot!!
« Last Edit: March 16, 2014, 12:00:42 pm by jcd »
Logged

Thelo

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #20 on: March 26, 2014, 02:02:00 pm »

Any chance of making the script bash compatible or at least giving instructions for doing it? I use Mint 16, which is based on Ubuntu, and my knowledge of Linux is not enough to do it myself, and I have to admit that I die for having Masterwork Dwarf Fortress running! :)
Logged

jcd

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #21 on: March 27, 2014, 12:58:10 am »

it is not very hard, since the script is more or less complete:

1. try saving this text to a file:
Code: [Select]
#!/bin/zsh
### Might not work in bash. Will definitely not work in sh.
#### to be more precise: Everything except the language patch should work in bash.

# try to guess if the user moved the script to a nice custom install dir - otherwise use default $HOME/DF_Masterwork
echo $PWD | grep -qi "master\fortress\|DF\|dwarf" && installdir=$PWD || installdir="$HOME/DF_Masterwork";

# warn
{ echo "Installing DF to: $installdir \n ctrl+c to abort, ENTER to continue."; read nope; }

cp -v "$0" "$installdir/install_DF_Masterwork"

## only 64bit atm
[[ $(uname -m) == "x86_64" ]] || { echo "There is no precompiled 32-bit version of bundled libraries and Therapist available at the moment - only wine/windows version of DF might work \n ctrl+c to abort, ENTER to continue anyways."; read nope; }

## *sigh* using archlinux package instead of official download now because it works better... uhm... on archlinux at least, that is :D if someone knows a better alternative please post it
# 'http://www.bay12games.com/dwarves/df_34_11_linux.tar.bz2'
## Using splintermind's git instead of 'http://dffd.wimbli.com/download.php?id=5315&f=MasterworkDF+V4i.7z' for bugfixes
downloads=(
'https://dl.dropboxusercontent.com/u/60111839/template.lng'
'http://dffd.wimbli.com/download.php?id=8067&f=dfhack-0.34.11-r4-Linux.7z'
'http://mirror.selfnet.de/archlinux/multilib/os/x86_64/dwarffortress-0.34.11-4-x86_64.pkg.tar.xz'
'http://dffd.wimbli.com/download.php?id=8462&f=Dwarf-Therapist-linux-x86_64-git-20140305-2.7z');
# this one seems to be obsolete / segfauly: 'https://dl.dropboxusercontent.com/u/60111839/game_data.ini'
# masterword df subdirectory
masterpath='masterwork-dwarf-fortress'

# check if exists || create new
[ -d  "$installdir" ] || mkdir "$installdir"
cd $installdir || exit 0

# check if we have all libraries installed & complain
for dependancy in libgail libgailutil libgdk-x11-2.0 libGLU libSDL_image-1.2 libSDL_image-1.2 libsndfile libopenal;
do
ldconfig -p | grep -q $dependancy || { echo "you might need to install a package that provides the library $dependancy \n ctrl+c to abort, ENTER to continue anyways."; read nope; }
done;

# check if we have all programs installed & complain/quit
for dependancy in wget wine winetricks unzip zsh tar 7z dos2unix git;
do
which "$dependancy" || { echo "please install $dependancy, p.e.: 'sudo apt-get install $dependancy'"; exit 1; }
done;

#get and extract downloads
for download in $downloads
do
filename=$(basename "$download");
[ -f $filename ] || wget "$download";
case $filename in
(*.tar.bz2) tar xvjf "$filename" ;;
(*.pkg.tar.xz) tar xf "$filename" ;;
(*.zip) unzip "$filename" ;;
(*.7z) 7z x $filename ;;
esac

# get DF from git...
[ -d $masterpath ] || git clone https://github.com/splintermind/masterwork-dwarf-fortress.git
## ... or update
cd $masterpath || { echo "WTF!? can't cd into $masterpath"; exit 1; }
git pull || { echo "git pull failed in $masterpath"; exit 1; }
## THROW AWAY ALL CHANGES
git reset --hard
# hey, I don't know how git works, better do that one again :P
git pull || { echo "git pull failed in $masterpath"; exit 1; }
cd $installdir


done;

# "unfuck" (see link) the linux download a little bit. Would probably be better to do the whole https://github.com/svenstaro/dwarf_fortress_unfuck thing but... eeeh... uhm... NOPE.
## This was a baaaaaad idea :D
## Using mysterious fixed libgraphics.so instead :3 now if only I know where I got that -.- oh, it was from /opt. Thx, archlinux :D
#IFS=$(echo -en "\n\b"); for file in $(grep -l "\.png" df_linux -ri | sort -u); do sed -i 's/\.png/.bmp/g' "$file"; done;

unset IFS;

# eeeeh... I give up. Leave it like that. :P now let's <just take the archlinux package and> make a mess
# old raws need to go though. Also some configs etc.
rm opt/df_linux/raw opt/df_linux/data  -r
cp -v opt/df_linux/* ./$masterpath/Dwarf\ Fortress/ -r

#patch language  in DF binary (masterworks skills etc)
echo "\n\nPATCHING LANGUAGE... this could take a while..."
IFS=$(echo -en "\n\b"); for line in $(cat template.lng | tr -d "\r" | grep "|.*|.*|" | grep -v "box\|Tanner\|Cof"); do echo "$line" | IFS="|" read nope from to nope; to="${(r:${#from}:: :)${to[1,${#from}]}}"; [ "$from" != "$to" ] && { echo -n "#$from#=>#$to# //// "; sed -i "s|$from|$to|g" "./$masterpath/Dwarf Fortress/libs/Dwarf_Fortress";} done;

# and there goes dfhack...
cp -v dfhack-0.34.11-r4-Linux/* "$masterpath/Dwarf Fortress/" -r
chmod -v +x "./$masterpath/Dwarf Fortress/dfhack"

# shitty bundled version ruins everything, where did that even come from again?
#rm -v "./$masterpath/Dwarf Fortress/libs/libstdc++.so.6"
#It came from the official DF linux release, now using archlinux package ;)

md5=$(md5sum "./$masterpath/Dwarf Fortress/libs/Dwarf_Fortress" | sed "s/ .*//")

#patch new df binary md5sum into dfhack symbols.xml
sed -i "s#<md5-hash value='c55e1718c93247e702b35108c8d90e69'/>#\0\n<md5-hash value='$md5'/>#" "./$masterpath/Dwarf Fortress/hack/symbols.xml"

# wine stuff
export WINEARCH=win32
export WINEPREFIX=$installdir/.wine_df
winetricks -q dotnet40 corefonts

# therapist / patch checksum + stuff
new_weird_checksum_for_therapist="0x${md5:0:8}"
sed -i "s/0xe966ee88/$new_weird_checksum_for_therapist/g" Dwarf-Therapist/etc/memory_layouts/linux/v034.11.ini
cp -v "./$masterpath/MasterworkDwarfFortress/Utilities/DwarfTherapist/etc/game_data.ini" "./Dwarf-Therapist/etc"
cp -v "./$masterpath/MasterworkDwarfFortress/Utilities/DwarfTherapist/etc/default_gridviews.dtg" "./Dwarf-Therapist/etc/default_gridviews.dtg"

# configuration need desktop icon or something.
echo "
[Desktop Entry]
Name=DF Masterwork configuration (wine)
Exec=env WINEPREFIX=\"$installdir/.wine_df\" wine explorer /desktop=DFMWconfig,$(xrandr -q | grep "*" | sed "s/ *\([^ ]*\) .*/\1/") \"$installdir/$masterpath/Masterwork Dwarf Fortress.exe\"
Type=Application
StartupNotify=true
Path=$installdir/$masterpath
Icon=WHAT_I_DONT_HAVE_AN_ICON_GET_YOUR_OWN_ICON
" >| ~/Desktop/dfMasterwork_config.desktop

# df needs desktop icon or something too.
echo "
[Desktop Entry]
Name=DF Masterwork (native DFhack)
Exec=\'$installdir/$masterpath/Dwarf Fortress/dfhack\'
Type=Application
StartupNotify=false
Path=$installdir/$masterpath
Icon=WHAT_I_DONT_HAVE_AN_ICON_GET_YOUR_OWN_ICON
Terminal=true
" >| ~/Desktop/dfMasterwork_native.desktop

# therapist needs desktop icon or something too too.
echo "
[Desktop Entry]
Name=Dwarf Therapist (native, Splintermind Branch)
Exec=\'$installdir/Dwarf-Therapist/DwarfTherapist\'
Type=Application
StartupNotify=false
Path=$installdir/Dwarf-Therapist
Icon=WHAT_I_DONT_HAVE_AN_ICON_GET_YOUR_OWN_ICON
Terminal=false
" >| ~/Desktop/dfMasterwork_Therapist_native.desktop

# soundsense needs desktop icon or something too too too.
echo "
[Desktop Entry]
Name=Soundsense (native)
Exec=\'$installdir/$masterpath/MasterworkDwarfFortress/Utilities/soundSense/soundSense.sh\'
Type=Application
StartupNotify=false
Path=$installdir/Dwarf-Therapist
Icon=WHAT_I_DONT_HAVE_AN_ICON_GET_YOUR_OWN_ICON
Terminal=true
" >| ~/Desktop/dfMasterwork_SOUNDSENSE.desktop

# change some default settings
## fullscreen makes your window manager sad.
sed -i "s/\[WINDOWED:NO\]/\[WINDOWED:YES\]/" "$masterpath/Dwarf Fortress/data/init/init.txt"
## truetype crashes in build menu etc
sed -i "s/\[TRUETYPE:YES\]/\[TRUETYPE:NO\]/" "$masterpath/Dwarf Fortress/data/init/init.txt"

##### This seems to have been fixed upstream, don't need those any more:
#### my mousewheel zoom was broken, this did help.
###echo "32a33,34                                                               
###> [SYM:0:Leftbracket]
###> [BUTTON:0:5]
###33a36,37
###> [SYM:0:Rightbracket]
###> [BUTTON:0:4]
###" | patch $masterpath/Dwarf\ Fortress/data/init/interface.txt

# soundsense start script is broken
dos2unix $installdir/$masterpath/MasterworkDwarfFortress/Utilities/soundSense/soundSense.sh
chmod +x $installdir/$masterpath/MasterworkDwarfFortress/Utilities/soundSense/soundSense.sh

# Therapist needs ptrace
grep -q 1 /proc/sys/kernel/yama/ptrace_scope || { echo "\n\n\nGlobal Ptrace Scope is currently set to 1. To run therapist, you need to 'sudo setcap cap_sys_ptrace=eip Dwarf-Therapist/bin/release/DwarfTherapist' (or run it as root) \n Trying now:" && sudo setcap cap_sys_ptrace=eip Dwarf-Therapist/bin/release/DwarfTherapist }

2. preferably put the script to a custom install folder and with a custom name (eg. at ~/MWDF/mw_script.zsh)

3. install zsh (for your system it should be something like: apt-get install zsh), or do it with the software manager.

4. once zsh is installed and in your $PATH, go the the script's folder and in a terminal run: zsh mw_script.zsh

5. this should create the proper shortcuts at the desktop to run everything.

for me though:
i. to run DwarfTherapist i go to its proper folder and run it with: sudo ./DwarfTherapist
ii. the whole wine prefix jazz didn't work for me, so i did: rm -Rf /path/to/mwdf main folder/.wine_df to delete the custom wine prefix,
and then i run the exe with: wine ~/games/DF_Masterwork/masterwork-dwarf-fortress/Masterwork Dwarf Fortress.exe
(since i installed mwdf to ~/games/DF_Masterwork)

for the last to work though, you have to create a 32bit wine prefix, and then with winetricks i installed corefonts, dotnet30, dotnet35, dotnet40 for that prefix

but tbh, the script installs dotnet40 to the .wine_df prefix, so it *should* work as is.
Logged

yaymeh

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #22 on: March 27, 2014, 02:31:21 am »

The line that doesn't work in bash is this one:
( language patch )
Code: [Select]
IFS=$(echo -en "\n\b"); for line in $(cat template.lng | tr -d "\r" | grep "|.*|.*|"); do echo "$line" | IFS="|" read nope from to nope; to="${(r:${#from}:: :)${to[1,${#from}]}}"; [ "$from" != "$to" ] && { echo "#$from#=>#$to#"; sed -i "s|$from|$to|g" masterwork-dwarf-fortress-beta/Dwarf\ Fortress/libs/Dwarf_Fortress;} done;
To make it work in bash, this would probably need to be done with printf and xargs or something instead of the variable expansions. Someone who's used to working with those two on a regular basis should probably be able to rewrite it in a couple of minutes. All I managed when I tried was to break the DF binary ;) - never had much luck using xargs for anything other than getting rid of newlines.
Logged

greycat

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #23 on: June 05, 2014, 11:42:26 am »

The line that doesn't work in bash is this one:
Code: [Select]
IFS=$(echo -en "\n\b"); for line in $(cat template.lng | tr -d "\r" | grep "|.*|.*|"); do echo "$line" | IFS="|" read nope from to nope; to="${(r:${#from}:: :)${to[1,${#from}]}}"; [ "$from" != "$to" ] && { echo "#$from#=>#$to#"; sed -i "s|$from|$to|g" masterwork-dwarf-fortress-beta/Dwarf\ Fortress/libs/Dwarf_Fortress;} done;

Here is a bash version (requires bash version 3.1 or higher):
Code: [Select]
while IFS="|" read -r nope from to nope; do
    printf -v to '%-*.*s' ${#from} ${#from} "$to"
    [ "$from" != "$to" ] && {
        printf "#%s#=>#%s# //// " "$from" "$to"
        sed -i "s|$from|$to|g" "./$masterpath/Dwarf Fortress/libs/Dwarf_Fortress"
    }
done < <(tr -d "\r" < template.lng)

I don't see any box|Tanner|Cof line in the template.lng file, so I simply dropped that part.  I also used the Dwarf_Fortress path from jcd's version of the script.

However, there are a bunch of other things that would need to be tweaked to run it safely under bash (mostly adding double quotes around variable expansions, like cd $installdir => cd "$installdir").

Even then, this script probably won't work on any system other than Arch Linux.  I tried running it on Debian (by hand, running a command at a time) and there were so many problems:
  • 7z is called 7zr (which is in the p7zip package)
  • The wine thing failed, probably because I don't have KDE or GNOME installed, so I don't have "desktop files" for it to update; I think the fatal error had something to do with mimecaps.
  • Skipping all the wine/therapist/soundsense stuff, I just tried to launch ./dfhack and got a GLIBCXX version error.  Looks like this dfhack binary package that it downloads was built on something with newer library versions than Debian has.

That's more than enough pain for today.

Oh, and this:
Quote
never had much luck using xargs for anything other than getting rid of newlines.

xargs is basically crap.  It's rarely what you want to use.
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz

jcd

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #24 on: June 06, 2014, 01:19:20 am »

However, there are a bunch of other things that would need to be tweaked to run it safely under bash (mostly adding double quotes around variable expansions, like cd $installdir => cd "$installdir").
  • The wine thing failed, probably because I don't have KDE or GNOME installed, so I don't have "desktop files" for it to update; I think the fatal error had something to do with mimecaps.
  • Skipping all the wine/therapist/soundsense stuff, I just tried to launch ./dfhack and got a GLIBCXX version error.  Looks like this dfhack binary package that it downloads was built on something with newer library versions than Debian has.

this is old, as MEPH said in the other thread, try this: http://www.bay12forums.com/smf/index.php?topic=139071.0
Or try modifying the script posted there to build the newest version.
I'd build the new one myself, but with such rapid releases (three new MWDF versions just this week) it seems futile just now.
Thanks Meph! Its awesome though ;D

I will try to build an up to date version next week (as i will not have PC access in the weekend)

About the library error.
Maybe you should compile dfhack for yourself and use your compiled package for building MWDF?
What about the straight archlinux-dwarffortress package? Is it working as is? Maybe the libraries problems arise from it?
If so, you'd have to try another df-0.34.11 as a base (dunno why yaymeh decided to use the archlinux-package, but as i also run arch, it works for me)
What about the new Therapist? You'd need qt5 and some other dependencies too.

About 'desktop files', i use Openbox as a WM within all the Xfce DE goodies (besides xfwm of course), and those lines work normally.

PS. I guess we should centralize all the linux work for MWDF somehow, we currently have 3 threads for it, and it is getting slightly chaotic.
« Last Edit: June 06, 2014, 05:20:08 am by jcd »
Logged

greycat

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #25 on: June 06, 2014, 08:56:27 am »

Maybe you should compile dfhack for yourself and use your compiled package for building MWDF?

Yeah, it'll probably have to be done that way.  On my home computer I did manage to build a post-r3 version of dfhack from source, but it was incredibly difficult -- I ended up creating a chrooted 32-bit installation of an older version of Debian, and compiling a specific older version of gcc from source, so that I could build a dfhack that matched the libraries that ship with vanilla DF.  I have used this version of dfhack successfully for a while now, but apparently Masterwork has its own plugins, or uses newer plugins that aren't in the version I built, or something... man oh man oh man, we REALLY need to have a dfhack r5 release.  I hear they're working on it.

Quote
What about the straight archlinux-dwarffortress package? Is it working as is? Maybe the libraries problems arise from it?

Definitely doesn't work on Debian 7.  If I move the extracted package's opt/df_linux to /opt/df_linux and try to run ./usr/bin/dwarffortress I get:
Code: [Select]
./libs/Dwarf_Fortress: error while loading shared libraries: libGLEW.so.1.10: cannot open shared object file: No such file or directory

Debian 7 has libglew version 1.7.  Arch apparently has version 1.10.  All the library versions are apparently different (glibc, libstdc++, everything).

Quote
What about the new Therapist? You'd need qt5 and some other dependencies too.

I've lived without Therapist ever since I started playing, so I won't miss it.

Quote
About 'desktop files', i use Openbox as a WM within all the Xfce DE goodies (besides xfwm of course), and those lines work normally.

I don't use any "desktop environment" at all.  I use a window manager (fvwm2).  That's it.  Apparently this is uncommon enough that the winetricks program doesn't know how to deal with it. :(

Quote
PS. I guess we should centralize all the linux work for MWDF somehow, we currently have 3 threads for it, and it is getting slightly chaotic.

Yes, that sounds like an excellent idea.
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz

greycat

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #26 on: June 07, 2014, 09:12:06 am »

On my home computer I have wine version 1.5.24-74-g5069ad7, from whatever it was I last attempted to use wine for.  (And I also have wine version 1.4.1 from the Debian 7 package.)  I also already have a ~/.wine/ directory which may or may not interfere, or help, or who the hell knows....

For kicks, I simply ran this, without trying any of the MWDF install script separate-profile stuff:

Code: [Select]
WINEARCH=win32 winetricks -q dotnet40 corefonts

I got many, many screens full of "fixme:incomprehensible gibberish" but it seems to have done something.  At least it didn't give fatal error messages, hang, and require Ctrl-C like when I tried it on the work machine.  And since it moved on to the fonts, and downloaded a bunch of those, and appears to have created font files in my ~/.wine/drive_c/windows/Fonts/ directory, it's possible that it might have succeeded.

Now I wish I knew which thing specifically caused it to work on my home computer and fail on the work computer.  The wine-compiled-from-git version?  The preexisting ~/.wine/ directory?  Some optional Debian package that is installed?  I really have no idea.  I was expecting that I'd get the fatal error message, and have to create a symlink from ~/bin/some-desktop-environment-thing to /bin/true and try again, so the "success" took me quite by surprise.

Next step, I suppose, is to download the MWDF-for-Windows package and see if I can execute the GUI.

----

And that was successful, technically speaking.  The GUI is nearly painful to use, because it takes about 20 seconds for it to redraw the screen (you can watch each individual widget get placed, one at a time), and it redraws the screen all the time... but it appears to have modified data/init/init.txt and so forth, so I'll call that a victory and move on to the next step -- building an updated dfhack.

----

OK, got that.  I did a "git pull" on my dfhack source directory (which is located inside a squeeze [debian 6] chroot, but I don't have git installed inside the chroot, so I do all the git work in the debian 7 system); tried to do "git checkout develop", got told that I needed to commit that change to eventful that allows the "master" branch to compile, added & committed that, did "git checkout develop" again, and also "git submodule update".

Inside the squeeze chroot, I made a new build directory, cd'd into it, had no idea what to do next... dug up the compile instructions, ran a complicated cmake command, ran "make install", which failed... went back to my post in the dfhack thread, where I noted that I had to export CC=gcc-4.5 and CXX=g++-4.5 to make it use those specific compiler versions, which I had built from source.  Deleted the build directory, recreated it, exported the variables, cd'd into it, reran the cmake command, and "make install", and it all appeared to work.

Back in debian 7, I copied (using cp -a) each of "dfhack", "hack" and "libs" from the squeeze dfhack-enhanced df_linux directory into the MWDF/Dwarf Fortress directory.  Ran ./dfhack, and the game came up full-screen.  I quit out of that, edited data/init/init.txt by hand to turn that off, and ran ./dfhack again.  Resized the window, and started a world generation.

So far so good.
« Last Edit: June 07, 2014, 10:56:29 am by greycat »
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz

greycat

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #27 on: June 13, 2014, 07:37:40 am »

After a couple installs and an update, I think I've got the essentials nailed down.  To make Masterwork run on Linux, you need:
  • The Masterwork-for-Windows .7z package.  And a 7zip extraction program (7z or 7zr).
  • A working version of Wine with Dot-Net (or Mono or whatever) on your Linux system or a Windows system where you can run the GUI and then copy the files over to Linux.
  • A version of DF-for-Linux that will run on your system (could be Toady's original package, or an Arch Linux package, or whatever works for you).
  • A version of post-r3 dfhack that will work with your version of DF.  This could be self-compiled, or a binary package from someone else.

Unpack Masterwork, and run the GUI to set it up.  Then on top of that, extract DF-for-Linux (you only need the libs directory) and dfhack-for-your-DF (you need the dfhack script and the contents of the hack directory).  Make any final tweaks to the data files, and away you go.

I've bundled up my version of DF + dfhack, in case anyone needs it.
« Last Edit: June 13, 2014, 08:12:46 am by greycat »
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz

Snaaty

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #28 on: June 13, 2014, 11:48:29 am »

Hello,
first of all, thank you all for your work on the linux version of this awesome mod!
However I seem to encounter a few problems, with which someone here might be able to help me:

1. Truetype crashes my game when I open the 'b'uild-menu. Zooming out to a certain degree might prevent this from happening, but I can't find the right spot. Playing without truetype is a huge pain, though, because some text just gets outright unreadable.

2. I can't get the Masterworks.exe running on my ubuntu. I have dotnet40 installed on the computer, but if i try to start the .exe with wine it doesn't do anything. Because of that I just modified the raws myself, changing some !NO... into [. Now I just face the problem, if I enable all races manually, my embark ( and I suppose also ingame-things) can get messed up. I guess it is because of some dependencies in the raws that my clumsy editing couldn't change. (Actually in the 5.06 it worked rather well, I didn't do intensive testing, though and my Kobolds couldn't get rusty iron choppers (or Orcs?).
So if you have any help on getting the .exe running, I would greatly appreciate it!

Thank you very much in advance.
Logged

greycat

  • Bay Watcher
    • View Profile
Re: [linux] Install script
« Reply #29 on: June 13, 2014, 12:16:45 pm »

Truetype is extremely broken, so I simply disable it.  I prefer to play in the standard "ASCII" interface anyway.  (If you MUST have Truetype, then you might need to go in the exact opposite direction that I did.  I chose to go "backwards" and built everything with the old library versions that Toady uses; the Arch Linux folks went "forward" and built everything with extremely new versions of glibc, libstdc++, etc.  So, the Arch Linux packages won't run on Debian 7; I haven't tried it with Debian unstable or testing, or with Ubuntu.)

I don't know a lot about Wine; nearly every time I use it, I have to overcome enormous obstacles, and I usually give up before I get it to work.  If the version of Wine that comes with your OS is too old, you might want to try building a newer one from source (although that's an adventure by itself -- see for example compiling wine on 64-bit Debian Wheezy).

My home computer has an older development version of Wine installed (1.5.24-74-g5069ad7), and I was able to install dotnet40 with winetricks on that computer.  On my work computer, I installed Wine 1.6.4 from tarball source, and when I tried to install dotnet40 and corefonts, I think it installed Mono instead, and it took literally hours to do the corefonts.  I'm not exaggerating.  I went to lunch, came back, went to a meeting, came back, and it was still going.  Every time it did a cab_extract or something, it took ages.  And it did half a dozen of those for every font....  But eventually it finished, and I was able to run the Masterwork GUI.
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz
Pages: 1 [2] 3 4