File reproducible.patch of Package scons

Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
Date:   Sun Sep 25 18:38:04 2022 +0200

    Preserve SOURCE_DATE_EPOCH
    
    for reproducible builds.
    
    https://reproducible-builds.org/specs/source-date-epoch/
    says
    >  Build processes MUST NOT unset this variable for child processes if it is already present.
    
    Without this patch, openSUSE's games/globulation2 builds varied from
    a .cpp file with __TIME__ that should be normalized by g++ as we
    set SOURCE_DATE_EPOCH.
    
    Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>

Index: scons-src-3.1.2/src/engine/SCons/Environment.py
===================================================================
--- scons-src-3.1.2.orig/src/engine/SCons/Environment.py
+++ scons-src-3.1.2/src/engine/SCons/Environment.py
@@ -994,6 +994,8 @@ class Base(SubstitutionEnvironment):
         # should override any values set by the tools.
         for key, val in save.items():
             self._dict[key] = val
+        if 'SOURCE_DATE_EPOCH' in os.environ:
+            self._dict['ENV']['SOURCE_DATE_EPOCH'] = os.environ['SOURCE_DATE_EPOCH']
 
         # Finally, apply any flags to be merged in
         if parse_flags: self.MergeFlags(parse_flags)
openSUSE Build Service is sponsored by