From dd2eab61c70614c78a903648f1cf1c80361ba44b Mon Sep 17 00:00:00 2001 From: Paul Brown <67805647+pb-dod@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:51:42 -0500 Subject: [PATCH] Prevent ruby 2.7.2 build failures due to missing openssl (#98) This PR addresses the Ruby installation failure encountered by @claym-ih during the ih-setup -f setup process on macOS 14.5 with Apple Silicon. The issue was traced to incorrect environment variables pointing to non-existent OpenSSL directories. The PR updates the LDFLAGS, CPPFLAGS, and PKG_CONFIG_PATH to use the correct paths from Homebrew's `OpenSSL@1.1` installation and adds `OpenSSL@1.1` as a dependency in the homebrew-ih-public formula. --- VERSION | 2 +- formula/ih-core.rb | 3 ++- lib/core/shell/default/99_bash.sh | 9 +++++---- lib/core/shell/default/99_zsh.sh | 9 +++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 920c3bd..6167106 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.57 +0.1.58 diff --git a/formula/ih-core.rb b/formula/ih-core.rb index 97e2a5d..839b09d 100644 --- a/formula/ih-core.rb +++ b/formula/ih-core.rb @@ -1,5 +1,5 @@ class IhCore < Formula - VERSION="0.1.57" + VERSION="0.1.58" desc "Brew formula for installing core tools used at Included Health engineering." homepage "https://github.com/ConsultingMD/homebrew-ih-public" license "CC BY-NC-ND 4.0" @@ -16,6 +16,7 @@ class IhCore < Formula depends_on "yq" depends_on "go-jira" depends_on "envconsul" + depends_on "openssl@1.1" # required by ruby 2.7.2 depends_on "openssl@3" depends_on "coreutils" depends_on "yamllint" diff --git a/lib/core/shell/default/99_bash.sh b/lib/core/shell/default/99_bash.sh index fc52805..b0d42f9 100644 --- a/lib/core/shell/default/99_bash.sh +++ b/lib/core/shell/default/99_bash.sh @@ -76,10 +76,11 @@ if [[ "$PS1" = "\\s-\\v\\\$ " ]]; then fi # Open SSL management -export PATH="/usr/local/opt/openssl@1.1/bin:$PATH" -export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" -export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" -export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" +BREW_PREFIX_OPENSSL="$(brew --prefix openssl@1.1)" +export PATH="$BREW_PREFIX_OPENSSL/bin:$PATH" +export LDFLAGS="-L$BREW_PREFIX_OPENSSL/lib" +export CPPFLAGS="-I$BREW_PREFIX_OPENSSL/include" +export PKG_CONFIG_PATH="$BREW_PREFIX_OPENSSL/lib/pkgconfig" ########################################################## # Rancher desktop added to the PATH diff --git a/lib/core/shell/default/99_zsh.sh b/lib/core/shell/default/99_zsh.sh index 8f322f4..d166695 100644 --- a/lib/core/shell/default/99_zsh.sh +++ b/lib/core/shell/default/99_zsh.sh @@ -44,10 +44,11 @@ if [[ ${#PROMPT} -lt 10 ]]; then fi # Open SSL management -export PATH="/usr/local/opt/openssl@1.1/bin:$PATH" -export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" -export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" -export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" +BREW_PREFIX_OPENSSL="$(brew --prefix openssl@1.1)" +export PATH="$BREW_PREFIX_OPENSSL/bin:$PATH" +export LDFLAGS="-L$BREW_PREFIX_OPENSSL/lib" +export CPPFLAGS="-I$BREW_PREFIX_OPENSSL/include" +export PKG_CONFIG_PATH="$BREW_PREFIX_OPENSSL/lib/pkgconfig" # Rancher desktop added to the PATH export PATH=$PATH:/Users/$USER/.rd/bin