Build: configuring via environment is bad practice

Yes, I know...
Programmers absolutely LOVE to sneak-in various nifty toggles via environment.

Yet this is an anti-pattern!
And, by extension of that verdict, a "build interface" which relies
on the implicit convention that some magical variables are set,
is **not a proper interface** but a hack.

Thus we abandon that bad practice and handle the build in a clean and explicit way.

 * the DEB-Build in `debian/rules` now invokes SCons explicitly, passing arguments
 * the Lumiera Build-System is FSH aware and knows the proper installation locations
 * the setup of the application uses a setup configuration, shipped with the package
 * there is no need to ''compile-in any configuration''
   ** `LUMIERA_PLUGIN_PATH` is obsolete and unused since several years now
   ** `LUMIERA_CONFIG_PATH` was never used at all
   ** consequently, we also do not need `PKGLIBDIR` and `PKGDATADIR`
This commit is contained in:
Fischlurch 2025-11-16 02:09:24 +01:00
parent 741b8fe573
commit c8196ce234
3 changed files with 1471 additions and 36 deletions

View file

@ -43,8 +43,6 @@ def defineCmdlineVariables(buildVars):
# allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2)
,PathVariable('PREFIX', 'Installation dir prefix', 'usr/local', PathVariable.PathAccept)
,PathVariable('INSTALLDIR', 'Root output directory for install. Final installation will happen in INSTALLDIR/PREFIX/... ', '/', PathVariable.PathAccept)
,PathVariable('PKGLIBDIR', 'Installation dir for plugins, defaults to PREFIX/lib/lumiera/modules', '',PathVariable.PathAccept)
,PathVariable('PKGDATADIR', 'Installation dir for default config, usually PREFIX/share/lumiera', '',PathVariable.PathAccept)
)

View file

@ -82,11 +82,7 @@ def defineBuildEnvironment():
appendVal(env,'OPTIMIZE', 'CCFLAGS', val=' -O3')
appendVal(env,'DEBUG', 'CCFLAGS', val=' -ggdb')
# setup search path for Lumiera plugins
appendCppDefine(env,'PKGLIBDIR','LUMIERA_PLUGIN_PATH=\\"$PKGLIBDIR/:ORIGIN/modules\\"'
,'LUMIERA_PLUGIN_PATH=\\"ORIGIN/modules\\"')
appendCppDefine(env,'PKGDATADIR','LUMIERA_CONFIG_PATH=\\"$PKGLIBDIR/:.\\"'
,'LUMIERA_CONFIG_PATH=\\"$DESTDIR/share/lumiera/:.\\"')
# NOTE: could define optional copile features here....
Options.prepareOptionsHelp(buildVars,env)
buildVars.Save(OPTCACHE, env)

File diff suppressed because it is too large Load diff