How to compile and install USokoban on Fedora.
This is a guide at beginner level.
Important: You should always check what commands do (using man pages) and what the content of scripts are before running them. This is just a guide for other people who encounter similar problems as I had when getting this working.
Compilation
Download the sources and extract it into a folder such as ~/Downloads/usokoban, then download the media and extract it into a folder such as ~/Downloads/usokoban-bin.
You can also check the files are the same as the ones I got:
You will need to install gcc (the C compiler) as well as the development packages for gtk+-2.0, libpcre and sqlite3. To do this:Code:$ md5sum usokoban-0.0.13-src.tar.gz e445a851c0fa6100546cefc18073e2b8 usokoban-0.0.13-src.tar.gz $ md5sum usokoban-0.0.13-i386.tar.gz 67f1282a1851fd3495829542c374f3c4 usokoban-0.0.13-i386.tar.gz
Code:sudo yum install gcc(you can use yum search pcre-devel to see other versions, in case you are not using x86_64)Code:sudo yum install gtk2-devel.x86_64 pcre-devel.x86_64 sqlite-devel.x86_64
For the compiler to be able to find these libraries you need to use
if you used a different version of the libraries than x86_64 you might need to add a different path to pkg-config. You can find out where pkg-config needs to look by opening Administration -> Add/Remove Software and search for the package you have installed, select it then open Selection -> get file list and look for things like pkgconfig/libpcre.pc in the files list. You can check you pkg-config is finding things using: pkg-config --exists libpcre && echo foundCode:export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib64/pkgconfig/
Now if you run the command from README.source:
it will error like this:Code:gcc base.c settings.c sokoban.c sokoban2.c solver.c savitch.c solution.c -o usokoban `pkg-config --cflags --libs gtk+-2.0 libpcre sqlite3`
to resolve the errors use this:Code:/usr/bin/ld: /tmp/ccMkYGad.o: undefined reference to symbol 'g_thread_init' /usr/bin/ld: note: 'g_thread_init' is defined in DSO /lib64/libgthread-2.0.so.0 so try adding it to the linker command line /lib64/libgthread-2.0.so.0: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status
you should now have your own compiled binary of usokoban! Don't run it yet.Code:gcc base.c settings.c sokoban.c sokoban2.c solver.c savitch.c solution.c -o usokoban `pkg-config --cflags --libs gtk+-2.0 libpcre sqlite3` -lgthread-2.0 -lz
Installation
Now copy the binary over the one stuff in ~/Downloads/usokoban-bin:
and cd into the usokoban-bin directory before running (remember to check the script to see what exactly it does - just copying files into the right places - before running it)Code:cp ~/Downloads/usokoban/usokoban ~/Downloads/usokoban-bin
Now usokoban will show up in the games list (at least it does in xfce) and you can play it now! It will save the solutions you find and level you are on too.Code:sudo sh install_usokoban.sh
Customization
You can now save borgar to /usr/share/games/usokoban and then put skin.default=/usr/share/games/usokoban/borgar.png in ~/.usokoban You can also save some of the great classic levels at David W. Skinner's Sokoban page into that folder and open them next time you play usokoban.
Have fun!


Reply With Quote
