From 523d36e7ca4aa0a6796718fc50da340aca56c210 Mon Sep 17 00:00:00 2001 From: Philipp Braun <3589810@gmail.com> Date: Wed, 31 Mar 2021 00:45:28 +0200 Subject: [PATCH] Add mac requirements (#20420) * Add mac requirements * Remove bashrc spam --- tools/mac_setup.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/mac_setup.sh b/tools/mac_setup.sh index 99ac11e8..4b7d73a7 100755 --- a/tools/mac_setup.sh +++ b/tools/mac_setup.sh @@ -7,6 +7,11 @@ if [[ $(command -v brew) == "" ]]; then fi brew bundle --file=- <<-EOS +brew "cmake" +brew "zlib" +brew "bzip2" +brew "rust" +brew "rustup-init" brew "capnp" brew "coreutils" brew "eigen" @@ -29,8 +34,24 @@ elif [[ $SHELL == "/bin/bash" ]]; then RC_FILE="$HOME/.bash_profile" fi +# Build requirements for macOS +# https://github.com/pyenv/pyenv/issues/1740 +# https://github.com/pyca/cryptography/blob/main/docs/installation.rst +rustup-init -y + +export LDFLAGS="$LDFLAGS -L/usr/local/opt/zlib/lib" +export LDFLAGS="$LDFLAGS -L/usr/local/opt/bzip2/lib" +export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl@1.1/lib" +export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/zlib/include" +export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/bzip2/include" +export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl@1.1/include" +export PATH="$PATH:/usr/local/opt/openssl@1.1/bin" +export PATH="$PATH:/usr/local/bin" + +# OpenPilot environment variables if [ -z "$OPENPILOT_ENV" ] && [ -n "$RC_FILE" ] && [ -z "$CI" ]; then OP_DIR=$(git rev-parse --show-toplevel) + echo "export PATH=\"\$PATH:$HOME/.cargo/bin\"" >> $RC_FILE echo "source $OP_DIR/tools/openpilot_env.sh" >> $RC_FILE source $RC_FILE echo "Added openpilot_env to RC file: $RC_FILE"