Skip to content

Commit bc0dd39

Browse files
Copilot0xrinegade
andcommitted
Add comprehensive SVM development tools setup
Co-authored-by: 0xrinegade <[email protected]>
1 parent f05cd27 commit bc0dd39

File tree

6 files changed

+613
-1
lines changed

6 files changed

+613
-1
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
.vscode
22
cosmic-sysext
3-
*_build
3+
*_build
4+
node_modules
5+
.flutter-plugins
6+
.flutter-plugins-dependencies
7+
.pub-cache
8+
.gradle
9+
.android
10+
*.log

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@ They can be installed all at once with:
8383
sudo apt install just rustc libglvnd-dev libwayland-dev libseat-dev libxkbcommon-dev libinput-dev udev dbus libdbus-1-dev libsystemd-dev libpixman-1-dev libssl-dev libflatpak-dev libpulse-dev pop-launcher libexpat1-dev libfontconfig-dev libfreetype-dev mold cargo libgbm-dev libclang-dev libpipewire-0.3-dev libpam0g-dev -y
8484
```
8585

86+
### Development Tools Setup
87+
88+
For developers working on COSMIC SVM applications, additional development tools can be installed:
89+
90+
```
91+
just dev-tools
92+
```
93+
94+
This will install:
95+
- **Programming Languages**: Zig (latest), Crystal (latest)
96+
- **Mobile Development**: React Native CLI, Flutter, Kotlin, Android Studio
97+
- **Development Tools**: Insomnia API client
98+
- **Network Tools**: Tor, Tailscale, Yggdrasil, i2p
99+
- **PWA Tools**: Angular CLI, Create React App, Lighthouse, Workbox
100+
- **Specialized Tools**: OSVM CLI, Anza CLI tools (placeholders for future implementation)
101+
102+
To verify your development tools installation:
103+
104+
```
105+
just dev-tools-check
106+
```
107+
86108
### Testing
87109

88110
The easiest way to test COSMIC DE currently is by building a systemd system extension (see `man systemd-sysext`).

docs/DEV-TOOLS.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# COSMIC SVM Development Tools
2+
3+
This document describes the development tools setup for COSMIC SVM applications.
4+
5+
## Quick Start
6+
7+
```bash
8+
# Install all development tools
9+
just dev-tools
10+
11+
# Check installation status
12+
just dev-tools-check
13+
```
14+
15+
## Supported Tools
16+
17+
### Programming Languages
18+
19+
- **Zig (latest version)**: Fast, robust, optimal programming language
20+
- **Crystal (latest version)**: Fast as C, slick as Ruby
21+
22+
### Mobile Development
23+
24+
- **React Native CLI**: Create mobile apps with React
25+
- **Flutter**: Google's UI toolkit for mobile, web, and desktop
26+
- **Kotlin**: Modern programming language for Android development
27+
- **Android Studio**: Official IDE for Android development
28+
29+
### Development Tools
30+
31+
- **Insomnia**: REST/GraphQL API client
32+
33+
### Network Tools
34+
35+
- **Tor**: Anonymous communication network
36+
- **Tailscale**: Zero-config VPN built on WireGuard
37+
- **Yggdrasil**: End-to-end encrypted IPv6 network
38+
- **i2p**: Anonymous overlay network
39+
40+
### PWA Development Tools
41+
42+
- **Angular CLI**: Command line interface for Angular
43+
- **Create React App**: Set up modern React web apps
44+
- **Lighthouse**: Web page quality auditing
45+
- **Workbox**: JavaScript libraries for PWAs
46+
47+
### Specialized Tools
48+
49+
- **OSVM CLI**: OpenSVM command line interface (placeholder)
50+
- **Anza CLI**: Anza development tools (placeholder)
51+
52+
## Manual Installation
53+
54+
If the automated installation fails or you prefer manual setup, you can install tools individually:
55+
56+
### Zig
57+
```bash
58+
# Download latest from https://ziglang.org/download/
59+
wget https://ziglang.org/download/$(version)/zig-linux-x86_64-$(version).tar.xz
60+
tar -xf zig-linux-x86_64-$(version).tar.xz
61+
sudo mv zig-linux-x86_64-$(version) /opt/zig
62+
sudo ln -s /opt/zig/zig /usr/local/bin/zig
63+
```
64+
65+
### Crystal
66+
```bash
67+
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
68+
```
69+
70+
### Flutter
71+
```bash
72+
# Download from https://flutter.dev/docs/get-started/install/linux
73+
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_$(version)-stable.tar.xz
74+
tar -xf flutter_linux_$(version)-stable.tar.xz
75+
sudo mv flutter /opt/
76+
echo 'export PATH="/opt/flutter/bin:$PATH"' >> ~/.bashrc
77+
```
78+
79+
## PWA Development
80+
81+
For developing Progressive Web Apps for opensvm.com, larp.dev, and aeamcp.com:
82+
83+
1. Install the PWA development tools with `just dev-tools`
84+
2. Use Angular CLI for opensvm.com:
85+
```bash
86+
ng new opensvm-app
87+
ng add @angular/pwa
88+
```
89+
3. Use React for other PWAs:
90+
```bash
91+
npx create-react-app larp-app
92+
npx create-react-app aeamcp-app
93+
```
94+
95+
## Troubleshooting
96+
97+
### Permission Issues
98+
If you encounter permission issues, ensure you're not running as root:
99+
```bash
100+
whoami # Should not be root
101+
```
102+
103+
### PATH Issues
104+
After installation, source your shell profile:
105+
```bash
106+
source ~/.bashrc
107+
# or
108+
source ~/.zshrc
109+
```
110+
111+
### Missing Dependencies
112+
Install system dependencies manually if the script fails:
113+
```bash
114+
# Ubuntu/Debian
115+
sudo apt update
116+
sudo apt install curl wget git build-essential pkg-config libssl-dev
117+
118+
# Fedora
119+
sudo dnf install curl wget git gcc gcc-c++ make pkgconfig openssl-devel
120+
121+
# Arch Linux
122+
sudo pacman -S curl wget git base-devel openssl
123+
```
124+
125+
## Contributing
126+
127+
To add support for new development tools:
128+
129+
1. Add installation logic to `scripts/install-dev-tools.sh`
130+
2. Add verification logic to `scripts/check-dev-tools.sh`
131+
3. Update this documentation
132+
4. Test the installation on a clean system

justfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ sysext dir=(invocation_directory() / "cosmic-sysext") version=("nightly-" + `git
6868
EOF
6969
echo "Done"
7070

71+
dev-tools:
72+
#!/usr/bin/env bash
73+
echo "Installing COSMIC SVM development tools..."
74+
bash scripts/install-dev-tools.sh
75+
76+
dev-tools-check:
77+
#!/usr/bin/env bash
78+
echo "Checking development tools installation..."
79+
bash scripts/check-dev-tools.sh
80+
7181
clean:
7282
rm -rf cosmic-sysext
7383
rm -rf cosmic-applets/target

scripts/check-dev-tools.sh

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#!/usr/bin/env bash
2+
3+
# Colors for output
4+
RED='\033[0;31m'
5+
GREEN='\033[0;32m'
6+
YELLOW='\033[1;33m'
7+
NC='\033[0m' # No Color
8+
9+
echo_pass() {
10+
echo -e "${GREEN}[PASS]${NC} $1"
11+
}
12+
13+
echo_fail() {
14+
echo -e "${RED}[FAIL]${NC} $1"
15+
}
16+
17+
echo_warn() {
18+
echo -e "${YELLOW}[WARN]${NC} $1"
19+
}
20+
21+
# Check if a command exists
22+
check_command() {
23+
local cmd="$1"
24+
local name="$2"
25+
26+
if command -v "$cmd" &> /dev/null; then
27+
local version=$($cmd --version 2>/dev/null | head -n1 || echo "version unknown")
28+
echo_pass "$name is installed: $version"
29+
return 0
30+
else
31+
echo_fail "$name is not installed"
32+
return 1
33+
fi
34+
}
35+
36+
# Check if a file/directory exists
37+
check_path() {
38+
local path="$1"
39+
local name="$2"
40+
41+
if [ -e "$path" ]; then
42+
echo_pass "$name is installed at $path"
43+
return 0
44+
else
45+
echo_fail "$name is not found at $path"
46+
return 1
47+
fi
48+
}
49+
50+
# Check Snap packages
51+
check_snap() {
52+
local package="$1"
53+
local name="$2"
54+
55+
if command -v snap &> /dev/null && snap list "$package" &> /dev/null; then
56+
echo_pass "$name is installed via Snap"
57+
return 0
58+
else
59+
echo_fail "$name is not installed via Snap"
60+
return 1
61+
fi
62+
}
63+
64+
# Check Flatpak packages
65+
check_flatpak() {
66+
local package="$1"
67+
local name="$2"
68+
69+
if command -v flatpak &> /dev/null && flatpak list | grep -q "$package"; then
70+
echo_pass "$name is installed via Flatpak"
71+
return 0
72+
else
73+
echo_fail "$name is not installed via Flatpak"
74+
return 1
75+
fi
76+
}
77+
78+
echo "Checking COSMIC SVM development tools installation..."
79+
echo "=================================================="
80+
81+
# System tools
82+
echo ""
83+
echo "System Tools:"
84+
check_command "curl" "curl"
85+
check_command "wget" "wget"
86+
check_command "git" "git"
87+
88+
# Programming Languages
89+
echo ""
90+
echo "Programming Languages:"
91+
check_command "zig" "Zig"
92+
check_command "crystal" "Crystal"
93+
check_command "node" "Node.js"
94+
check_command "npm" "npm"
95+
96+
# Mobile Development
97+
echo ""
98+
echo "Mobile Development:"
99+
check_command "npx" "npx (React Native)"
100+
check_path "$HOME/.local/flutter/bin/flutter" "Flutter"
101+
check_command "kotlin" "Kotlin"
102+
103+
# Check Android Studio
104+
echo ""
105+
echo "IDE and Development Tools:"
106+
if check_snap "android-studio" "Android Studio"; then
107+
:
108+
elif check_path "/opt/android-studio" "Android Studio"; then
109+
:
110+
elif check_path "/usr/local/android-studio" "Android Studio"; then
111+
:
112+
else
113+
echo_fail "Android Studio not found"
114+
fi
115+
116+
# Check Insomnia
117+
if check_snap "insomnia" "Insomnia"; then
118+
:
119+
elif check_flatpak "rest.insomnia.Insomnia" "Insomnia"; then
120+
:
121+
else
122+
echo_fail "Insomnia not found"
123+
fi
124+
125+
# Network Tools
126+
echo ""
127+
echo "Network Tools:"
128+
check_command "tor" "Tor"
129+
check_command "tailscale" "Tailscale"
130+
check_command "yggdrasil" "Yggdrasil"
131+
check_command "i2pd" "i2pd (I2P daemon)"
132+
133+
# Specialized Tools
134+
echo ""
135+
echo "Specialized Tools:"
136+
check_command "osvm" "OSVM CLI"
137+
check_command "anza" "Anza CLI"
138+
139+
# PWA Tools
140+
echo ""
141+
echo "PWA Development Tools:"
142+
check_command "ng" "Angular CLI"
143+
check_command "create-react-app" "Create React App"
144+
check_command "lighthouse" "Lighthouse"
145+
check_command "workbox" "Workbox CLI"
146+
147+
echo ""
148+
echo "=============================================="
149+
echo "Development tools check completed!"
150+
echo ""
151+
echo "Note: Failed checks indicate tools that need to be installed."
152+
echo "Run 'just dev-tools' to install missing tools."

0 commit comments

Comments
 (0)