forked from zopencommunity/bashport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildenv
59 lines (51 loc) · 2.18 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
# bump: bash-version /BASH_VERSION="(.*)"/ https://ftp.gnu.org/gnu/bash/|re:/href="bash-([\d.]+).tar.gz"/$1/|semver:*
BASH_VERSION="5.2.21"
export ZOPEN_BUILD_LINE="STABLE" # default build level is stable
export ZOPEN_STABLE_URL="https://ftp.gnu.org/gnu/bash/bash-${BASH_VERSION}.tar.gz"
export ZOPEN_STABLE_DEPS="curl gzip tar make zoslib coreutils diffutils sed ncurses grep gettext"
export ZOPEN_DEV_URL="https://github.com/bminor/bash.git"
export ZOPEN_DEV_DEPS="perl m4 autoconf curl gzip tar make zoslib coreutils diffutils sed ncurses bison grep gettext"
export ZOPEN_DEV_BRANCH="devel"
export ZOPEN_EXTRA_CPPFLAGS="-DNO_MAIN_ENV_ARG=1 -DSSH_SOURCE_BASHRC=1 -DSYS_BASHRC='\\\"/etc/bashrc\\\"' -DNON_INTERACTIVE_LOGIN_SHELLS=1"
export ZOPEN_COMP=CLANG
zopen_post_buildenv()
{
if [ "${ZOPEN_BUILD_LINE}x" = "DEVx" ]; then
export ZOPEN_EXTRA_CONFIGURE_OPTS="--without-libintl-prefix --disable-nls"
export ZOPEN_MAKE_OPTS="-j\$ZOPEN_NUM_JOBS LOCAL_LIBS=\"\$LIBS\" LIBS_FOR_BUILD=\"\$LIBS\""
export ZOPEN_CHECK_OPTS="-j\$ZOPEN_NUM_JOBS check LOCAL_LIBS=\"\$LIBS\" LIBS_FOR_BUILD=\"\$LIBS\""
export ZOPEN_INSTALL_OPTS="-j\$ZOPEN_NUM_JOBS install LOCAL_LIBS=\"\$LIBS\" LIBS_FOR_BUILD=\"\$LIBS\""
fi
}
zopen_check_results()
{
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
if [ "${ZOPEN_BUILD_LINE}x" = "DEVx" ]; then
failures=$(grep "Total # of failures:" $chk | cut -d' ' -f5)
successes=$(grep "Total # of successes:" $chk | cut -d' ' -f5)
total=$((successes+failures))
else
failuretests=$(/bin/find tests/ -name "*.output" ! -size 0)
failures=$(echo "${failuretests}" | wc -l)
total=$(/bin/find tests/ -name "*.output" | wc -l)
fi
# Echo the following information to gauge build health
echo "${failuretests}" >"$1/$2_check_failures.log"
echo "actualFailures:$failures"
echo "totalTests:$total"
if [ "${ZOPEN_BUILD_LINE}x" = "DEVx" ]; then
echo "expectedFailures:18" # Slightly higher in DEV
else
echo "expectedFailures:15"
fi
}
zopen_append_to_zoslib_env() {
cat <<EOF
ASCII_TERMINFO|set|PROJECT_ROOT/../../ncurses/ncurses/share/terminfo/
EOF
}
zopen_get_version() {
./bash --version | head -1 | awk -F" " '{print $4}' | awk -F"(" '{print $1}'
}