From 1a0a443ae67c0440844f50a69f772a4b8cbdfe50bb3abd0b4d3b334311d52a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 3 Nov 2017 11:34:01 +0000 Subject: [PATCH 1/6] Accepting request 538655 from home:pluskalm:branches:devel:tools:building - Switch to python3 OBS-URL: https://build.opensuse.org/request/show/538655 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=50 --- scons.changes | 5 +++++ scons.spec | 29 ++++++----------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/scons.changes b/scons.changes index 0f084fd..e7a77e2 100644 --- a/scons.changes +++ b/scons.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Nov 3 11:22:45 UTC 2017 - mpluskal@suse.com + +- Switch to python3 + ------------------------------------------------------------------- Wed Oct 4 19:09:07 UTC 2017 - astieger@suse.com diff --git a/scons.spec b/scons.spec index adaa149..9b45a89 100644 --- a/scons.spec +++ b/scons.spec @@ -16,11 +16,6 @@ # -# Potential build fix for SLE11 SLE11SP1 -%if 0%{?suse_version} <= 1120 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%endif Name: scons Version: 3.0.0 Release: 0 @@ -35,14 +30,8 @@ Source1: scons-user.html-%{version}.tar.bz2 Patch0: %{name}-3.0.0-fix-install.patch Patch1: scons-3.0.0-support-python-2-prints.patch BuildRequires: fdupes -BuildRequires: python-devel >= 2.7 -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} > 1110 +BuildRequires: python3-devel >= 3.5 BuildArch: noarch -%endif -%if 0%{?suse_version} >= 1110 -%py_requires -%endif %description SCons is a make replacement that provides a range of enhanced features, @@ -65,26 +54,20 @@ patch -p0 < Date: Mon, 6 Nov 2017 10:17:42 +0000 Subject: [PATCH 2/6] Accepting request 539227 from home:pluskalm:python3 - Add scons-fix_py3_syspath_explosion.patch OBS-URL: https://build.opensuse.org/request/show/539227 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=51 --- scons-fix_py3_syspath_explosion.patch | 40 +++++++++++++++++++++++++++ scons.changes | 5 ++++ scons.spec | 3 ++ 3 files changed, 48 insertions(+) create mode 100644 scons-fix_py3_syspath_explosion.patch diff --git a/scons-fix_py3_syspath_explosion.patch b/scons-fix_py3_syspath_explosion.patch new file mode 100644 index 0000000..1a19c66 --- /dev/null +++ b/scons-fix_py3_syspath_explosion.patch @@ -0,0 +1,40 @@ +From 874dba0c35cd8f6459ddbdfcdaf8be12307cd038 Mon Sep 17 00:00:00 2001 +From: William Deegan +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 diff --git a/scons.changes b/scons.changes index e7a77e2..f8526d6 100644 --- a/scons.changes +++ b/scons.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 6 08:40:54 UTC 2017 - mpluskal@suse.com + +- Add scons-fix_py3_syspath_explosion.patch + ------------------------------------------------------------------- Fri Nov 3 11:22:45 UTC 2017 - mpluskal@suse.com diff --git a/scons.spec b/scons.spec index 9b45a89..578706b 100644 --- a/scons.spec +++ b/scons.spec @@ -29,6 +29,8 @@ 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 @@ -44,6 +46,7 @@ full power of Python to control compilation. %setup -q -a1 %patch0 -p1 %patch1 -p1 +%patch2 -p2 # fix libdir for qt patch -p0 < Date: Wed, 15 Nov 2017 15:57:05 +0000 Subject: [PATCH 3/6] 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 --- scons-3.0.0-support-python-2-prints.patch | 91 ----------------------- scons-3.0.0.tar.gz | 3 - scons-3.0.1.tar.gz | 3 + scons-fix_py3_syspath_explosion.patch | 40 ---------- scons-user.html-3.0.0.tar.bz2 | 3 - scons-user.html-3.0.1.tar.bz2 | 3 + scons.changes | 13 +++- scons.spec | 7 +- 8 files changed, 18 insertions(+), 145 deletions(-) delete mode 100644 scons-3.0.0-support-python-2-prints.patch delete mode 100644 scons-3.0.0.tar.gz create mode 100644 scons-3.0.1.tar.gz delete mode 100644 scons-fix_py3_syspath_explosion.patch delete mode 100644 scons-user.html-3.0.0.tar.bz2 create mode 100644 scons-user.html-3.0.1.tar.bz2 diff --git a/scons-3.0.0-support-python-2-prints.patch b/scons-3.0.0-support-python-2-prints.patch deleted file mode 100644 index 5e1b659..0000000 --- a/scons-3.0.0-support-python-2-prints.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 2e0de3c55f22b3eaa7767b69740b898f3d2f46bf Mon Sep 17 00:00:00 2001 -From: Thomas Berg -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: diff --git a/scons-3.0.0.tar.gz b/scons-3.0.0.tar.gz deleted file mode 100644 index 2a5c3fc..0000000 --- a/scons-3.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f532f405b98c60b731d231b3c503ab5bf47d89a6f66f70cb62c9249e9f45216 -size 630418 diff --git a/scons-3.0.1.tar.gz b/scons-3.0.1.tar.gz new file mode 100644 index 0000000..396bd0c --- /dev/null +++ b/scons-3.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173 +size 634815 diff --git a/scons-fix_py3_syspath_explosion.patch b/scons-fix_py3_syspath_explosion.patch deleted file mode 100644 index 1a19c66..0000000 --- a/scons-fix_py3_syspath_explosion.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 874dba0c35cd8f6459ddbdfcdaf8be12307cd038 Mon Sep 17 00:00:00 2001 -From: William Deegan -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 diff --git a/scons-user.html-3.0.0.tar.bz2 b/scons-user.html-3.0.0.tar.bz2 deleted file mode 100644 index ed72fa1..0000000 --- a/scons-user.html-3.0.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e0198ce5b1b561a8ba6887be2b9eb38dac3c7b56d269188a9740252c3fdfe51 -size 153266 diff --git a/scons-user.html-3.0.1.tar.bz2 b/scons-user.html-3.0.1.tar.bz2 new file mode 100644 index 0000000..e47ebe0 --- /dev/null +++ b/scons-user.html-3.0.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85123f0fb5c34c2bec170baf19790a0ea51252abae1fdb94d587c7b0f1e798da +size 154780 diff --git a/scons.changes b/scons.changes index f8526d6..7e666cc 100644 --- a/scons.changes +++ b/scons.changes @@ -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 diff --git a/scons.spec b/scons.spec index 578706b..8221bb0 100644 --- a/scons.spec +++ b/scons.spec @@ -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 < Date: Wed, 15 Nov 2017 16:29:53 +0000 Subject: [PATCH 4/6] - Packaging changes: * drop scons-3.0.0-support-python-2-prints.patch, now upstream * Restore python2 support for SLE 12 and Leap 42.x OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=53 --- scons.changes | 6 ++++-- scons.spec | 28 +++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/scons.changes b/scons.changes index 7e666cc..793422a 100644 --- a/scons.changes +++ b/scons.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Wed Nov 15 15:42:30 UTC 2017 - astieger@suse.com +Wed Nov 15 16:28:48 UTC 2017 - astieger@suse.com - SCons 3.0.1: * Fix return value handling in to_String_for_subst() @@ -10,7 +10,9 @@ Wed Nov 15 15:42:30 UTC 2017 - astieger@suse.com 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 +- Packaging changes: + * drop scons-3.0.0-support-python-2-prints.patch, now upstream + * Restore python2 support for SLE 12 and Leap 42.x ------------------------------------------------------------------- Fri Nov 3 11:22:45 UTC 2017 - mpluskal@suse.com diff --git a/scons.spec b/scons.spec index 8221bb0..e68e07b 100644 --- a/scons.spec +++ b/scons.spec @@ -16,6 +16,7 @@ # +%define with_python3 (0%{?suse_version} > 1320) Name: scons Version: 3.0.1 Release: 0 @@ -29,8 +30,12 @@ Source1: scons-user.html-%{version}.tar.bz2 # Sets _mandir to _datadir/man instead of _prefix/man Patch0: %{name}-3.0.0-fix-install.patch BuildRequires: fdupes -BuildRequires: python3-devel >= 3.5 BuildArch: noarch +%if %{with_python3} +BuildRequires: python3-devel >= 3.5 +%else +BuildRequires: python-devel >= 2.7 +%endif %description SCons is a make replacement that provides a range of enhanced features, @@ -52,20 +57,41 @@ patch -p0 < Date: Fri, 24 Nov 2017 11:37:37 +0000 Subject: [PATCH 5/6] Accepting request 545072 from home:pluskalm:python3 - Explicitly require python3 for python3 version of scons as dependency does not get generated automatically OBS-URL: https://build.opensuse.org/request/show/545072 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=54 --- scons.changes | 6 ++++++ scons.spec | 1 + 2 files changed, 7 insertions(+) diff --git a/scons.changes b/scons.changes index 793422a..763787d 100644 --- a/scons.changes +++ b/scons.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 24 08:48:43 UTC 2017 - mpluskal@suse.com + +- Explicitly require python3 for python3 version of scons as + dependency does not get generated automatically + ------------------------------------------------------------------- Wed Nov 15 16:28:48 UTC 2017 - astieger@suse.com diff --git a/scons.spec b/scons.spec index e68e07b..1b9321e 100644 --- a/scons.spec +++ b/scons.spec @@ -33,6 +33,7 @@ BuildRequires: fdupes BuildArch: noarch %if %{with_python3} BuildRequires: python3-devel >= 3.5 +Requires: python3 >= 3.5 %else BuildRequires: python-devel >= 2.7 %endif From d1d3fa8dd3baf4442710c1c72ae5407d4c70fa310d4e0f5ff14701c8def4ca1b Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 24 Nov 2017 13:09:38 +0000 Subject: [PATCH 6/6] Accepting request 545188 from home:pluskalm:python3 OBS-URL: https://build.opensuse.org/request/show/545188 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=55 --- scons.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scons.spec b/scons.spec index 1b9321e..d4608bb 100644 --- a/scons.spec +++ b/scons.spec @@ -33,7 +33,7 @@ BuildRequires: fdupes BuildArch: noarch %if %{with_python3} BuildRequires: python3-devel >= 3.5 -Requires: python3 >= 3.5 +Requires: python3-base >= 3.5 %else BuildRequires: python-devel >= 2.7 %endif