Skip to content

Commit

Permalink
1295 remove brew from macos installer (#1296)
Browse files Browse the repository at this point in the history
* Remove code related to installing Homebrew in postinstall installer script

* Remove brew install script download from create_pkg script
  • Loading branch information
thomas-senechal authored Dec 15, 2023
1 parent 55f7cb1 commit b0ae132
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
10 changes: 0 additions & 10 deletions installer/macos/create_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ MASSASTATION_BINARY_NAME=massastation
APPLE_DEVELOPER_ID_APPLICATION=$2
APPLE_DEVELOPER_ID_INSTALLER=$3

HOMEBREW_INSTALL_SCRIPT_URL=https://raw.githubusercontent.com/massalabs/homebrew.sh/master/homebrew-3.3.sh

LICENSE_FILE_NAME=MassaStation_ToS.rtf

# Print the usage to stderr and exit with code 1.
Expand Down Expand Up @@ -75,18 +73,10 @@ package() {
fi
}

# Download homebrew installation script and put it in script directory.
download_homebrew_install_script() {
curl -sL $HOMEBREW_INSTALL_SCRIPT_URL -o macos/scripts/install_homebrew.sh || fatal "failed to download homebrew installation script"
chmod +x macos/scripts/install_homebrew.sh || fatal "failed to chmod homebrew installation script"
}

main() {
# build massastation only if the .app is not present
test -d $MASSASTATION_APPLICATION_NAME || build_massastation

download_homebrew_install_script

if [ ! -d macos/resources ]; then
mkdir macos/resources || fatal "failed to create resources directory"
fi
Expand Down
19 changes: 0 additions & 19 deletions installer/macos/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

set -e

# `brew` isn't in $PATH by default in the `.pkg` installer environment.
export PATH=/usr/local/bin:/opt/homebrew/bin:$PATH

# Set MassaStation configuration directory.
export MASSASTATION_CONFIG_DIR=/usr/local/share/massastation
export MASSASTATION_CERT_DIR=/etc/massastation/certs
Expand All @@ -18,22 +15,6 @@ fatal() {
exit 1
}

# ./install_homebrew.sh is a script that installs homebrew if it's not installed. Otherwise it performs a brew update.
./install_homebrew.sh || fatal "failed to install brew"

HOMEBREW_PATH=$(brew --prefix)

# Install git using homebrew if it's not installed. git is required to install nss without xcode.
if ! command -v git >/dev/null 2>&1; then
su - $USER -c "$HOMEBREW_PATH/bin/brew install git" || fatal "failed to install git using homebrew"
fi

# Install nss using homebrew if it's not installed.
if ! command -v certutil >/dev/null 2>&1; then
# nss contains certutil which is used to generate a certificate.
su - $USER -c "$HOMEBREW_PATH/bin/brew install nss" || fatal "failed to install nss using homebrew"
fi

mkdir -m 777 -p $MASSASTATION_CONFIG_DIR || fatal "config directory creation failed."
mkdir -m 777 -p $MASSASTATION_CONFIG_DIR/plugins || fatal "plugins directory creation failed."
mkdir -m 777 -p $MASSASTATION_CONFIG_DIR/logs || fatal "logs directory creation failed."
Expand Down

0 comments on commit b0ae132

Please sign in to comment.