Install: first preliminary working installation setup
the installed lumiera exe can even be started... ...well with a bit of cheating: you need to cd into the lib/lumiera because the PLUGINPATH problem isn't solved yet
This commit is contained in:
parent
7993759f8e
commit
bc22ec7faa
4 changed files with 75 additions and 21 deletions
32
SConstruct
32
SConstruct
|
|
@ -336,9 +336,9 @@ def defineBuildTargets(env, artifacts):
|
|||
|
||||
core = lLib+lApp+lBack+lProc
|
||||
|
||||
artifacts['lumiera'] = env.LumieraExe('$TARDIR/lumiera', ['$SRCDIR/lumiera/main.cpp'], LIBS=core)
|
||||
artifacts['corelib'] = lLib+lApp
|
||||
artifacts['corelib'] = core
|
||||
artifacts['support'] = lLib
|
||||
artifacts['lumiera'] = env.LumieraExe('$TARDIR/lumiera', ['$SRCDIR/lumiera/main.cpp'], LIBS=core)
|
||||
|
||||
# building Lumiera Plugins
|
||||
envPlu = env.Clone()
|
||||
|
|
@ -351,6 +351,7 @@ def defineBuildTargets(env, artifacts):
|
|||
artifacts['icons'] = ( [env.IconRender(f) for f in scanSubtree(vector_icon_dir, ['*.svg'])]
|
||||
+ [env.IconCopy(f) for f in scanSubtree(prerendered_icon_dir, ['*.png'])]
|
||||
)
|
||||
##TODO make that into a resource builder
|
||||
|
||||
# the Lumiera GTK GUI
|
||||
envGtk = env.Clone()
|
||||
|
|
@ -363,6 +364,7 @@ def defineBuildTargets(env, artifacts):
|
|||
+ env.Install('$TARDIR', env.Glob('$SRCDIR/gui/*.rc'))
|
||||
+ artifacts['icons']
|
||||
)
|
||||
artifacts['guimodule'] = guimodule ###TODO better organisation of GUI components
|
||||
|
||||
# call subdir SConscript(s) for independent components
|
||||
SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts core')
|
||||
|
|
@ -376,10 +378,10 @@ def definePostBuildTargets(env, artifacts):
|
|||
"""
|
||||
ib = env.Alias('install-bin', '$DESTDIR/bin')
|
||||
il = env.Alias('install-lib', '$DESTDIR/lib')
|
||||
env.Alias('install', [ib, il])
|
||||
id = env.Alias('install-dat', '$DESTDIR/share')
|
||||
env.Alias('install', [ib, il, id])
|
||||
|
||||
build = env.Alias('build', artifacts['lumiera']+artifacts['gui']+artifacts['plugins']+artifacts['tools'])
|
||||
allbu = env.Alias('allbuild', build+artifacts['testsuite'])
|
||||
env.Default('build')
|
||||
# additional files to be cleaned when cleaning 'build'
|
||||
env.Clean ('build', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log' ])
|
||||
|
|
@ -388,17 +390,27 @@ def definePostBuildTargets(env, artifacts):
|
|||
doxydoc = artifacts['doxydoc'] = env.Doxygen('doc/devel/Doxyfile')
|
||||
env.Alias ('doc', doxydoc)
|
||||
env.Clean ('doc', doxydoc + ['doc/devel/,doxylog','doc/devel/warnings.txt'])
|
||||
|
||||
allbu = env.Alias('allbuild', build+artifacts['testsuite']+doxydoc)
|
||||
|
||||
|
||||
def defineInstallTargets(env, artifacts):
|
||||
""" define some artifacts to be installed into target locations.
|
||||
""" define artifacts to be installed into target locations.
|
||||
"""
|
||||
env.Install(dir = '$DESTDIR/bin', source=artifacts['lumiera'])
|
||||
env.Install(dir = '$DESTDIR/lib', source=artifacts['corelib'])
|
||||
env.Install(dir = '$DESTDIR/lib', source=artifacts['plugins'])
|
||||
env.Install(dir = '$DESTDIR/bin', source=artifacts['tools'])
|
||||
binDir = '$DESTDIR/bin/'
|
||||
lumDir = '$DESTDIR/lib/lumiera/'
|
||||
modDir = '$DESTDIR/lib/lumiera/$MODULES/'
|
||||
shaDir = '$DESTDIR/share/lumiera/'
|
||||
env.Install(dir = modDir, source=artifacts['corelib'])
|
||||
env.Install(dir = modDir, source=artifacts['plugins'])
|
||||
env.Install(dir = modDir, source=artifacts['guimodule'])
|
||||
lumi = env.Install(dir = lumDir, source=artifacts['lumiera'])
|
||||
tool = env.Install(dir = lumDir, source=artifacts['tools'])
|
||||
print "Aufruf LINK DESTDIR=" + env.get('DESTDIR')
|
||||
env.SymLink(binDir+"lumiera",lumi,"../lib/lumiera/lumiera")
|
||||
|
||||
env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=artifacts['doxydoc'])
|
||||
env.Install(dir = shaDir, source="data/config/dummy_lumiera.ini") ### TODO should become a resource builder
|
||||
# env.Install(dir = '$DESTDIR/share/doc/lumiera$VERSION/devel', source=artifacts['doxydoc'])
|
||||
|
||||
#####################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -151,10 +151,10 @@ def createPlugins(env, dir):
|
|||
""" investigate the given source directory to identify all contained source trees.
|
||||
@return: a list of build nodes defining a plugin for each of these source trees.
|
||||
"""
|
||||
return [env.LoadableModule( '#$TARDIR/$MODULES/%s' % getDirname(tree)
|
||||
, srcSubtree(env, tree)
|
||||
, SHLIBPREFIX='', SHLIBSUFFIX='.lum'
|
||||
)
|
||||
return [env.LumieraPlugin( '#$TARDIR/$MODULES/%s' % getDirname(tree)
|
||||
, srcSubtree(env, tree)
|
||||
, SHLIBPREFIX='', SHLIBSUFFIX='.lum'
|
||||
)
|
||||
for tree in findSrcTrees(dir)
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,14 @@
|
|||
#####################################################################
|
||||
|
||||
|
||||
import os
|
||||
from os import path
|
||||
|
||||
import SCons
|
||||
import SCons.SConf
|
||||
from SCons.Environment import Environment
|
||||
|
||||
from Buildhelper import *
|
||||
from os import path
|
||||
|
||||
|
||||
|
||||
|
|
@ -82,10 +84,29 @@ class LumieraEnvironment(Environment):
|
|||
return libInfo
|
||||
|
||||
|
||||
def LumieraLibrary (self, *args,**kw):
|
||||
""" augments the built-in SharedLibrary() builder to add
|
||||
some tweaks missing in SCons 1.0, like setting a SONAME proper
|
||||
instead of just passing the relative pathname to the linker
|
||||
def SymLink(self, target, source, linktext=None):
|
||||
""" use python to create a symlink
|
||||
"""
|
||||
def makeLink(target,source,env):
|
||||
if linktext:
|
||||
dest = linktext
|
||||
else:
|
||||
dest = str(source[0])
|
||||
link = str(target[0])
|
||||
os.symlink(dest, link)
|
||||
def reportLink(target,source,env):
|
||||
dest = str(source[0])
|
||||
link = str(target[0])
|
||||
return "Install link %s -> %s" % (link,dest)
|
||||
|
||||
action = Action(makeLink,reportLink)
|
||||
self.Command (target,source, action)
|
||||
|
||||
|
||||
def defineSoname (self, *args,**kw):
|
||||
""" internal helper to extract or guess
|
||||
a suitable library SONAME, either using an
|
||||
explicit spec, falling back on the lib filename
|
||||
"""
|
||||
if 'soname' in kw:
|
||||
soname = self.subst(kw['soname']) # explicitely defined by user
|
||||
|
|
@ -102,15 +123,32 @@ class LumieraEnvironment(Environment):
|
|||
|
||||
libname = "${SHLIBPREFIX}%s$SHLIBSUFFIX" % libname
|
||||
soname = self.subst(libname) # else: use the library filename as DT_SONAME
|
||||
|
||||
assert soname
|
||||
return soname
|
||||
|
||||
|
||||
def LumieraLibrary (self, *args,**kw):
|
||||
""" augments the built-in SharedLibrary() builder to add
|
||||
some tweaks missing in SCons 1.0, like setting a SONAME proper
|
||||
instead of just passing the relative pathname to the linker
|
||||
"""
|
||||
subEnv = self.Clone()
|
||||
subEnv.Append(LINKFLAGS = "-Wl,-soname="+soname )
|
||||
subEnv.Append(LINKFLAGS = "-Wl,-soname="+self.defineSoname(*args,**kw))
|
||||
|
||||
libBuilder = self.get_builder('SharedLibrary')
|
||||
return libBuilder(subEnv, *args,**kw); # invoke the predefined builder on the augmented environment
|
||||
|
||||
|
||||
def LumieraPlugin (self, *args,**kw):
|
||||
""" builds a shared library, autmented by some defaults for lumiera plugins.
|
||||
"""
|
||||
subEnv = self.Clone()
|
||||
subEnv.Append(LINKFLAGS = "-Wl,-soname="+self.defineSoname(*args,**kw))
|
||||
|
||||
libBuilder = self.get_builder('LoadableModule')
|
||||
return libBuilder(subEnv, *args,**kw); # invoke the predefined builder on the augmented environment
|
||||
|
||||
|
||||
def LumieraExe (self, *args,**kw):
|
||||
""" augments the built-in Program() builder to add a fixed rpath based on $ORIGIN
|
||||
That is: after searching LD_LIBRARY_PATH, but before the standard linker search,
|
||||
|
|
|
|||
4
data/config/dummy_lumiera.ini
Normal file
4
data/config/dummy_lumiera.ini
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/* This is an dummy Lumiera config file
|
||||
*
|
||||
* Actually Lumiera can't yet load any config, as of 1/2011
|
||||
*/
|
||||
Loading…
Reference in a new issue