forked from NvChad/NvChad
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
146 lines (140 loc) · 6.22 KB
/
Copy pathMakefile
File metadata and controls
146 lines (140 loc) · 6.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Detect OS
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OS := linux
endif
ifeq ($(UNAME_S),Darwin)
OS := macos
endif
ifeq ($(OS),Windows_NT)
OS := windows
endif
# Default target
.PHONY: install
install:
@echo "Detected OS: $(OS)"
@$(MAKE) install-$(OS)
# macOS installation using Homebrew
.PHONY: install-macos
install-macos:
@echo "Installing dependencies for macOS..."
@command -v brew >/dev/null 2>&1 || { echo "Homebrew not found. Please install Homebrew first: https://brew.sh"; exit 1; }
# fonts
brew install font-hack-nerd-font
# ripgrep
brew install ripgrep
# claude code + acp bridge
@command -v claude >/dev/null 2>&1 || { echo "Claude Code not found. Please install it first: https://docs.anthropic.com/en/docs/claude-code/quickstart"; }
npm install -g @agentclientprotocol/claude-agent-acp
# terraform
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
# scala
@echo "Installing Scala tooling (JDK, Coursier, Metals)..."
brew install --cask temurin
brew tap coursier/formulas
brew install coursier/formulas/coursier
cs install metals scalafmt
# neovim
brew install neovim
# Linux installation using package managers
.PHONY: install-linux
install-linux:
@echo "Installing dependencies for Linux..."
@if command -v apt-get >/dev/null 2>&1; then \
echo "Using apt-get (Debian/Ubuntu)"; \
sudo apt-get update; \
sudo apt-get install -y ripgrep neovim; \
# Install claude-agent-acp via npm; \
command -v npm >/dev/null 2>&1 && npm install -g @agentclientprotocol/claude-agent-acp || echo "npm not found, please install claude-agent-acp manually"; \
# Install Hack Nerd Font
mkdir -p ~/.local/share/fonts; \
cd ~/.local/share/fonts && curl -fLo "Hack Regular Nerd Font Complete.ttf" "https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf"; \
fc-cache -fv; \
# Install Terraform
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg; \
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list; \
sudo apt-get update && sudo apt-get install terraform; \
# Install Scala tooling
echo "Installing Scala tooling (JDK, Coursier, Metals)..."; \
sudo apt-get install -y openjdk-17-jdk; \
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > /tmp/cs && chmod +x /tmp/cs && /tmp/cs install metals scalafmt && sudo mv /tmp/cs /usr/local/bin/cs; \
elif command -v yum >/dev/null 2>&1; then \
echo "Using yum (RHEL/CentOS)"; \
sudo yum install -y ripgrep neovim; \
# Install claude-agent-acp via npm; \
command -v npm >/dev/null 2>&1 && npm install -g @agentclientprotocol/claude-agent-acp || echo "npm not found, please install claude-agent-acp manually"; \
# Install Hack Nerd Font
mkdir -p ~/.local/share/fonts; \
cd ~/.local/share/fonts && curl -fLo "Hack Regular Nerd Font Complete.ttf" "https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf"; \
fc-cache -fv; \
# Install Terraform
sudo yum install -y yum-utils; \
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo; \
sudo yum -y install terraform; \
# Install Scala tooling
echo "Installing Scala tooling (JDK, Coursier, Metals)..."; \
sudo yum install -y java-17-openjdk; \
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > /tmp/cs && chmod +x /tmp/cs && /tmp/cs install metals scalafmt && sudo mv /tmp/cs /usr/local/bin/cs; \
elif command -v pacman >/dev/null 2>&1; then \
echo "Using pacman (Arch Linux)"; \
sudo pacman -S --noconfirm ripgrep neovim terraform jdk17-openjdk; \
# Install claude-agent-acp via npm; \
command -v npm >/dev/null 2>&1 && npm install -g @agentclientprotocol/claude-agent-acp || echo "npm not found, please install claude-agent-acp manually"; \
# Install Hack Nerd Font
yay -S --noconfirm nerd-fonts-hack || paru -S --noconfirm nerd-fonts-hack || echo "Please install nerd-fonts-hack manually"; \
# Install Scala tooling
echo "Installing Scala tooling (Coursier, Metals)..."; \
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > /tmp/cs && chmod +x /tmp/cs && /tmp/cs install metals scalafmt && sudo mv /tmp/cs /usr/local/bin/cs; \
else \
echo "Unsupported Linux distribution. Please install the following manually:"; \
echo "- ripgrep"; \
echo "- neovim"; \
echo "- terraform"; \
echo "- JDK 17+"; \
echo "- Coursier"; \
echo "- Metals"; \
echo "- Hack Nerd Font"; \
fi
# Windows installation using Chocolatey and Scoop
.PHONY: install-windows
install-windows:
@echo "Installing dependencies for Windows..."
@if command -v choco >/dev/null 2>&1; then \
echo "Using Chocolatey"; \
choco install -y ripgrep neovim terraform; \
choco install -y nerd-fonts-hack; \
elif command -v scoop >/dev/null 2>&1; then \
echo "Using Scoop"; \
scoop install ripgrep neovim terraform; \
scoop bucket add nerd-fonts; \
scoop install Hack-NF; \
else \
echo "Neither Chocolatey nor Scoop found."; \
echo "Please install one of the following package managers:"; \
echo "- Chocolatey: https://chocolatey.org/install"; \
echo "- Scoop: https://scoop.sh/"; \
echo ""; \
echo "Then install the following packages:"; \
echo "- ripgrep"; \
echo "- neovim"; \
echo "- terraform"; \
echo "- Hack Nerd Font"; \
fi
# Install git hooks
.PHONY: hooks
hooks:
@echo "Installing git hooks..."
@cp scripts/commit-msg .git/hooks/commit-msg
@chmod +x .git/hooks/commit-msg
@echo "Git hooks installed successfully."
# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " install - Install dependencies for the detected OS"
@echo " install-macos - Install dependencies for macOS (requires Homebrew)"
@echo " install-linux - Install dependencies for Linux (apt/yum/pacman)"
@echo " install-windows - Install dependencies for Windows (Chocolatey/Scoop)"
@echo " hooks - Install git hooks for conventional commits"
@echo " help - Show this help message"