scons: update to 4.4.0 (#7330)

Signed-off-by: Han Pengfei <pengphei@qq.com>

Signed-off-by: Han Pengfei <pengphei@qq.com>
This commit is contained in:
Han Pengfei
2022-10-31 17:14:49 +08:00
committed by GitHub
parent 0d6c79d60a
commit b7bcca446c
2 changed files with 380 additions and 0 deletions

View File

@@ -0,0 +1,293 @@
From 9c3663eb506294c8d47ebd5dcc850995d2997809 Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Fri, 9 Aug 2013 17:46:35 +0200
Subject: Add support for the Haiku platform
diff --git a/SCons/Platform/__init__.py b/SCons/Platform/__init__.py
index 3fa5a75..ba0bb3c 100644
--- a/SCons/Platform/__init__.py
+++ b/SCons/Platform/__init__.py
@@ -75,6 +75,8 @@ def platform_default():
return 'aix'
elif sys.platform.find('darwin') != -1:
return 'darwin'
+ elif sys.platform.find('haiku') != -1:
+ return 'haiku'
else:
return 'posix'
elif os.name == 'os2':
diff --git a/SCons/Platform/haiku.py b/SCons/Platform/haiku.py
new file mode 100644
index 0000000..3ea01f8
--- /dev/null
+++ b/SCons/Platform/haiku.py
@@ -0,0 +1,70 @@
+"""SCons.Platform.haiku
+
+Platform-specific initialization for Haiku systems.
+
+There normally shouldn't be any need to import this module directly. It
+will usually be imported through the generic SCons.Platform.Platform()
+selection method.
+"""
+
+#
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
+#
+# 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__ = ""
+
+import os
+import subprocess
+from . import posix
+
+def findDir(identifier):
+ return str(subprocess.check_output(['finddir', identifier], shell=False).rstrip())
+
+def generate(env):
+ posix.generate(env)
+
+ # determine, if building for the secondary architecture
+ secondaryArch = os.environ.get('HAIKU_SECONDARY_ARCH')
+ archSubDir = '/' + secondaryArch if secondaryArch else ''
+
+ # PATH
+ pathDescriptions = [
+ ('B_USER_NONPACKAGED_BIN_DIRECTORY', None),
+ ('B_USER_BIN_DIRECTORY', None),
+ ('B_SYSTEM_NONPACKAGED_BIN_DIRECTORY', None),
+ ('B_SYSTEM_BIN_DIRECTORY', None)
+ ]
+
+ paths = []
+ for pathConstant, subDir in pathDescriptions:
+ path = findDir(pathConstant)
+ if subDir:
+ path += '/' + subDir
+ paths.append(path)
+
+ paths.append('/bin')
+
+ if secondaryArch:
+ # prepend the secondary arch subdirectories
+ paths = [path + archSubDir for path in paths] + paths
+
+ env['ENV']['PATH'] = ':'.join(paths)
--
2.37.3
From 1f20a4918e666e2b4ac085a47c5ce00fe1c719de Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 27 Apr 2020 21:28:15 +0200
Subject: Haiku: add LIBRARY_PATH handling
diff --git a/site_scons/BuildCommandLine.py b/site_scons/BuildCommandLine.py
index 14bc279..6776d15 100644
--- a/site_scons/BuildCommandLine.py
+++ b/site_scons/BuildCommandLine.py
@@ -151,7 +151,7 @@ class BuildCommandLine:
# Re-exporting LD_LIBRARY_PATH is necessary if the Python version was
# built with the --enable-shared option.
self.ENV = {'PATH': os.environ['PATH']}
- for key in ['LOGNAME', 'PYTHONPATH', 'LD_LIBRARY_PATH']:
+ for key in ['LOGNAME', 'PYTHONPATH', 'LD_LIBRARY_PATH', 'LIBRARY_PATH']:
if key in os.environ:
self.ENV[key] = os.environ[key]
diff --git a/test/CC/SHCCFLAGS.py b/test/CC/SHCCFLAGS.py
index 71ed1c0..1277577 100644
--- a/test/CC/SHCCFLAGS.py
+++ b/test/CC/SHCCFLAGS.py
@@ -36,6 +36,8 @@ barflags = e['SHCCFLAGS'] + ' -DBAR'
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
+if sys.platform[:5] == 'haiku':
+ os.environ['LIBRARY_PATH'] = '.'
if sys.platform.find('irix') > -1:
os.environ['LD_LIBRARYN32_PATH'] = '.'
diff --git a/test/CC/SHCFLAGS.py b/test/CC/SHCFLAGS.py
index a691dba..5e1c89a 100644
--- a/test/CC/SHCFLAGS.py
+++ b/test/CC/SHCFLAGS.py
@@ -36,6 +36,8 @@ barflags = e['SHCFLAGS'] + ' -DBAR'
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
+if sys.platform[:5] == 'haiku':
+ os.environ['LIBRARY_PATH'] = '.'
if sys.platform.find('irix') > -1:
os.environ['LD_LIBRARYN32_PATH'] = '.'
diff --git a/test/CXX/CXXFLAGS.py b/test/CXX/CXXFLAGS.py
index 8d72708..ecfa985 100644
--- a/test/CXX/CXXFLAGS.py
+++ b/test/CXX/CXXFLAGS.py
@@ -38,6 +38,8 @@ _obj = TestSCons._obj
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
+if sys.platform[:5] == 'haiku':
+ os.environ['LIBRARY_PATH'] = '.'
if sys.platform.find('irix') > -1:
os.environ['LD_LIBRARYN32_PATH'] = '.'
diff --git a/test/CXX/SHCXXFLAGS.py b/test/CXX/SHCXXFLAGS.py
index 343be30..824e49f 100644
--- a/test/CXX/SHCXXFLAGS.py
+++ b/test/CXX/SHCXXFLAGS.py
@@ -37,6 +37,8 @@ _obj = TestSCons._obj
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
+if sys.platform[:5] == 'haiku':
+ os.environ['LIBRARY_PATH'] = '.'
if sys.platform.find('irix') > -1:
os.environ['LD_LIBRARYN32_PATH'] = '.'
diff --git a/test/LINK/VersionedLib-VariantDir.py b/test/LINK/VersionedLib-VariantDir.py
index 4a5ac40..b3eefef 100644
--- a/test/LINK/VersionedLib-VariantDir.py
+++ b/test/LINK/VersionedLib-VariantDir.py
@@ -96,6 +96,8 @@ if platform == 'cygwin' or platform == 'win32':
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = test.workpath('build/lib')
+if sys.platform.find('haiku') != -1:
+ os.environ['LIBRARY_PATH'] = test.workpath('build/lib')
if sys.platform.find('irix') != -1:
os.environ['LD_LIBRARYN32_PATH'] = test.workpath('build/lib')
diff --git a/test/LINK/VersionedLib-j2.py b/test/LINK/VersionedLib-j2.py
index 0cde91c..09fa82c 100644
--- a/test/LINK/VersionedLib-j2.py
+++ b/test/LINK/VersionedLib-j2.py
@@ -77,6 +77,8 @@ if platform == 'cygwin':
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = test.workpath('.')
+if sys.platform.find('haiku') != -1:
+ os.environ['LIBRARY_PATH'] = test.workpath('.')
if sys.platform.find('irix') != -1:
os.environ['LD_LIBRARYN32_PATH'] = test.workpath('.')
diff --git a/test/LINK/VersionedLib-subdir.py b/test/LINK/VersionedLib-subdir.py
index 66fef63..c82b268 100644
--- a/test/LINK/VersionedLib-subdir.py
+++ b/test/LINK/VersionedLib-subdir.py
@@ -88,6 +88,8 @@ if platform == 'cygwin' or platform == 'win32':
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = subdir
+if sys.platform.find('haiku') != -1:
+ os.environ['LIBRARY_PATH'] = subdir
if sys.platform.find('irix') != -1:
os.environ['LD_LIBRARYN32_PATH'] = subdir
diff --git a/test/Libs/SharedLibrary.py b/test/Libs/SharedLibrary.py
index cda9065..bb0af84 100644
--- a/test/Libs/SharedLibrary.py
+++ b/test/Libs/SharedLibrary.py
@@ -198,6 +198,8 @@ test.run(arguments = '.',
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
+if sys.platform.find('haiku') != -1:
+ os.environ['LIBRARY_PATH'] = '.'
if sys.platform.find('irix') != -1:
os.environ['LD_LIBRARYN32_PATH'] = '.'
diff --git a/test/LoadableModule.py b/test/LoadableModule.py
index 18a9c43..744eb84 100644
--- a/test/LoadableModule.py
+++ b/test/LoadableModule.py
@@ -112,6 +112,7 @@ test.run(arguments = '.',
if sys.platform in platforms_with_dlopen:
os.environ['LD_LIBRARY_PATH'] = test.workpath()
+ os.environ['LIBRARY_PATH'] = test.workpath()
test.run(program = test.workpath('dlopenprog'),
stdout = "f1.c\ndlopenprog.c\n")
diff --git a/test/NodeOps.py b/test/NodeOps.py
index a5300f1..d8499a8 100644
--- a/test/NodeOps.py
+++ b/test/NodeOps.py
@@ -42,6 +42,8 @@ from TestSCons import _exe, lib_, _lib, _obj, dll_, _dll
if os.name == 'posix':
os.environ['LD_LIBRARY_PATH'] = '.'
+if sys.platform[:5] == 'haiku':
+ os.environ['LIBRARY_PATH'] = '.'
if sys.platform.find('irix') > -1:
os.environ['LD_LIBRARYN32_PATH'] = '.'
diff --git a/test/Repository/SharedLibrary.py b/test/Repository/SharedLibrary.py
index 04ce1a5..0f1ee40 100644
--- a/test/Repository/SharedLibrary.py
+++ b/test/Repository/SharedLibrary.py
@@ -112,6 +112,8 @@ test.run(chdir='work',
if os.name == 'posix':
if sys.platform[:6] == 'darwin':
os.environ['DYLD_LIBRARY_PATH'] = test.workpath('work')
+ elif sys.platform[:5] == 'haiku':
+ os.environ['LIBRARY_PATH'] = test.workpath('work')
else:
os.environ['LD_LIBRARY_PATH'] = test.workpath('work')
if sys.platform.find('irix') != -1:
--
2.37.3
From 9436254077045567871ab78633b839300e5f85f2 Mon Sep 17 00:00:00 2001
From: Han Pengfei <pengphei@qq.com>
Date: Thu, 27 Oct 2022 10:15:59 +0000
Subject: Remove man page generated for package
Signed-off-by: Han Pengfei <pengphei@qq.com>
diff --git a/setup.cfg b/setup.cfg
index 941db34..8df6646 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -67,10 +67,10 @@ console_scripts =
SCons.Tool.docbook = *.*
-[options.data_files]
-. = scons.1
- scons-time.1
- sconsign.1
+#[options.data_files]
+#. = scons.1
+# scons-time.1
+# sconsign.1
[sdist]
dist_dir=build/dist
--
2.37.3

View File

@@ -0,0 +1,87 @@
SUMMARY="A software construction tool"
DESCRIPTION="SCons is an open-source software construction tool - that is, a \
next-generation build tool. Think of SCons as an improved, cross-platform \
substitute for the classic Make utility with integrated functionality similar \
to autoconf/automake and compiler caches such as ccache. In short, SCons is \
an easier, more reliable and faster way to build software."
HOMEPAGE="https://www.scons.org/"
COPYRIGHT="2001-2021 The SCons Foundation"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/scons/scons/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="b4fef9df167b16b94a91bcc3905c595a5768a433f2aee9abe7f4fffac201eeaa"
SOURCE_FILENAME="scons-$portVersion.tar.gz"
PATCHES="scons-$portVersion.patchset"
PYTHON_VERSION="3.9"
ARCHITECTURES="all"
PROVIDES="
scons = $portVersion compat >= 3
cmd:scons = $portVersion compat >= 3
cmd:scons_$portVersion = $portVersion compat >= 3
cmd:scons_configure_cache = $portVersion compat >= 3
cmd:scons_configure_cache_$portVersion = $portVersion compat >= 3
cmd:sconsign = $portVersion compat >= 3
cmd:sconsign_$portVersion = $portVersion compat >= 3
"
REQUIRES="
haiku
cmd:python$PYTHON_VERSION
"
BUILD_REQUIRES="
haiku_devel
setuptools_python39
wheel_python39
"
BUILD_PREREQUIRES="
cmd:python$PYTHON_VERSION
cmd:sed
"
TEST_REQUIRES="
cmd:gcc
cmd:python$PYTHON_VERSION
"
BUILD()
{
# GENERIC: all python_setuptools-based installs need this
python=$portPackageLinksDir/cmd~python$PYTHON_VERSION/bin/python$PYTHON_VERSION
# prepare scripts
for _script in scons{,ign,-configure-cache}; do
cp scripts/${_script}.py scripts/${_script}
done
(
$python scripts/scons.py doc/man
)
(
$python setup.py build
)
}
INSTALL()
{
# GENERIC: all python_setuptools-based installs need this
python=$portPackageLinksDir/cmd~python$PYTHON_VERSION/bin/python$PYTHON_VERSION
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
$python setup.py install \
--root=/ \
--prefix=$prefix
# Without psutil, we can't create man page
#mkdir -p $docDir
#mv $prefix/share/man $manDir
#rm -rf $prefix/share
}
TEST()
{
python$PYTHON_VERSION ./runtest.py -a -t
}