Accepting request 542078 from home:AndreasStieger:branches:devel:tools:building

SCons 3.0.1

OBS-URL: https://build.opensuse.org/request/show/542078
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=52
This commit is contained in:
Andreas Stieger 2017-11-15 15:57:05 +00:00 committed by Git OBS Bridge
parent 37db095af1
commit 67629dcac3
8 changed files with 18 additions and 145 deletions

View File

@ -1,91 +0,0 @@
From 2e0de3c55f22b3eaa7767b69740b898f3d2f46bf Mon Sep 17 00:00:00 2001
From: Thomas Berg <merlin66b@gmail.com>
Date: Wed, 20 Sep 2017 13:24:22 +0200
Subject: [PATCH] Support python 2 print statements in SConscripts
This fixes a regression introduced in scons-3.0.0, where
SConscripts containing python 2 print statements would cause
syntax errors even when executing scons with python 2.7.
This ensures backward compatibility, allowing users to build
legacy code with scons-3.0.0 without having to patch it.
---
src/engine/SCons/Script/SConscript.py | 2 --
test/print_statement.py | 56 +++++++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+), 2 deletions(-)
create mode 100644 test/print_statement.py
Index: scons-3.0.0/engine/SCons/Script/SConscript.py
===================================================================
--- scons-3.0.0.orig/engine/SCons/Script/SConscript.py
+++ scons-3.0.0/engine/SCons/Script/SConscript.py
@@ -5,8 +5,6 @@ files.
"""
-from __future__ import print_function
-
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
Index: scons-3.0.0/print_statement.py
===================================================================
--- /dev/null
+++ scons-3.0.0/print_statement.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import sys
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+
+test.write('SConstruct', """\
+print('python 3 style statement')
+Exit(0)
+""")
+
+test.run()
+
+test.write('SConstruct', """\
+print 'python 2 style statement'
+Exit(0)
+""")
+
+if sys.version_info >= (3,0):
+ test.skip_test('Python 2 print statement test, skipping on Python 3.\n')
+else:
+ test.run()
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f532f405b98c60b731d231b3c503ab5bf47d89a6f66f70cb62c9249e9f45216
size 630418

3
scons-3.0.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173
size 634815

View File

@ -1,40 +0,0 @@
From 874dba0c35cd8f6459ddbdfcdaf8be12307cd038 Mon Sep 17 00:00:00 2001
From: William Deegan <bill@baddogconsulting.com>
Date: Thu, 12 Oct 2017 23:13:49 -0400
Subject: [PATCH] Fix issue with Tool loading logic where sys.path was getting
an addition site_scons/site_tools path prepended with every tool loaded when
running with Python 3.5+.
---
src/engine/SCons/Tool/__init__.py | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 57090bbe..a4e44a0f 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -222,8 +222,10 @@ def _tool_module(self):
# Don't reload a tool we already loaded.
sys_modules_value = sys.modules.get(found_name,False)
+
+ found_module = None
if sys_modules_value and sys_modules_value.__file__ == spec.origin:
- return sys.modules[found_name]
+ found_module = sys.modules[found_name]
else:
# Not sure what to do in the case that there already
# exists sys.modules[self.name] but the source file is
@@ -235,7 +237,11 @@ def _tool_module(self):
# If we found it in SCons.Tool, then add it to the module
setattr(SCons.Tool, self.name, module)
- return module
+ found_module = module
+
+ if found_module is not None:
+ sys.path = oldpythonpath
+ return found_module
sys.path = oldpythonpath

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3e0198ce5b1b561a8ba6887be2b9eb38dac3c7b56d269188a9740252c3fdfe51
size 153266

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:85123f0fb5c34c2bec170baf19790a0ea51252abae1fdb94d587c7b0f1e798da
size 154780

View File

@ -1,7 +1,16 @@
-------------------------------------------------------------------
Mon Nov 6 08:40:54 UTC 2017 - mpluskal@suse.com
Wed Nov 15 15:42:30 UTC 2017 - astieger@suse.com
- Add scons-fix_py3_syspath_explosion.patch
- SCons 3.0.1:
* Fix return value handling in to_String_for_subst()
* Fixe Variables.GenerateHelpText() to now use the sort parameter
* Fix Tool loading logic from exploding sys.path with many
site_scons/site_tools prepended on py3.
* Add additional output with time to process each SConscript file
when using --debug=time.
* Fix broken subst logic with "$$([...])"
* Java/Jar building improvements and fixes
- drop scons-3.0.0-support-python-2-prints.patch, now upstream
-------------------------------------------------------------------
Fri Nov 3 11:22:45 UTC 2017 - mpluskal@suse.com

View File

@ -17,7 +17,7 @@
Name: scons
Version: 3.0.0
Version: 3.0.1
Release: 0
Summary: Replacement for Make
License: MIT
@ -28,9 +28,6 @@ Source0: http://prdownloads.sourceforge.net/scons/%{name}-%{version}.tar.
Source1: scons-user.html-%{version}.tar.bz2
# Sets _mandir to _datadir/man instead of _prefix/man
Patch0: %{name}-3.0.0-fix-install.patch
Patch1: scons-3.0.0-support-python-2-prints.patch
# PATCH-FIX-UPSTREAM scons-fix_py3_syspath_explosion.patch
Patch2: scons-fix_py3_syspath_explosion.patch
BuildRequires: fdupes
BuildRequires: python3-devel >= 3.5
BuildArch: noarch
@ -45,8 +42,6 @@ full power of Python to control compilation.
%prep
%setup -q -a1
%patch0 -p1
%patch1 -p1
%patch2 -p2
# fix libdir for qt
patch -p0 <<EOF