Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/scons/files/, dev-util/scons/
Date: Thu, 14 Oct 2021 09:13:54
Message-Id: 1634202701.6342804cddb5845db79f752a74f262ffd6f74cc7.sam@gentoo
1 commit: 6342804cddb5845db79f752a74f262ffd6f74cc7
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 14 09:11:41 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 14 09:11:41 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6342804c
7
8 dev-util/scons: Revert "Remove old" (restore 4.1.0 for now)
9
10 This reverts commit cfaacfcffc6895ebe3d021acedf2d71de76f7dc8.
11
12 Restore 4.1.0 for now because Mixxx can't build without it.
13
14 Bug: https://bugs.gentoo.org/806085
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 dev-util/scons/Manifest | 4 +
18 .../files/scons-4.0.0-respect-cc-etc-r1.patch | 88 +++++++++++++++++++
19 dev-util/scons/scons-4.1.0-r1.ebuild | 98 ++++++++++++++++++++++
20 3 files changed, 190 insertions(+)
21
22 diff --git a/dev-util/scons/Manifest b/dev-util/scons/Manifest
23 index 1a3cad8d5ab..b7a44b31276 100644
24 --- a/dev-util/scons/Manifest
25 +++ b/dev-util/scons/Manifest
26 @@ -1,3 +1,7 @@
27 +DIST scons-4.1.0-user.html 1454432 BLAKE2B 9fac4d7bfb4b25708bc4cc48d952beb030f88181af5dfee63090f726b1a82443c192c63ec5939869967ef8f374e8599321212971439fb265fb050b263681c9f8 SHA512 74f1349fa61dac9e66cfb863cb3126d07ce5f421b3e87d0220eb32bd5017ba8f6cf96eb8cb5ee45c39022671aa9f2d0408d4039970c438a69c002445aea510be
28 +DIST scons-4.1.0-user.pdf 2691364 BLAKE2B a910a09fa936d4d6f8dc967676d5aa009aac58a5a4566399b3ddc3512ac0259731e6c5399722fefadb3b79d8f89a5257e2e9bc2fa4d65697c8293ab995248d64 SHA512 64584731a59b59b78283be3876ecca91d742f83da2653d0de17922bec01e3c9cea1ce2ce3c8dc718597910ba86ed2c8aff0f7ae371bf763439b57a6d5484e1a7
29 +DIST scons-4.1.0.gh.tar.gz 5609204 BLAKE2B ede3d47a1ec652b9248681e26738073e9d01daab7ffeccc58f0fcadb79661e30edb9a35a511518e4a58459243acb027afd8fa5849b0f9e4bae451055f7b1a062 SHA512 f79b86bb09783767b3872cfb8efb665372714a604af2aaf3adc66eee63d3afe27bc6b2aab83813743c83f71c81c800d42842e916501787ba402ce2726dda9b44
30 +DIST scons-4.1.0.tar.gz 3007701 BLAKE2B 70ab64ecfd89fa2af1d78a33fcef82a5f7db9875ffe9d2c16ea75cf40e661b2874359e3a5f75d761b3d9e863f7a434560992cfb020cce3e21e389381331d90de SHA512 24fd493643545a2998b053ed0d68caf6241f05bc2437e7cbeae33d2e1c63517a61449a1a18062f8e4e5a639295a2486925296ba3e54ccfa2ecdd56fa07132de8
31 DIST scons-4.2.0-user.html 1514655 BLAKE2B 036fd0e994d4a3dbf820e864c18f1dda2bb383b890919b3d99ca02e4f1f319b86050bf094309764bbb01585075697549e3168d66ee02caeee0fe4ca641f794a5 SHA512 b0dcf8d6ff32521f2ce92372a7efce4962268d2ca40645ec4b0d082e5a29ba5098488ba45bf36c9fb7e75996c7454ab80536052f43b9a533a22db05f466cd3e9
32 DIST scons-4.2.0-user.pdf 2813567 BLAKE2B 2787c9dbecaefccc5f4df2bcccc474ee69e9883f9efa8358f6da00690d9f3fad48f7b696908cbb4cc8f3b9c195f86e11c81301d931783e463d7b2f3a5d528fc3 SHA512 3c36879af2b40190b7b68b162cb39e32e1d7ee01fe063dabe5404d616ab3c9972ebc8a6ce4c0b54a633cfc6825808f93207132ac9c9cd60d9e6ca28e864d5f16
33 DIST scons-4.2.0.gh.tar.gz 5677165 BLAKE2B c298152db937810ab73afc304a9dc480c185ef0d6e86be5ec7f2022a7d1ed4d3df6ecc18148c3143d4e76a7ea0e50790db1224e66db68bace0759daba7f36a91 SHA512 138573f7203b52fad0527d8d88ceabe182273eff7e4b74125e0d7eda51c44408b07e2c702ee63214519392101d8bbb30013e6d34000eaeb530a816c17396de97
34
35 diff --git a/dev-util/scons/files/scons-4.0.0-respect-cc-etc-r1.patch b/dev-util/scons/files/scons-4.0.0-respect-cc-etc-r1.patch
36 new file mode 100644
37 index 00000000000..d187a17ae60
38 --- /dev/null
39 +++ b/dev-util/scons/files/scons-4.0.0-respect-cc-etc-r1.patch
40 @@ -0,0 +1,88 @@
41 +From 929986e568446f54c2a99c309fbb4d05bd4af00a Mon Sep 17 00:00:00 2001
42 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
43 +Date: Thu, 10 May 2018 08:01:08 +0200
44 +Subject: [PATCH] posix: Also force common toolchain vars for Gentoo
45 +
46 +---
47 + src/SCons/Platform/posix.py | 20 ++++++++++++++++++++
48 + src/SCons/Tool/cc.py | 3 ++-
49 + src/SCons/Tool/cxx.py | 3 ++-
50 + src/SCons/Tool/link.py | 3 ++-
51 + 4 files changed, 26 insertions(+), 3 deletions(-)
52 +
53 +diff --git a/src/SCons/Platform/posix.py b/src/SCons/Platform/posix.py
54 +index 739310a1..ef7528e0 100644
55 +--- a/src/SCons/Platform/posix.py
56 ++++ b/src/SCons/Platform/posix.py
57 +@@ -95,6 +95,26 @@ def generate(env):
58 + if 'ENV' in env:
59 + new_env.update(env['ENV'])
60 + env['ENV'] = new_env
61 ++
62 ++ # Furthermore, force common compiler/linker variables as well
63 ++ envvar_mapping = {
64 ++ 'AR': 'AR',
65 ++ 'AS': 'AS',
66 ++ 'ASFLAGS': 'ASFLAGS',
67 ++ 'CC': 'CC',
68 ++ 'CXX': 'CXX',
69 ++ 'CFLAGS': 'CFLAGS',
70 ++ 'CXXFLAGS': 'CXXFLAGS',
71 ++ 'CPPFLAGS': 'CPPFLAGS',
72 ++ 'LDFLAGS': 'LINKFLAGS',
73 ++ }
74 ++
75 ++ for envvar, toolvar in envvar_mapping.items():
76 ++ if toolvar not in env and envvar in env['ENV']:
77 ++ val = env['ENV'][envvar]
78 ++ if toolvar.endswith('FLAGS'):
79 ++ val = SCons.Util.CLVar(val)
80 ++ env[toolvar] = val
81 + else:
82 + if 'ENV' not in env:
83 + env['ENV'] = {}
84 +diff --git a/src/SCons/Tool/cc.py b/src/SCons/Tool/cc.py
85 +index 590ec5fd..5f9229a0 100644
86 +--- a/src/SCons/Tool/cc.py
87 ++++ b/src/SCons/Tool/cc.py
88 +@@ -80,7 +80,8 @@ def generate(env):
89 +
90 + if 'CC' not in env:
91 + env['CC'] = env.Detect(compilers) or compilers[0]
92 +- env['CFLAGS'] = SCons.Util.CLVar('')
93 ++ if 'CFLAGS' not in env:
94 ++ env['CFLAGS'] = SCons.Util.CLVar('')
95 + env['CCCOM'] = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
96 + env['SHCC'] = '$CC'
97 + env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
98 +diff --git a/src/SCons/Tool/cxx.py b/src/SCons/Tool/cxx.py
99 +index 430851c8..ca5ab563 100644
100 +--- a/src/SCons/Tool/cxx.py
101 ++++ b/src/SCons/Tool/cxx.py
102 +@@ -74,7 +74,8 @@ def generate(env):
103 +
104 + if 'CXX' not in env:
105 + env['CXX'] = env.Detect(compilers) or compilers[0]
106 +- env['CXXFLAGS'] = SCons.Util.CLVar('')
107 ++ if 'CXXFLAGS' not in env:
108 ++ env['CXXFLAGS'] = SCons.Util.CLVar('')
109 + env['CXXCOM'] = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
110 + env['SHCXX'] = '$CXX'
111 + env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
112 +diff --git a/src/SCons/Tool/link.py b/src/SCons/Tool/link.py
113 +index 5adc6ca2..a12ea8ed 100644
114 +--- a/src/SCons/Tool/link.py
115 ++++ b/src/SCons/Tool/link.py
116 +@@ -318,7 +318,8 @@ def generate(env):
117 +
118 + env['SMARTLINK'] = smart_link
119 + env['LINK'] = "$SMARTLINK"
120 +- env['LINKFLAGS'] = SCons.Util.CLVar('')
121 ++ if 'LINKFLAGS' not in env:
122 ++ env['LINKFLAGS'] = SCons.Util.CLVar('')
123 +
124 + # __RPATH is only set to something ($_RPATH typically) on platforms that support it.
125 + env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
126 +--
127 +2.20.1
128 +
129
130 diff --git a/dev-util/scons/scons-4.1.0-r1.ebuild b/dev-util/scons/scons-4.1.0-r1.ebuild
131 new file mode 100644
132 index 00000000000..3f27b8197d8
133 --- /dev/null
134 +++ b/dev-util/scons/scons-4.1.0-r1.ebuild
135 @@ -0,0 +1,98 @@
136 +# Copyright 1999-2021 Gentoo Authors
137 +# Distributed under the terms of the GNU General Public License v2
138 +
139 +EAPI=7
140 +
141 +DISTUTILS_USE_SETUPTOOLS=rdepend
142 +PYTHON_COMPAT=( python3_{8..9} )
143 +PYTHON_REQ_USE="threads(+)"
144 +
145 +inherit distutils-r1
146 +
147 +DESCRIPTION="Extensible Python-based build utility"
148 +HOMEPAGE="https://www.scons.org/"
149 +SRC_URI="
150 + https://downloads.sourceforge.net/project/scons/scons/${PV}/${P}.tar.gz
151 + doc? (
152 + https://www.scons.org/doc/${PV}/PDF/${PN}-user.pdf -> ${P}-user.pdf
153 + https://www.scons.org/doc/${PV}/HTML/${PN}-user.html -> ${P}-user.html
154 + )
155 + test? ( https://github.com/scons/scons/archive/${PV}.tar.gz -> ${P}.gh.tar.gz )"
156 +
157 +LICENSE="MIT"
158 +SLOT="0"
159 +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
160 +IUSE="doc test"
161 +RESTRICT="!test? ( test )"
162 +
163 +BDEPEND="
164 + test? (
165 + dev-libs/libxml2[${PYTHON_USEDEP}]
166 + dev-python/lxml[${PYTHON_USEDEP}]
167 + )
168 +"
169 +
170 +S=${WORKDIR}/${P}/src
171 +
172 +PATCHES=(
173 + # support env passthrough for Gentoo ebuilds
174 + "${FILESDIR}"/scons-4.1.0-env-passthrough.patch
175 + # respect CC, CXX, C*FLAGS, LDFLAGS by default
176 + "${FILESDIR}"/scons-4.0.0-respect-cc-etc-r1.patch
177 +)
178 +
179 +src_unpack() {
180 + # use the git directory structure, but put pregenerated release
181 + # inside src/ subdirectory to make our life easier
182 + if use test; then
183 + unpack "${P}.gh.tar.gz"
184 + else
185 + mkdir -p "${P}"/src || die
186 + fi
187 +
188 + tar -C "${P}"/src --strip-components=1 -xzf "${DISTDIR}/${P}.tar.gz" || die
189 +}
190 +
191 +src_prepare() {
192 + # apply patches relatively to top directory
193 + cd "${WORKDIR}/${P}" || die
194 + distutils-r1_src_prepare
195 +
196 + # manpage install is completely broken
197 + sed -i -e '/build\/doc\/man/d' src/setup.cfg || die
198 +
199 + if use test; then
200 + local remove_tests=(
201 + # TODO: does not respect PATH?
202 + test/Clang
203 + # broken
204 + test/DVIPDF/DVIPDFFLAGS.py
205 + test/Java/swig-dependencies.py
206 + test/Java/multi-step.py
207 + )
208 + rm -r "${remove_tests[@]}" || die
209 + fi
210 +}
211 +
212 +python_test() {
213 + local -x COLUMNS=80
214 + # set variable from escons() of scons-util.eclass to make env-passthrough patch work within test env
215 + local -x GENTOO_SCONS_ENV_PASSTHROUGH=1
216 + # unset some env variables to pass appropriate tests
217 + unset AR AS ASFLAGS CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
218 + cd "${WORKDIR}/${P}" || die
219 + "${EPYTHON}" runtest.py -a --passed \
220 + -j "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
221 +
222 + # runtest.py script returns "0" if all tests are passed
223 + # and returns "2" if there are any tests with "no result"
224 + # (i.e. in case if some tools are not installed or it's Windows specific tests)
225 + [[ ${?} == [02] ]] || die "Tests fail with ${EPYTHON}"
226 +}
227 +
228 +python_install_all() {
229 + distutils-r1_python_install_all
230 +
231 + doman *.1
232 + use doc && dodoc "${DISTDIR}"/${P}-user.{pdf,html}
233 +}