Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Data files path
11-05-2009, 12:46 PM,
#1
[SOLVED] Data files path
I have successfully compiled vdrift on Linux. I did a package too.
The source tarball was extracted on /usr/src/vdrift-20090615/pkg/
This is the code I used to compile and install vdrift for packaging purposes.
Code:
scons -j 2 release=1 arch=i686 prefix=/usr localstatedir=/var sysconfdir=/etc || return 1
scons install prefix=$startdir/pkg
$startdir=/usr/src/vdrift-20090615.
The package installs the data files on /share/games/vdrift/data as it should, but when I run vdrift it keeps searching the data files on:
Quote:INFO: Data directory: /usr/src/vdrift-20090615/pkg/share/games/vdrift/data
DATA_DIR: /usr/src/vdrift-20090615/pkg/share/games/vdrift/data
(that's where 'scons install' installed them as it was told).
So is this DATA_DIR hardcoded in the vdrift binary?
If not, is there any way I can tell vdrift to look for the data files on /share/games/vdrift/data instead of on /usr/src/vdrift-20090615/pkg/share/games/vdrift/data
PS. The game runs OK provided I copy the data files to /usr/src/vdrift-20090615/pkg/share/games/vdrift/data.
Reply
11-06-2009, 01:57 AM,
#2
 
You can set the DATA_DIR at compile time with:
Code:
scons datadir=share/games/vdrift/data
just replace share/games/vdrift/data with some/other/path.

You can get a full list of the options with scons --help.
Reply
11-06-2009, 05:23 AM,
#3
 
Thank you for your reply.

This what I did in the end:
Code:
scons -j 2 prefix=/usr datadir=share/games/vdrift/data release=1 arch=i686 localstatedir=/var sysconfdir=/etc || return 1
    mv $startdir/src/$pkgname-$pkgver/build/vdrift $startdir/src/$pkgname-$pkgver/build/vdrift.back
    scons -j 2 install prefix=$startdir/pkg/usr datadir=share/games/vdrift/data
    mv $startdir/src/$pkgname-$pkgver/build/vdrift.back $startdir/pkg/usr/bin/vdrift
I realised that after the first scons command the datadir was correctely set but after the second scons command the vdrift binary was compiled again and this time the datadir was set to $startdir/pkg/usr/share/games/vdrift/data.
Maybe there is a more elegant solution, but this one works :wink:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)