thezbyg / gpick

Advanced color picker written in C++ using GTK+ toolkit
BSD 3-Clause "New" or "Revised" License
376 stars 33 forks source link

NameError: name 'SCons' is not defined #216

Closed ryandesign closed 1 year ago

ryandesign commented 1 year ago

Trying to build gpick 0.3 release tarball with scons, after fixing #215, if I specify CFLAGS as in CFLAGS=-Os scons it fails:

scons: Reading SConscript files ...
NameError: name 'SCons' is not defined:
  File "/opt/local/var/macports/build/_Volumes_Shared_macports-ports_graphics_gpick/gpick/work/gpick-0.3/SConstruct", line 2:
    SConscript(['SConscript'], variant_dir = 'build', duplicate = 0)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 662:
    return method(*args, **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/opt/local/var/macports/build/_Volumes_Shared_macports-ports_graphics_gpick/gpick/work/gpick-0.3/SConscript", line 54:
    env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
thezbyg commented 1 year ago

SConscript file is missing SCons.Util import. This can be fixed by adding import SCons.Util after other imports.

ryandesign commented 1 year ago

adding import SCons.Util after other imports

Thanks, I agree that fixes it.