Skip to content

Commit

Permalink
[macOS] Add [email protected] using old homebrew commit (#10935)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathrajsrinivasan authored Nov 8, 2024
1 parent a070c85 commit 6b5924a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
26 changes: 15 additions & 11 deletions images/macos/scripts/build/install-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ source ~/utils/utils.sh

echo "Install [email protected]"

openssl_pkg=$(download_with_retry "https://www.openssl.org/source/openssl-1.1.1w.tar.gz")
tar -xvf $openssl_pkg
cd openssl-1.1.1w
./config --prefix=/usr/local/openssl
make
sudo make install
export OPENSSL="/usr/local/openssl/bin"
echo "export OPENSSL=${OPENSSL}" >> ${HOME}/.bashrc
COMMIT=d91dabd087cb0b906c92a825df9e5e5e1a4f59f8
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/$COMMIT/Formula/o/[email protected]"
FORMULA_PATH="$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/o/[email protected]"
mkdir -p "$(dirname $FORMULA_PATH)"
curl -fsSL $FORMULA_URL -o $FORMULA_PATH
HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew install [email protected]

if ! is_Arm64; then
ln -sf ${OPENSSL}/openssl /usr/local/bin/openssl
ln -sf ${OPENSSL}/openssl /usr/local/opt/openssl
# Symlink brew openssl@1.1 to `/usr/local/bin` as Homebrew refuses
ln -sf $(brew --prefix [email protected])/bin/openssl /usr/local/bin/openssl
else
ln -sf ${OPENSSL}/openssl /opt/homebrew/bin/openssl
# arm64 has a different installation prefix for brew
ln -sf $(brew --prefix [email protected])/bin/openssl /opt/homebrew/bin/openssl
fi

if ! is_Arm64; then
# Most of build systems and scripts look up ssl here
ln -sf $(brew --cellar [email protected])/1.1* /usr/local/opt/openssl
fi

invoke_tests "OpenSSL"
7 changes: 7 additions & 0 deletions images/macos/scripts/tests/OpenSSL.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Describe "OpenSSL" {
}
}

Context "OpenSSL 1.1 Path Check" {
It "OpenSSL 1.1 path exists" {
$openSSLpath = brew --prefix openssl@1.1
$openSSLpath | Should -Exist
}
}

Context "OpenSSL 1.1 is default" {
It "Default OpenSSL version is 1.1" {
$commandResult = Get-CommandResult "openssl version"
Expand Down

0 comments on commit 6b5924a

Please sign in to comment.