2014-01-17 07:14:30 -05:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
export PYTHON_BUILD_CACHE_PATH="$TMP/cache"
|
|
|
|
export MAKE=make
|
|
|
|
export MAKE_OPTS="-j 2"
|
2014-11-03 03:33:44 -05:00
|
|
|
export CC=cc
|
2015-01-15 09:13:36 -05:00
|
|
|
export -n PYTHON_CONFIGURE_OPTS
|
2014-01-17 07:14:30 -05:00
|
|
|
|
|
|
|
setup() {
|
|
|
|
mkdir -p "$INSTALL_ROOT"
|
|
|
|
stub md5 false
|
2016-06-20 20:31:19 -04:00
|
|
|
stub curl false
|
2014-01-17 07:14:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
executable() {
|
|
|
|
local file="$1"
|
|
|
|
mkdir -p "${file%/*}"
|
|
|
|
cat > "$file"
|
|
|
|
chmod +x "$file"
|
|
|
|
}
|
|
|
|
|
|
|
|
cached_tarball() {
|
|
|
|
mkdir -p "$PYTHON_BUILD_CACHE_PATH"
|
|
|
|
pushd "$PYTHON_BUILD_CACHE_PATH" >/dev/null
|
|
|
|
tarball "$@"
|
|
|
|
popd >/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
tarball() {
|
|
|
|
local name="$1"
|
|
|
|
local path="$PWD/$name"
|
|
|
|
local configure="$path/configure"
|
|
|
|
shift 1
|
|
|
|
|
|
|
|
executable "$configure" <<OUT
|
|
|
|
#!$BASH
|
2022-10-29 15:48:13 -04:00
|
|
|
echo "$name: CPPFLAGS=\\"\$CPPFLAGS\\" LDFLAGS=\\"\$LDFLAGS\\" PKG_CONFIG_PATH=\\"\$PKG_CONFIG_PATH\\"" >> build.log
|
2014-01-17 07:14:30 -05:00
|
|
|
echo "$name: \$@" \${PYTHONOPT:+PYTHONOPT=\$PYTHONOPT} >> build.log
|
|
|
|
OUT
|
|
|
|
|
|
|
|
for file; do
|
|
|
|
mkdir -p "$(dirname "${path}/${file}")"
|
|
|
|
touch "${path}/${file}"
|
|
|
|
done
|
|
|
|
|
|
|
|
tar czf "${path}.tar.gz" -C "${path%/*}" "$name"
|
|
|
|
}
|
|
|
|
|
|
|
|
stub_make_install() {
|
|
|
|
stub "$MAKE" \
|
|
|
|
" : echo \"$MAKE \$@\" >> build.log" \
|
2014-02-08 05:31:35 -05:00
|
|
|
"install : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
2014-01-17 07:14:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
assert_build_log() {
|
|
|
|
run cat "$INSTALL_ROOT/build.log"
|
|
|
|
assert_output
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "yaml is installed for python" {
|
2014-04-09 08:23:46 -04:00
|
|
|
cached_tarball "yaml-0.1.6"
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
2014-01-17 07:14:30 -05:00
|
|
|
stub brew false
|
|
|
|
stub_make_install
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
install_fixture definitions/needs-yaml
|
|
|
|
assert_success
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2015-09-23 01:23:31 -04:00
|
|
|
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "apply python patch before building" {
|
2014-04-09 08:23:46 -04:00
|
|
|
cached_tarball "yaml-0.1.6"
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
2014-01-17 07:14:30 -05:00
|
|
|
stub brew false
|
|
|
|
stub_make_install
|
|
|
|
stub_make_install
|
2014-06-02 22:41:47 -04:00
|
|
|
stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log'
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2014-06-02 22:41:47 -04:00
|
|
|
TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<""
|
2014-01-17 07:14:30 -05:00
|
|
|
assert_success
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub make
|
|
|
|
unstub patch
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2015-09-23 01:23:31 -04:00
|
|
|
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-06-02 22:41:47 -04:00
|
|
|
patch -p0 --force -i $TMP/python-patch.XXX
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-06-02 22:41:47 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "apply python patch from git diff before building" {
|
|
|
|
cached_tarball "yaml-0.1.6"
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-06-02 22:41:47 -04:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
2014-06-02 22:41:47 -04:00
|
|
|
stub brew false
|
|
|
|
stub_make_install
|
|
|
|
stub_make_install
|
|
|
|
stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log'
|
|
|
|
|
|
|
|
TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<"diff --git a/script.py"
|
|
|
|
assert_success
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2014-06-02 22:41:47 -04:00
|
|
|
unstub make
|
|
|
|
unstub patch
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2015-09-23 01:23:31 -04:00
|
|
|
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
2014-06-02 22:41:47 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
patch -p1 --force -i $TMP/python-patch.XXX
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2021-10-25 21:36:01 -04:00
|
|
|
@test "homebrew with uncommon prefix is added to search path" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
BREW_PREFIX="$TMP/homebrew-prefix"
|
|
|
|
mkdir -p "$BREW_PREFIX"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
2021-10-25 21:36:01 -04:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
|
|
|
stub brew "--prefix : echo '$BREW_PREFIX'" false
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub sw_vers
|
2021-10-25 21:36:01 -04:00
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2021-10-25 21:36:01 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
@test "yaml is linked from Homebrew" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
|
|
|
brew_libdir="$TMP/homebrew-yaml"
|
|
|
|
mkdir -p "$brew_libdir"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
2021-09-20 00:43:08 -04:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
2021-10-25 21:36:01 -04:00
|
|
|
stub brew "--prefix libyaml : echo '$brew_libdir'"
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..5}; do stub brew false; done
|
2017-11-03 05:43:02 -04:00
|
|
|
stub_make_install
|
2016-10-04 20:45:21 -04:00
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
install_fixture definitions/needs-yaml
|
|
|
|
assert_success
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub sw_vers
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include" LDFLAGS="-L$brew_libdir/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "readline is linked from Homebrew" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
|
|
|
readline_libdir="$TMP/homebrew-readline"
|
|
|
|
mkdir -p "$readline_libdir"
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
2021-10-25 21:36:01 -04:00
|
|
|
for i in {1..2}; do stub brew false; done
|
|
|
|
stub brew "--prefix readline : echo '$readline_libdir'"
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..2}; do stub brew false; done
|
2014-01-17 07:14:30 -05:00
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-01-17 07:14:30 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include" LDFLAGS="-L$readline_libdir/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
@test "ncurses is linked from Homebrew" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
ncurses_libdir="$TMP/homebrew-ncurses"
|
|
|
|
mkdir -p "$ncurses_libdir"
|
|
|
|
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
|
|
|
for i in {1..3}; do stub brew false; done
|
|
|
|
stub brew "--prefix ncurses : echo '$ncurses_libdir'"
|
|
|
|
stub brew false
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
|
|
|
Python-3.6.2: CPPFLAGS="-I$ncurses_libdir/include -I${TMP}/install/include" LDFLAGS="-L$ncurses_libdir/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2023-07-28 08:23:39 -04:00
|
|
|
@test "openssl is linked from Ports in FreeBSD if present" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
|
|
|
|
stub uname '-r : echo 11.0-RELEASE'
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub uname '-s : echo FreeBSD'; done
|
2023-07-28 08:23:39 -04:00
|
|
|
stub sysctl '-n hw.ncpu : echo 1'
|
|
|
|
|
|
|
|
stub pkg "info -e openssl : true"
|
|
|
|
for in in {1..2}; do stub pkg false; done
|
|
|
|
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export -n MAKE_OPTS
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub make
|
|
|
|
unstub pkg
|
|
|
|
unstub sysctl
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --with-openssl=/usr/local
|
|
|
|
make -j 1
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2023-01-13 07:46:38 -05:00
|
|
|
@test "readline and sqlite3 are linked from Ports in FreeBSD" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
for lib in readline sqlite3; do
|
|
|
|
|
2023-01-18 16:21:10 -05:00
|
|
|
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
|
2023-01-13 07:46:38 -05:00
|
|
|
stub uname '-r : echo 11.0-RELEASE'
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub uname '-s : echo FreeBSD'; done
|
2023-01-13 07:46:38 -05:00
|
|
|
stub sysctl '-n hw.ncpu : echo 1'
|
|
|
|
|
2023-07-28 08:23:39 -04:00
|
|
|
stub pkg false
|
2023-01-13 07:46:38 -05:00
|
|
|
stub pkg "$([[ $lib == readline ]] && echo "info -e $lib : true" || echo false)"
|
2023-01-13 12:58:51 -05:00
|
|
|
if [[ $lib == sqlite3 ]]; then stub pkg "info -e $lib : true"; fi
|
2023-01-13 07:46:38 -05:00
|
|
|
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export -n MAKE_OPTS
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub make
|
|
|
|
unstub pkg
|
|
|
|
unstub sysctl
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I/usr/local/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib" PKG_CONFIG_PATH=""
|
2023-01-13 07:46:38 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
|
|
|
make -j 1
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
rm "$INSTALL_ROOT/build.log"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2024-02-18 17:38:02 -05:00
|
|
|
@test "homebrew is not touched if PYTHON_BUILD_SKIP_HOMEBREW is set" {
|
2022-02-09 10:55:23 -05:00
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2024-02-18 17:38:02 -05:00
|
|
|
for i in {1..4}; do stub uname '-s : echo Darwin'; done
|
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
stub brew true; brew
|
|
|
|
stub_make_install
|
2024-02-18 17:38:02 -05:00
|
|
|
export PYTHON_BUILD_SKIP_HOMEBREW=1
|
2022-02-09 10:55:23 -05:00
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2022-09-13 09:25:15 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2024-02-18 17:38:02 -05:00
|
|
|
@test "homebrew is used in Linux if PYTHON_BUILD_USE_HOMEBREW is set" {
|
2022-09-13 09:25:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2024-02-18 17:38:02 -05:00
|
|
|
BREW_PREFIX="$TMP/homebrew-prefix"
|
|
|
|
mkdir -p "$BREW_PREFIX"
|
|
|
|
|
|
|
|
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
|
|
|
stub brew "--prefix : echo '$BREW_PREFIX'"
|
|
|
|
for i in {1..4}; do stub brew false; done
|
|
|
|
stub_make_install
|
|
|
|
export PYTHON_BUILD_USE_HOMEBREW=1
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "homebrew is used in Linux if Pyenv is installed with Homebrew" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
BREW_PREFIX="$(type -p python-build)"
|
|
|
|
BREW_PREFIX="${BREW_PREFIX%/*}"
|
|
|
|
BREW_PREFIX="${BREW_PREFIX%/*}"
|
|
|
|
|
|
|
|
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
|
|
|
stub brew "--prefix : echo '$BREW_PREFIX'"
|
|
|
|
for i in {1..4}; do stub brew false; done
|
|
|
|
stub_make_install
|
|
|
|
export PYTHON_BUILD_USE_HOMEBREW=1
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "homebrew is not used in Linux if Pyenv is not installed with Homebrew" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
BREW_PREFIX="$TMP/homebrew-prefix"
|
|
|
|
mkdir -p "$BREW_PREFIX"
|
|
|
|
|
|
|
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
|
|
|
for i in {1..5}; do stub brew "--prefix : echo '$BREW_PREFIX'"; done
|
2022-09-13 09:25:15 -04:00
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2022-02-09 10:55:23 -05:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
@test "readline is not linked from Homebrew when explicitly defined" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2014-04-09 08:23:46 -04:00
|
|
|
# python-build
|
2014-01-17 07:14:30 -05:00
|
|
|
readline_libdir="$TMP/custom"
|
|
|
|
mkdir -p "$readline_libdir/include/readline"
|
|
|
|
touch "$readline_libdir/include/readline/rlconf.h"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
2017-11-03 05:43:02 -04:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..4}; do stub brew false; done
|
2014-01-17 07:14:30 -05:00
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib"
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-01-17 07:14:30 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2023-01-12 06:17:35 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2021-09-17 07:56:53 -04:00
|
|
|
@test "tcl-tk is linked from Homebrew" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
2021-10-16 07:51:39 -04:00
|
|
|
tcl_tk_version=8.6
|
2021-09-17 07:56:53 -04:00
|
|
|
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
2021-10-16 07:51:39 -04:00
|
|
|
mkdir -p "$tcl_tk_libdir/lib"
|
|
|
|
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
|
2021-09-17 07:56:53 -04:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
|
|
|
|
2021-10-16 07:51:39 -04:00
|
|
|
stub brew false
|
2021-10-25 21:36:01 -04:00
|
|
|
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'"; done
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub brew false; done
|
2022-02-09 10:55:23 -05:00
|
|
|
|
2021-09-17 07:56:53 -04:00
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
2021-09-17 07:56:53 -04:00
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib --with-tcltk-libs=-L${TMP}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version --with-tcltk-includes=-I${TMP}/homebrew-tcl-tk/include
|
2021-09-17 07:56:53 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "tcl-tk is not linked from Homebrew when explicitly defined" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
|
|
|
# python build
|
|
|
|
tcl_tk_version_long="8.6.10"
|
|
|
|
tcl_tk_version="${tcl_tk_version_long%.*}"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
2021-09-17 07:56:53 -04:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..5}; do stub brew false; done
|
2021-09-17 07:56:53 -04:00
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export PYTHON_CONFIGURE_OPTS="--with-tcltk-libs='-L${TMP}/custom-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version'"
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
2021-09-17 07:56:53 -04:00
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --with-tcltk-libs=-L${TMP}/custom-tcl-tk/lib -ltcl8.6 -ltk8.6
|
2021-09-17 07:56:53 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2022-10-29 15:48:13 -04:00
|
|
|
@test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
2022-10-29 15:48:13 -04:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
|
|
|
|
|
|
|
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
|
|
|
mkdir -p "$tcl_tk_libdir/lib"
|
|
|
|
|
|
|
|
stub brew false
|
|
|
|
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '${tcl_tk_libdir}'"; done
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub brew false; done
|
2022-10-29 15:48:13 -04:00
|
|
|
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub sw_vers
|
|
|
|
unstub brew
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib
|
2022-10-29 15:48:13 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
2014-01-17 07:14:30 -05:00
|
|
|
@test "number of CPU cores defaults to 2" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
2014-11-03 03:33:44 -05:00
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
stub sysctl false
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export -n MAKE_OPTS
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-01-17 07:14:30 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub sw_vers
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "number of CPU cores is detected on Mac" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
2016-10-04 20:32:33 -04:00
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
stub sysctl '-n hw.ncpu : echo 4'
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export -n MAKE_OPTS
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-01-17 07:14:30 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
2022-02-09 10:55:23 -05:00
|
|
|
unstub sw_vers
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub sysctl
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 4
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2014-10-29 06:35:29 -04:00
|
|
|
@test "number of CPU cores is detected on FreeBSD" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-10-29 06:35:29 -04:00
|
|
|
|
2023-01-18 16:21:10 -05:00
|
|
|
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname '-r : echo 11.0-RELEASE'
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub uname '-s : echo FreeBSD'; done
|
2023-07-28 08:23:39 -04:00
|
|
|
for i in {1..3}; do stub pkg false; done
|
2017-11-03 05:43:02 -04:00
|
|
|
|
2014-10-29 06:35:29 -04:00
|
|
|
stub sysctl '-n hw.ncpu : echo 1'
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export -n MAKE_OPTS
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-10-29 06:35:29 -04:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub sysctl
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-10-29 06:35:29 -04:00
|
|
|
make -j 1
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2014-02-08 05:31:35 -05:00
|
|
|
@test "setting PYTHON_MAKE_INSTALL_OPTS to a multi-word string" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-02-08 05:31:35 -05:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
2014-02-08 05:31:35 -05:00
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
stub_make_install
|
2016-10-04 20:45:21 -04:00
|
|
|
|
2014-02-08 05:31:35 -05:00
|
|
|
export PYTHON_MAKE_INSTALL_OPTS="DOGE=\"such wow\""
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-02-08 05:31:35 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2014-02-08 05:31:35 -05:00
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-02-08 05:31:35 -05:00
|
|
|
make -j 2
|
|
|
|
make install DOGE="such wow"
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2023-01-12 06:17:35 -05:00
|
|
|
@test "(PYTHON_)CONFIGURE_OPTS and (PYTHON_)MAKE_OPTS take priority over automatically added options" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
2023-01-12 06:17:35 -05:00
|
|
|
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export CONFIGURE_OPTS="--custom-configure"
|
|
|
|
export PYTHON_CONFIGURE_OPTS='--custom-python-configure'
|
|
|
|
export MAKE_OPTS="${MAKE_OPTS:+$MAKE_OPTS }--custom-make"
|
|
|
|
export PYTHON_MAKE_OPTS="--custom-python-make"
|
|
|
|
export PYTHON_MAKE_INSTALL_OPTS="--custom-make-install"
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2023-01-12 06:17:35 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --custom-configure --custom-python-configure
|
|
|
|
make -j 2 --custom-make --custom-python-make
|
|
|
|
make install --custom-make-install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2023-01-13 17:25:38 -05:00
|
|
|
@test "--enable-shared is not added if --disable-shared is passed" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
2023-01-13 17:25:38 -05:00
|
|
|
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export PYTHON_CONFIGURE_OPTS='--disable-shared'
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --disable-shared
|
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2022-09-23 05:16:39 -04:00
|
|
|
@test "configuring with dSYM in MacOS" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-02-08 05:31:35 -05:00
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
2022-09-23 05:16:39 -04:00
|
|
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..5}; do stub brew false; done
|
2017-11-03 05:43:02 -04:00
|
|
|
stub_make_install
|
2016-10-04 21:06:03 -04:00
|
|
|
|
2014-02-08 05:31:35 -05:00
|
|
|
run_inline_definition <<DEF
|
2022-09-23 05:16:39 -04:00
|
|
|
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-02-08 05:31:35 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2022-09-23 05:16:39 -04:00
|
|
|
unstub sw_vers
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2022-09-23 05:16:39 -04:00
|
|
|
unstub brew
|
2014-02-08 05:31:35 -05:00
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib --with-dsymutil
|
2014-02-08 05:31:35 -05:00
|
|
|
make -j 2
|
2022-09-23 05:16:39 -04:00
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "configuring with dSYM has no effect in non-MacOS" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
2022-09-23 05:16:39 -04:00
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
run_inline_definition <<DEF
|
|
|
|
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
|
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
unstub make
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib
|
2022-09-23 05:16:39 -04:00
|
|
|
make -j 2
|
|
|
|
make install
|
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
@test "custom relative install destination" {
|
|
|
|
export PYTHON_BUILD_CACHE_PATH="$FIXTURE_ROOT"
|
|
|
|
|
|
|
|
cd "$TMP"
|
|
|
|
install_fixture definitions/without-checksum ./here
|
|
|
|
assert_success
|
|
|
|
assert [ -x ./here/bin/package ]
|
|
|
|
}
|
|
|
|
|
2014-10-29 06:35:29 -04:00
|
|
|
@test "make on FreeBSD 9 defaults to gmake" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname "-s : echo FreeBSD" "-r : echo 9.1"
|
2023-01-18 16:21:10 -05:00
|
|
|
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname "-r : echo 9.1"
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub uname "-s : echo FreeBSD"; done
|
2014-11-03 03:33:44 -05:00
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
MAKE=gmake stub_make_install
|
2016-10-04 20:32:33 -04:00
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
MAKE= install_fixture definitions/vanilla-python
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub gmake
|
|
|
|
unstub uname
|
|
|
|
}
|
|
|
|
|
2014-10-29 06:35:29 -04:00
|
|
|
@test "make on FreeBSD 10" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-10-29 06:35:29 -04:00
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE"
|
2023-01-18 16:21:10 -05:00
|
|
|
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname "-r : echo 10.0-RELEASE"
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub uname "-s : echo FreeBSD"; done
|
2017-11-03 05:43:02 -04:00
|
|
|
|
2014-10-29 06:35:29 -04:00
|
|
|
stub_make_install
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
MAKE= install_fixture definitions/vanilla-python
|
|
|
|
assert_success
|
2014-11-03 03:33:44 -05:00
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "make on FreeBSD 11" {
|
|
|
|
cached_tarball "Python-3.6.2"
|
|
|
|
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname "-s : echo FreeBSD" "-r : echo 11.0-RELEASE"
|
2023-01-18 16:21:10 -05:00
|
|
|
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
2022-02-09 10:55:23 -05:00
|
|
|
stub uname "-r : echo 11.0-RELEASE"
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..3}; do stub uname "-s : echo FreeBSD"; done
|
2017-11-03 05:43:02 -04:00
|
|
|
|
|
|
|
stub_make_install
|
2016-10-04 20:32:33 -04:00
|
|
|
|
2014-10-29 06:35:29 -04:00
|
|
|
MAKE= install_fixture definitions/vanilla-python
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
unstub uname
|
|
|
|
}
|
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
@test "can use PYTHON_CONFIGURE to apply a patch" {
|
2017-09-10 22:02:15 -04:00
|
|
|
cached_tarball "Python-3.6.2"
|
2014-01-17 07:14:30 -05:00
|
|
|
|
|
|
|
executable "${TMP}/custom-configure" <<CONF
|
|
|
|
#!$BASH
|
|
|
|
apply -p1 -i /my/patch.diff
|
|
|
|
exec ./configure "\$@"
|
|
|
|
CONF
|
|
|
|
|
2023-10-05 23:59:29 -04:00
|
|
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
2014-01-17 07:14:30 -05:00
|
|
|
stub apply 'echo apply "$@" >> build.log'
|
|
|
|
stub_make_install
|
|
|
|
|
|
|
|
export PYTHON_CONFIGURE="${TMP}/custom-configure"
|
|
|
|
run_inline_definition <<DEF
|
2017-09-10 22:02:15 -04:00
|
|
|
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
2014-01-17 07:14:30 -05:00
|
|
|
DEF
|
|
|
|
assert_success
|
|
|
|
|
2017-11-03 05:43:02 -04:00
|
|
|
unstub uname
|
2014-01-17 07:14:30 -05:00
|
|
|
unstub make
|
|
|
|
unstub apply
|
|
|
|
|
|
|
|
assert_build_log <<OUT
|
|
|
|
apply -p1 -i /my/patch.diff
|
2023-01-18 16:21:10 -05:00
|
|
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
2022-12-23 02:55:13 -05:00
|
|
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
2014-01-17 07:14:30 -05:00
|
|
|
make -j 2
|
2014-02-08 05:31:35 -05:00
|
|
|
make install
|
2014-01-17 07:14:30 -05:00
|
|
|
OUT
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "copy strategy forces overwrite" {
|
|
|
|
export PYTHON_BUILD_CACHE_PATH="$FIXTURE_ROOT"
|
|
|
|
|
|
|
|
mkdir -p "$INSTALL_ROOT/bin"
|
|
|
|
touch "$INSTALL_ROOT/bin/package"
|
|
|
|
chmod -w "$INSTALL_ROOT/bin/package"
|
|
|
|
|
|
|
|
install_fixture definitions/without-checksum
|
|
|
|
assert_success
|
|
|
|
|
|
|
|
run "$INSTALL_ROOT/bin/package" "world"
|
|
|
|
assert_success "hello world"
|
|
|
|
}
|
|
|
|
|
2014-11-03 03:33:44 -05:00
|
|
|
@test "mruby strategy overwrites non-writable files" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "mruby strategy fetches rake if missing" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "rbx uses bundle then rake" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "fixes rbx binstubs" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "JRuby build" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "JRuby+Graal does not install launchers" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
2015-01-15 09:13:36 -05:00
|
|
|
@test "JRuby Java 7 missing" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "JRuby Java is outdated" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "JRuby Java 7 up-to-date" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
2015-05-26 12:05:46 -04:00
|
|
|
@test "Java version string not on first line" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Java version string on OpenJDK" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
2018-04-25 20:56:08 -04:00
|
|
|
@test "JRuby Java 9 version string" {
|
|
|
|
# nop
|
|
|
|
}
|
|
|
|
|
2014-01-17 07:14:30 -05:00
|
|
|
@test "non-writable TMPDIR aborts build" {
|
|
|
|
export TMPDIR="${TMP}/build"
|
|
|
|
mkdir -p "$TMPDIR"
|
|
|
|
chmod -w "$TMPDIR"
|
|
|
|
|
|
|
|
touch "${TMP}/build-definition"
|
|
|
|
run python-build "${TMP}/build-definition" "$INSTALL_ROOT"
|
|
|
|
assert_failure "python-build: TMPDIR=$TMPDIR is set to a non-accessible location"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "non-executable TMPDIR aborts build" {
|
|
|
|
export TMPDIR="${TMP}/build"
|
|
|
|
mkdir -p "$TMPDIR"
|
|
|
|
chmod -x "$TMPDIR"
|
|
|
|
|
|
|
|
touch "${TMP}/build-definition"
|
|
|
|
run python-build "${TMP}/build-definition" "$INSTALL_ROOT"
|
|
|
|
assert_failure "python-build: TMPDIR=$TMPDIR is set to a non-accessible location"
|
|
|
|
}
|