diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/tools/build.sh | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/tools/build.sh')
-rwxr-xr-x | testing/web-platform/tests/css/tools/build.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/tools/build.sh b/testing/web-platform/tests/css/tools/build.sh new file mode 100755 index 0000000000..326fe632a8 --- /dev/null +++ b/testing/web-platform/tests/css/tools/build.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env sh +set -ex + +SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P) + +main() { + cd $SCRIPT_DIR + + if [ -z $VENV ]; then + VENV=_virtualenv + fi + + # Create the virtualenv + if [ ! -d $VENV ]; then + if [ -z $PYTHON ]; then + command -v python + if [ $? -eq 0 ]; then + if [ `python -c 'import sys; print(sys.version[0:3])'` == "2.7" ]; then + PYTHON=python + fi + fi + fi + + if [ -z $PYTHON ]; then + command -v python2 + if [ $? -eq 0 ]; then + PYTHON=python2 + fi + fi + + if [ -z $PYTHON ]; then + echo "Please ensure Python 2.7 is installed" + exit 1 + fi + + # The maximum Unicode code point is U+10FFFF = 1114111 + if [ `$PYTHON -c 'import sys; print(sys.maxunicode)'` != "1114111" ]; then + echo "UCS-4 support for Python is required" + exit 1 + fi + + virtualenv -p $PYTHON $VENV || { echo "Please ensure virtualenv is installed"; exit 2; } + fi + + # Install dependencies + $VENV/bin/pip install -r requirements.txt + + # Run the build script + $VENV/bin/python build.py "$@" +} + +main "$@" |