-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildenv
95 lines (83 loc) · 2.75 KB
/
buildenv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
export ZOPEN_BUILD_LINE="DEV"
export ZOPEN_DEV_URL="https://chromium.googlesource.com/chromium/tools/depot_tools.git"
export ZOPEN_DEV_DEPS="check_python"
export ZOPEN_RUNTIME_DEPS="check_python"
export ZOPEN_CATEGORIES="development"
export ZOPEN_BOOTSTRAP="python3"
# Nothing to configure or build:
export ZOPEN_CONFIGURE="skip"
export ZOPEN_MAKE="skip"
export ZOPEN_INSTALL="zopen_install"
# Set the python dir after buildenv deps are checked
zopen_pre_patch() {
export ZOPEN_PYTHONDIR=`type python3 | head -1 | sed "s:^.*[ (]/:/:;s:)$::"`
export ZOPEN_BOOTSTRAP_OPTS="bootstrap/bootstrap.py --bootstrap-name ${ZOPEN_PYTHONDIR}"
}
zopen_install() {
mkdir -p $ZOPEN_INSTALL_DIR
cp -r * $ZOPEN_INSTALL_DIR/ # modify to copy the relevant scripts
curdir=`pwd`
cd $ZOPEN_INSTALL_DIR
pax -p p -rzvf $curdir/../patches/cipd_binaries.pax.Z
cd $curdir
}
zopen_check_results()
{
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
# Echo the following information to gauge build health
echo "actualFailures:0"
echo "totalTests:1"
echo "expectedFailures:0"
echo "expectedTotalTests:1"
}
# zopen_append_env() creates a file with the settings below
# Its ${HOME}/usr/local/zopen/depot_tools/depot_tools-main/.appenv
zopen_append_to_env()
{
# echo envars outside of PATH, MANPATH, LIBPATH
# Disable updating depot_tools
echo "export DEPOT_TOOLS_UPDATE=0"
# Disable commands:
# * ensure_bootstrap
# * update_depot_tools
echo "export DEPOT_TOOLS_BOOTSTRAP_PYTHON3=0"
# Disable vpython3 (use python directly); see depot_tools/vpython3.
echo "export VPYTHON_BYPASS='manually managed python not supported by chrome operations'"
# Run the CIPD client that was built on z/OS; see depot_tools/cipd.
echo "export CUSTOM_CIPD_CLIENT=\$PWD/.cipd_client"
}
# Notes:
# zopen_append_to_setup() does:
# creates the dir: ${HOME}/zopen/usr/local/zopen/depot_tools
# during the `zopen build` process.
#
# during this stage the current working directory is
# ${HOME}/zopen/usr/local/zopen/depot_tools
#
# it creates/appends to the file setup.sh in that dir.
#
# Example buildenvs which use this portion of
# code are:
#
# https://github.com/ZOSOpenTools/sudoport/blob/main/buildenv#L49
#
# https://github.com/ZOSOpenTools/gpgport/blob/main/buildenv#L50
#
# Build workflow
# cd ~/zopen/dev/depot_toolsport
# rm -rf ~/.local ~/zopen/usr/local/zopen/depot_tools; rm -rf install depot_tools; zopen build
#
zopen_append_to_setup()
{
# echo commands that will run when installing via setup.sh
# At this time, ZOPEN_INSTAL_DIR is:
# ${HOME}/zopen/usr/local/zopen/depot_tools/depot_tools-main
}
zopen_get_version()
{
# Modify to echo the version of your tool/library
# Rather than hardcoding the version, obtain the version by running the tool/library
echo "1.0.0"
}