better install the setup.ini direcly into $ORIGIN

seems to be the most obvious location to install it
This commit is contained in:
Fischlurch 2011-02-14 23:52:36 +01:00
parent cef1ff3dcc
commit aef929b3d9
5 changed files with 28 additions and 8 deletions

View file

@ -348,7 +348,7 @@ def defineBuildTargets(env, artifacts):
artifacts['corelib'] = core artifacts['corelib'] = core
artifacts['support'] = lLib artifacts['support'] = lLib
artifacts['lumiera'] = ( env.Program('lumiera', ['src/lumiera/main.cpp'], LIBS=core, install=True) artifacts['lumiera'] = ( env.Program('lumiera', ['src/lumiera/main.cpp'], LIBS=core, install=True)
+ env.ConfigData(env.path.srcConf+'setup.ini') + env.ConfigData(env.path.srcConf+'setup.ini', targetDir='$ORIGIN')
+ env.ConfigData(env.path.srcConf+'dummy_lumiera.ini') + env.ConfigData(env.path.srcConf+'dummy_lumiera.ini')
) )

View file

@ -165,10 +165,27 @@ def register_LumieraResourceBuilder(env):
env.Install (toInstall, source) env.Install (toInstall, source)
return env.Install(toBuild, source) return env.Install(toBuild, source)
def ConfigData(env, source): def ConfigData(env, source, targetDir=None):
""" install (copy) configuration- and metadata.
target dir is either the install location configured (in SConstruct),
or an explicitly given absolute or relative path segment, which might refer
to the location of the executable through the $ORIGIN token
"""
subdir = getDirname(str(source), env.path.srcConf) # removes source location path prefix subdir = getDirname(str(source), env.path.srcConf) # removes source location path prefix
toBuild = env.path.buildConf+subdir if targetDir:
toInstall = env.path.installConf+subdir if path.isabs(targetDir):
toBuild = toInstall = path.join(targetDir,subdir)
else:
if targetDir.startswith('$ORIGIN'):
targetDir = targetDir[len('$ORIGIN'):]
toBuild = path.join(env.path.buildExe, targetDir, subdir)
toInstall = path.join(env.path.installExe, targetDir, subdir)
else:
toBuild = path.join(env.path.buildConf, targetDir, subdir)
toInstall = path.join(env.path.installConf, targetDir, subdir)
else:
toBuild = path.join(env.path.buildConf,subdir)
toInstall = path.join(env.path.installConf,subdir)
env.Install (toInstall, source) env.Install (toInstall, source)
return env.Install(toBuild, source) return env.Install(toBuild, source)

View file

@ -10,7 +10,7 @@
# #
gui = gtk_gui.lum gui = gtk_gui.lum
modulepath = $ORIGIN/modules modulepath = $ORIGIN/modules
configpath = $ORIGIN/../../share/lumiera/config:~/.lumiera configpath = $ORIGIN/../../share/lumiera/config:$ORIGIN/config:~/.lumiera # unused currently (2/2011)
title = Lumiera title = Lumiera
version = 0.pre.01 version = 0.pre.01
website = http://www.lumiera.org website = http://www.lumiera.org

View file

@ -42,8 +42,6 @@ using util::cStr;
using lib::Literal; using lib::Literal;
#define LOCATION_OF_BOOTSTRAP_INI "$ORIGIN/config/setup.ini"
namespace lumiera { namespace lumiera {
@ -80,7 +78,7 @@ namespace lumiera {
* client codes POV it just behaves like intended). * client codes POV it just behaves like intended).
*/ */
AppState::AppState() AppState::AppState()
: setup_(LOCATION_OF_BOOTSTRAP_INI) : setup_(LUMIERA_LOCATION_OF_BOOTSTRAP_INI)
, subsystems_(0) , subsystems_(0)
, emergency_(false) , emergency_(false)
, core_up_ (false) , core_up_ (false)

View file

@ -33,6 +33,11 @@
#include <string> #include <string>
/** "bootstrapIni" : the basic setup configuration to load */
#define LUMIERA_LOCATION_OF_BOOTSTRAP_INI "$ORIGIN/setup.ini"
namespace lumiera { namespace lumiera {
using std::string; using std::string;