Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
tox.ini: Move homebrew environment settings to script .homebrew-build…
Browse files Browse the repository at this point in the history
…-env
  • Loading branch information
Matthias Koeppe committed Mar 19, 2020
1 parent 2553b5a commit 2f79c76
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
36 changes: 36 additions & 0 deletions .homebrew-build-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Source this -*- shell-script -*- to set some environment variables
# that activate keg-only homebrew package installations

HOMEBREW=`brew --prefix` || return 1
for l in gettext; do
if [ -d "$HOMEBREW/opt/$l/bin" ]; then
PATH="$HOMEBREW/opt/$l/bin:$PATH"
fi
done
export PATH
PKG_CONFIG_PATH="$HOMEBREW/lib/pkgconfig:$PKG_CONFIG_PATH"
# libpng.pc depends on zlib.pc
for l in openblas openssl readline sqlite zlib; do
if [ -d "$HOMEBREW/opt/$l/lib/pkgconfig" ]; then
PKG_CONFIG_PATH="$HOMEBREW/opt/$l/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
done
export PKG_CONFIG_PATH
LDFLAGS="-L$HOMEBREW/lib $LDFLAGS"
CPPFLAGS="-I$HOMEBREW/include $CPPFLAGS"
for l in readline; do
if [ -d "$HOMEBREW/opt/$l/lib" ]; then
LDFLAGS="-L$HOMEBREW/opt/$l/lib $LDFLAGS"
fi
if [ -d "$HOMEBREW/opt/$l/include" ]; then
CPPFLAGS="-I$HOMEBREW/opt/$l/include $CPPFLAGS"
fi
done
export LDFLAGS
export CPPFLAGS
for l in gettext; do
if [ -d "$HOMEBREW/opt/$l/share/aclocal" ]; then
ACLOCAL_PATH="$HOMEBREW/opt/$l/share/aclocal:$ACLOCAL_PATH"
fi
done
export ACLOCAL_PATH
11 changes: 4 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,12 @@ setenv =
###
homebrew: SYSTEM=homebrew
local: HOME={envdir}
local: SETENV=:
local-!direct: PATH=/usr/bin:/bin:/usr/sbin:/sbin
# brew caches downloaded files in ${HOME}/Library/Caches. We share it between different toxenvs.
local-homebrew: HOMEBREW={envdir}/homebrew
local-homebrew: PATH={env:HOMEBREW}/opt/gettext/bin:{env:HOMEBREW}/bin:/usr/bin:/bin:/usr/sbin:/sbin
# libpng.pc depends on zlib.pc
local-homebrew: PKG_CONFIG_PATH={env:HOMEBREW}/opt/openblas/lib/pkgconfig:{env:HOMEBREW}/opt/openssl/lib/pkgconfig:{env:HOMEBREW}/opt/readline/lib/pkgconfig:{env:HOMEBREW}/opt/sqlite/lib/pkgconfig:{env:HOMEBREW}/opt/zlib/lib/pkgconfig:{env:HOMEBREW}/lib/pkgconfig
local-homebrew: LDFLAGS=-L{env:HOMEBREW}/opt/readline/lib -L{env:HOMEBREW}/lib
local-homebrew: CPPFLAGS=-I{env:HOMEBREW}/opt/readline/include -I{env:HOMEBREW}/include
local-homebrew: ACLOCAL_PATH={env:HOMEBREW}/opt/gettext/share/aclocal
local-homebrew: PATH={env:HOMEBREW}/bin:/usr/bin:/bin:/usr/sbin:/sbin
local-homebrew: SETENV=. .homebrew-build-env

# environment will be skipped if regular expression does not match against the sys.platform string
platform =
Expand Down Expand Up @@ -218,7 +215,7 @@ commands =
docker: {env:EXTRA_DOCKER_BUILD_ARGS:}
# pathpy checksuite needs tox. #28728: gap fails its test suite.
# linbox/cysignals testsuites fail.
local: bash -c 'export PATH={env:PATH} MAKE="make -j12" && ./bootstrap && ./configure --prefix={envdir}/local && make -k V=0 base-toolchain && SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox" make -k V=0 {posargs:numpy build}'
local: bash -c 'export PATH={env:PATH} MAKE="make -j12" && {env:SETENV} && ./bootstrap && ./configure --prefix={envdir}/local && make -k V=0 base-toolchain && SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox" make -k V=0 {posargs:numpy build}'

[testenv:check_configure]
## Test that configure behaves properly
Expand Down

0 comments on commit 2f79c76

Please sign in to comment.