Tile World file location help (Linux) - Flexico - 08-Sep-2015
I installed the "tworld" package with APT, but it stores some files in "~/.tworld" like I would expect, but others (level sets and resource files) in "/usr/share/games/tworld". I would like everything to be in "~/.tworld", and I read somewhere in the documentation that I can specify different folders, but I can't find how to actually do it. Help please?
Tile World file location help (Linux) - chipster1059 - 08-Sep-2015
For that you have to compile Tile World yourself, the package you installed is useless, you have to uninstall it.
Download the source code here:
www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.1-CCLPs.tar.gz
Extract it.
Open a terminal and navigate to the directory where you extracted the tarball. Run the following command:
./configure --with-sharedir=AAA
Replace AAA with the full path to the directory where you want the files to be stored.
Then run the following command:
make
Finally, run this command as root:
make install
And it should work. Hope this helps.
Tile World file location help (Linux) - breadbox - 08-Sep-2015
You have a few options.
- You can set the environment variable TWORLDDIR to change the default directory tree for all shared files. So you could add something like this to your .profile (or .bash_profile or whatever you use):
export TWORLDDIR=~/.tworld
<span style="font-family:arial, helvetica, sans-serif;"><span style="font-family:'courier new', courier, monospace;"><span style="font-family:arial, helvetica, sans-serif;"><span style="font-family:'courier new', courier, monospace;"><span style="font-family:arial, helvetica, sans-serif;">Note that this will create ~/.tworld/data, ~/.tworld/sets, and ~/.tworld/res, but your save files will still be in the top-level ~/.tworld directory, which is a little messy. But there's also a TWORLDSAVEDIR environment variable you can use, which will just change the default save directory. So you could do this:
<span style="font-family:'courier new', courier, monospace;">export TWORLDDIR=~/.tworld
export TWORLDSAVEDIR=~/.tworld/save
which would probably be the closest to what you want.
- You can use command-line options -D, -L, and -R (and optionally also -S) to override the default directories individually:
tworld -D datadir -L setsdir -R resdir -S savedir
To avoid having to type all that out, you could create a tworld shell script in your personal bin directory that looked something like this:
<span style="font-family:'courier new', courier, monospace;">#!/bin/sh
DIR=~/.tworld
tworld -D $DIR/data -L $DIR/sets -R $DIR/res -S $DIR/save
Note that you can use the command "tworld -h" to see a full list of the command-line options, or "man tworld" to see more detailed documentation. Or the same documentation is available on the website.
- Finally, of course, you can compile Tile World yourself, and configure the default directories to be the way you want them to be. That's not as convenient, of course.
For the record, Tile World's file layout follows the standard Unix behavior of putting universal data (the level sets, sounds and graphics) in a shared location, and the user-specific data (your solutions) in a user-specific location.
Tile World file location help (Linux) - Flexico - 08-Sep-2015
Alright, I tried compiling it myself, but I get this error:
[Click to Show Content]
Code: cyrus@fractalbot:~$ cd ~/Downloads/Software/CHIPS/tworld
cyrus@fractalbot:~/Downloads/Software/CHIPS/tworld$ ./configure --with-sharedir=~/.tworld
using sdl for OS/hardware layer ...
checking for sdl-config... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating oshw/Makefile
cyrus@fractalbot:~/Downloads/Software/CHIPS/tworld$ make
make: sdl-config: Command not found
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o tworld.o tworld.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o series.o series.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o play.o play.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o encoding.o encoding.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o solution.o solution.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o res.o res.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o lxlogic.o lxlogic.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o mslogic.o mslogic.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o unslist.o unslist.c
echo \#define COMPILE_TIME \"`date '+%Y %b %e %T %Z'`\" > comptime.h
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o help.o help.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o score.o score.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o random.o random.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o cmdline.o cmdline.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o fileio.o fileio.c
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG '-DROOTDIR="~/.tworld"' -c -o err.o err.c
(cd oshw && make)
make[1]: Entering directory '/home/cyrus/Downloads/Software/CHIPS/tworld/oshw-sdl'
make[1]: sdl-config: Command not found
gcc -Wall -Wextra -O2 -fomit-frame-pointer -DNDEBUG -c -o sdloshw.o sdloshw.c
sdloshw.c:10:17: fatal error: SDL.h: No such file or directory
#include "SDL.h"
^
compilation terminated.
<builtin>: recipe for target 'sdloshw.o' failed
make[1]: *** [sdloshw.o] Error 1
make[1]: Leaving directory '/home/cyrus/Downloads/Software/CHIPS/tworld/oshw-sdl'
Makefile:78: recipe for target 'liboshw.a' failed
make: *** [liboshw.a] Error 2
Tile World file location help (Linux) - Flexico - 08-Sep-2015
And yes, I am aware why the files are structured that way -- but I like to tinker with the data/res files, and my home folder is mounted to a separate partition that is shared by multiple Linux installs, so my settings are preserved even if I wipe and reinstall a distro or two. That way I don't have to re-widger the /usr/share stuff on each one.
Tile World file location help (Linux) - Flexico - 08-Sep-2015
Ok, got it working with the command line options! Woohoo! I would still like to learn how to compile it myself though, and know what went wrong.
Tile World file location help (Linux) - breadbox - 08-Sep-2015
What went wrong is that you don't have the SDL development package. (You have SDL installed, but you don't have the support files that let you build something that uses SDL.) Running "sudo apt-get install libsdl1.2-dev" would fix that.
Tile World file location help (Linux) - breadbox - 08-Sep-2015
(Oh, and I would say that your use case is exactly the type of situation I had in mind when I added the environment variables feature to Tile World.)
|