Global-Layer-Renaming: fix handling of GuiResources in the build
the new structure causes them now to be installed into $TARGET/stage which is simply not what I want. I still consider $TARGET/gui the better choice, since an administrator or packager is not aware of our layer namings. The existing solution was half baked anyway, it did not really replicate the source tree. On the other hand, I want to retain the location of the CSS files within the GUI tree, since I consider it a good practice, to keep "code-like" resources with the actual code, and not far away in some arcane "data" directory. No I've noticed, that the env.GuiResource() function is only used once, for this very task. So, for the time being, we can keep it simple and deditaced to that task, i.e we pick up all CSS files we find and install it into a single target directory. NOTE: this issue has brought to my attention two further, completely unrelated issues * Ticket #1192 (Lumiera hangs on failed GUI start) * The ProcDispatcher does an idle wait, due to an error in timed-wait implementation
This commit is contained in:
parent
480104b945
commit
8d6cb19e3f
7 changed files with 606 additions and 247 deletions
|
|
@ -28,11 +28,11 @@
|
||||||
# Read more about the SCons build system at: http://www.scons.org
|
# Read more about the SCons build system at: http://www.scons.org
|
||||||
|
|
||||||
|
|
||||||
# SCons plugins and extension modules
|
# NOTE: Lumiera SCons extension modules and plugins
|
||||||
#------------------------------------------------
|
#--------------------------------------------------
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('./admin/scons')
|
sys.path.append('./admin/scons')
|
||||||
#------------------------------------------------
|
#--------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
import Setup
|
import Setup
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,7 @@ def scanSubtree(roots, patterns=SRCPATTERNS):
|
||||||
"""
|
"""
|
||||||
for root in globRootdirs(roots):
|
for root in globRootdirs(roots):
|
||||||
for (d,_,files) in os.walk(root):
|
for (d,_,files) in os.walk(root):
|
||||||
if d.startswith('./'):
|
d = stripPrefix(d, './')
|
||||||
d = d[2:]
|
|
||||||
for p in patterns:
|
for p in patterns:
|
||||||
for f in fnmatch.filter(files, p):
|
for f in fnmatch.filter(files, p):
|
||||||
yield os.path.join(d,f)
|
yield os.path.join(d,f)
|
||||||
|
|
@ -136,15 +135,20 @@ def getDirname (d, basePrefix=None):
|
||||||
d,_ = os.path.split(d)
|
d,_ = os.path.split(d)
|
||||||
if basePrefix:
|
if basePrefix:
|
||||||
basePrefix = os.path.realpath(basePrefix)
|
basePrefix = os.path.realpath(basePrefix)
|
||||||
name = str(d)
|
name = stripPrefix(str(d), basePrefix)
|
||||||
if str(d).startswith(basePrefix):
|
|
||||||
name = name[len(basePrefix):]
|
|
||||||
else:
|
else:
|
||||||
_, name = os.path.split(d)
|
_, name = os.path.split(d)
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def stripPrefix(path, prefix):
|
||||||
|
if path.startswith(prefix):
|
||||||
|
path = path[len(prefix):]
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def createPlugins(env, directory, **kw):
|
def createPlugins(env, directory, **kw):
|
||||||
""" investigate the given source directory to identify all contained source trees.
|
""" 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: a list of build nodes defining a plugin for each of these source trees.
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ def register_LumieraResourceBuilder(env):
|
||||||
return (generateTargets, source)
|
return (generateTargets, source)
|
||||||
|
|
||||||
def IconResource(env, source):
|
def IconResource(env, source):
|
||||||
"""Copy icon pixmap to corresponding icon dir. """
|
""" copy icon pixmap to corresponding icon dir. """
|
||||||
subdir = getDirname(str(source))
|
subdir = getDirname(str(source))
|
||||||
toBuild = env.path.buildIcon+subdir
|
toBuild = env.path.buildIcon+subdir
|
||||||
toInstall = env.path.installIcon+subdir
|
toInstall = env.path.installIcon+subdir
|
||||||
|
|
@ -165,9 +165,11 @@ def register_LumieraResourceBuilder(env):
|
||||||
return env.Install(toBuild, source)
|
return env.Install(toBuild, source)
|
||||||
|
|
||||||
def GuiResource(env, source):
|
def GuiResource(env, source):
|
||||||
subdir = getDirname(str(source))
|
""" pick up giben source resource and install
|
||||||
toBuild = env.path.buildUIRes+subdir
|
them (flat) into the configured target
|
||||||
toInstall = env.path.installUIRes+subdir
|
"""
|
||||||
|
toBuild = env.path.buildUIRes
|
||||||
|
toInstall = env.path.installUIRes
|
||||||
env.Install (toInstall, source)
|
env.Install (toInstall, source)
|
||||||
return env.Install(toBuild, source)
|
return env.Install(toBuild, source)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ CUSTOPTFILE = 'custom-options'
|
||||||
buildExe = '#$TARGDIR'
|
buildExe = '#$TARGDIR'
|
||||||
buildLib = '#$TARGDIR/modules'
|
buildLib = '#$TARGDIR/modules'
|
||||||
buildPlug = '#$TARGDIR/modules'
|
buildPlug = '#$TARGDIR/modules'
|
||||||
buildIcon = '#$TARGDIR/gui/icons'
|
buildIcon = '#$TARGDIR/gui/icons' # for IconResource() and IconRender()
|
||||||
buildUIRes = '#$TARGDIR/'
|
buildUIRes = '#$TARGDIR/gui/' # for GuiResource()
|
||||||
buildConf = '#$TARGDIR/config'
|
buildConf = '#$TARGDIR/config' # for ConfigData()
|
||||||
installExe = '#$DESTDIR/lib/lumiera'
|
installExe = '#$DESTDIR/lib/lumiera'
|
||||||
installLib = '#$DESTDIR/lib/lumiera/modules'
|
installLib = '#$DESTDIR/lib/lumiera/modules'
|
||||||
installPlug = '#$DESTDIR/lib/lumiera/modules'
|
installPlug = '#$DESTDIR/lib/lumiera/modules'
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,5 @@ copyright = 2007 - 2015
|
||||||
[Gui]
|
[Gui]
|
||||||
#stylesheet = lumiera.css
|
#stylesheet = lumiera.css
|
||||||
stylesheet = lumiera-light-theme-complement.css
|
stylesheet = lumiera-light-theme-complement.css
|
||||||
iconpath = $ORIGIN/../../share/lumiera/icons:$ORIGIN/gui/icons:~/.lumiera/icons
|
iconpath = $ORIGIN/../../share/lumiera/icons:$ORIGIN/gui/icons
|
||||||
resourcepath = $ORIGIN/../../share/lumiera/gui:$ORIGIN/gui
|
resourcepath = $ORIGIN/../../share/lumiera:$ORIGIN/gui
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,12 @@ lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), addLibs=lLib,
|
||||||
lVault = env.SharedLibrary('lumieravault', srcSubtree('vault'), addLibs=lLib+lApp, install=True)
|
lVault = env.SharedLibrary('lumieravault', srcSubtree('vault'), addLibs=lLib+lApp, install=True)
|
||||||
lSteam = env.SharedLibrary('lumierasteam', srcSubtree('steam'), addLibs=lLib+lApp+lVault,install=True)
|
lSteam = env.SharedLibrary('lumierasteam', srcSubtree('steam'), addLibs=lLib+lApp+lVault,install=True)
|
||||||
|
|
||||||
core = lSteam+lVault+lApp+lLib # in reverse dependency order
|
# in reverse dependency order
|
||||||
support_lib = lLib
|
core = lSteam+lVault+lApp+lLib # used to build the core application
|
||||||
app_lib = lApp+support_lib
|
app_lib = lApp+lLib # use to link against the platform
|
||||||
vault_lib = lVault+app_lib
|
core_lib = core # use to link against the core application
|
||||||
core_lib = core
|
vault_lib = lVault+app_lib # use to link against the low-level backend
|
||||||
|
support_lib = lLib # use to link against the support lib only
|
||||||
|
|
||||||
lumiera = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
|
lumiera = ( env.Program('lumiera', ['lumiera/main.cpp'] + core, install=True)
|
||||||
+ config
|
+ config
|
||||||
|
|
@ -40,9 +41,11 @@ envGtk = env.Clone()
|
||||||
envGtk.mergeConf(['gtkmm-3.0','sigc++-2.0','gthread-2.0','cairomm-1.0','gdl','xv','x11','xext','sm'])
|
envGtk.mergeConf(['gtkmm-3.0','sigc++-2.0','gthread-2.0','cairomm-1.0','gdl','xv','x11','xext','sm'])
|
||||||
|
|
||||||
guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('stage') + core, install=True)
|
guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('stage') + core, install=True)
|
||||||
|
resources = ( [env.GuiResource(f) for f in scanSubtree('stage', ['*.css'])] # note: collected into one target dir
|
||||||
|
)
|
||||||
gui = ( guimodule
|
gui = ( guimodule
|
||||||
|
+ resources
|
||||||
+ icons
|
+ icons
|
||||||
+ [env.GuiResource(f) for f in env.Glob('stage/*.css')]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue