Skip to content

Commit

Permalink
fixing macos install
Browse files Browse the repository at this point in the history
  • Loading branch information
nbingham1 committed Dec 4, 2024
1 parent 7a5c8a4 commit db63dd1
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 8 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ windows: lib
rm -rf lm-windows

macos: lib
cp bin/ckt/lm lm-macos
mkdir -p lm-macos/bin
mkdir -p lm-macos/share
cp bin/ckt/lm lm-macos/bin/lm
cp -r tech lm-macos/share/tech
tar -czvf lm-macos.tar.gz lm-macos

lib: gdstk
@$(foreach item,$(LIBS),echo "$(subst +, ,$(item))"; $(MAKE) VERSION="v$(shell cat VERSION)" -s $(MAKE_FLAGS) -C $(subst +, ,$(item));)
Expand Down
2 changes: 1 addition & 1 deletion bin/ckt
Submodule ckt updated 1 files
+11 −2 Makefile
63 changes: 58 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,64 @@ if [ "$OS" = "Linux" ]; then
curl -L https://github.com/broccolimicro/loom/releases/download/$TAG/lm-linux.deb -o lm-linux.deb
sudo dpkg -i lm-linux.deb
elif [ "$OS" = "Darwin" ]; then
echo "Downloading Loom"
curl -Ls https://github.com/broccolimicro/loom/releases/download/$TAG/lm-macos -o lm
chmod 0755 lm
echo "Copying Loom to /usr/local/bin/lm"
sudo mv lm /usr/local/bin/lm
# Define target directories
BIN_DIR="/usr/local/bin"
SHARE_DIR="/usr/local/share"
TEMP_DIR="$(mktemp -d)"
TARBALL_URL="https://github.com/broccolimicro/loom/releases/download/$TAG/lm-macos.tar.gz"

# Check if the script is run with root permissions
if [ "$(id -u)" -ne 0 ]; then
echo "This installer requires root privileges. Please run with sudo."
exit 1
fi

echo "Downloading installation files..."
if curl -L "$TARBALL_URL" -o "$TEMP_DIR/lm-macos.tar.gz"; then
echo "Download successful."
else
echo "Failed to download tarball. Please check the URL or your internet connection."
exit 1
fi

echo "Extracting files..."
if tar -xzf "$TEMP_DIR/lm-macos.tar.gz" -C "$TEMP_DIR"; then
echo "Extraction complete."
else
echo "Failed to extract files. Exiting."
exit 1
fi

# Ensure target directories exist
echo "Creating necessary directories..."
mkdir -p "$BIN_DIR" "$SHARE_DIR"

# Install binary
echo "Installing lm binary to $BIN_DIR..."
if cp -r $TEMP_DIR/lm-macos/bin/lm "$BIN_DIR/"; then
chmod +x "$BIN_DIR/lm"
echo "Binary installed successfully."
else
echo "Failed to install binary. Please check permissions and try again."
exit 1
fi

# Install shared resources
echo "Installing shared resources to $SHARE_DIR..."
if cp -r $TEMP_DIR/lm-macos/share/tech "$SHARE_DIR/"; then
chown -R root:staff "$SHARE_DIR/tech"
chmod -R ug+rw "$SHARE_DIR/tech"
echo "Shared resources installed successfully."
else
echo "Failed to install shared resources. Please check permissions and try again."
exit 1
fi

rm -rf "$TEMP_DIR"

# Post-install message
echo "Installation complete!"
echo "You can now use the 'lm' command."
else
curl -L https://github.com/broccolimicro/loom/releases/download/$TAG/lm-windows.zip -o lm-windows.zip
unzip lm-windows.zip
Expand Down
2 changes: 1 addition & 1 deletion lib/phy
Submodule phy updated 1 files
+9 −0 phy/Script.cpp

0 comments on commit db63dd1

Please sign in to comment.