Forum > macOS / Mac OS X

How to compile for mac

(1/1)

vonskie:

--- Code: ---
#!/bin/bash

# Define the desired download directory and Lazarus version details
DOWNLOAD_DIR="$HOME/downloads"
LAZARUS_VERSION="fixes_3_0"
LAZARUS_ZIP="lazarus-${LAZARUS_VERSION}.zip"
LAZARUS_URL="https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/${LAZARUS_VERSION}/${LAZARUS_ZIP}"
UNZIP_DIR="lazarus-${LAZARUS_VERSION}"

# Navigate to the desired download directory
cd "${DOWNLOAD_DIR}" || { echo "Failed to navigate to ${DOWNLOAD_DIR}. Exiting."; exit 1; }

# Remove the previous zip file if it exists
if [ -f "${LAZARUS_ZIP}" ]; then
    rm "${LAZARUS_ZIP}" || { echo "Failed to remove existing ${LAZARUS_ZIP}. Exiting."; exit 1; }
fi

# Remove the previous Lazarus directory if it exists
if [ -d "${UNZIP_DIR}" ]; then
    rm -rf "${UNZIP_DIR}" || { echo "Failed to remove existing ${UNZIP_DIR} directory. Exiting."; exit 1; }
fi

# Download the zip file using wget with a progress bar and retries on failure
wget --progress=bar:force --tries=3 "${LAZARUS_URL}" || { echo "Download failed. Exiting."; exit 1; }

# Unzip the downloaded file
unzip "${LAZARUS_ZIP}" || { echo "Unzipping failed. Exiting."; exit 1; }

# Enter the unzipped Lazarus directory
cd "${UNZIP_DIR}" || { echo "Failed to navigate to ${UNZIP_DIR} directory. Exiting."; exit 1; }

# Clean and build Lazarus with the specified parameters
make clean all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide || { echo "Make command failed. Exiting."; exit 1; }

# Remove the 'com.apple.quarantine' attribute from the files
xattr -d -r -v com.apple.quarantine ./* || { echo "Failed to remove quarantine attributes. Exiting."; exit 1; }

echo "Lazarus ${LAZARUS_VERSION} has been successfully installed."

# End of the script

--- End code ---

AlexTP:
Use the forum's CODE tag, please.

vonskie:
I installed homebrew and used it to install wget

--- Code: ---curl -O https://raw.githubusercontent.com/Homebrew/install/master/install.sh
chmod +x install.sh
./install.sh
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/admin/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
brew install wget

--- End code ---

vonskie:

--- Quote from: AlexTP on November 09, 2023, 07:23:06 pm ---Use the forum's CODE tag, please.

--- End quote ---

How do you do that?

vonskie:

--- Quote from: AlexTP on November 09, 2023, 07:23:06 pm ---Use the forum's CODE tag, please.

--- End quote ---

figured it out

Navigation

[0] Message Index

Go to full version