-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-cli.sh
More file actions
697 lines (643 loc) · 25 KB
/
install-cli.sh
File metadata and controls
697 lines (643 loc) · 25 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
#!/usr/bin/env bash
# Author: Nima Shafie
# =============================================================================
# install-cli.sh
#
# CLI installer for airgap-cpp-devkit.
# Use this when Python is unavailable or you prefer a non-GUI workflow.
#
# PREFERRED entry point (Python 3.8+ required):
# bash launch.sh
# Opens the DevKit Manager web UI at http://127.0.0.1:8080
# with one-click installs, profiles, and live log output.
#
# USE THIS SCRIPT WHEN:
# - Python 3.8+ is not available
# - You need a non-interactive / scripted install (--yes --profile)
# - You are in a headless environment with no browser
#
# REQUIRED tools (installed automatically):
# - tools/toolchains/clang (clang-format + clang-tidy 22.1.3)
# - cmake 4.3.1
# - python 3.14.4 (portable interpreter)
# - lcov 2.4 (Linux only)
# - style-formatter (pre-commit hook)
#
# OPTIONAL tools (prompted):
# - 7zip 26.00 (Windows + Linux, admin + user)
# - servy 7.9 (Windows only)
# - conan 2.27.1 (Windows + Linux, no Python required)
# - tools/dev-tools/vscode-extensions (requires VS Code + 'code' on PATH)
# - winlibs-gcc-ucrt (Windows only)
# - tools/frameworks/grpc (Windows only, requires Visual Studio)
# - sqlite 3.53.0 (CLI binary, Windows + Linux)
# - matlab (verification only -- checks Database Toolbox + Compiler)
#
# PREFERRED entry point (replaces this script for most users):
# bash launch.sh
# Finds Python automatically, opens http://127.0.0.1:8080 -- visual dashboard,
# one-click installs, profile-based batch installs, log browser.
# Falls back to this script automatically if Python is not found.
#
# USAGE:
# bash install.sh [--prefix <path>] [--rebuild] [--yes]
#
# OPTIONS:
# --prefix <path> Override install prefix for all tools
# --rebuild Force reinstall of all tools
# --yes Non-interactive: use defaults, skip confirmation screen
# --profile <name> Pre-select tools for a team profile (skips prompts):
# cpp-dev -- clang, cmake, python, conan, vscode, sqlite
# devops -- cmake, python, conan, sqlite, 7zip
# minimal -- clang, cmake, python only (no optionals)
# full -- all optional tools enabled
# =============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="${SCRIPT_DIR}"
# ---------------------------------------------------------------------------
# Parse arguments
# ---------------------------------------------------------------------------
PREFIX_OVERRIDE=""
REBUILD=false
AUTO_YES=false
PROFILE=""
while [[ $# -gt 0 ]]; do
case "$1" in
--prefix) PREFIX_OVERRIDE="$2"; shift 2 ;;
--rebuild) REBUILD=true; shift ;;
--yes) AUTO_YES=true; shift ;;
--profile) PROFILE="$2"; shift 2 ;;
-h|--help)
sed -n '2,/^[^#]/{/^#/!q; s/^# \?//; p}' "$0"
exit 0 ;;
*) echo "ERROR: Unknown argument: $1" >&2; exit 1 ;;
esac
done
# ---------------------------------------------------------------------------
# Detect platform
# ---------------------------------------------------------------------------
case "$(uname -s)" in
MINGW*|MSYS*|CYGWIN*) OS="windows" ;;
Linux*) OS="linux" ;;
*) echo "ERROR: Unsupported platform." >&2; exit 1 ;;
esac
# ---------------------------------------------------------------------------
# Source install-mode library
# ---------------------------------------------------------------------------
source "${REPO_ROOT}/scripts/install-mode.sh"
# ---------------------------------------------------------------------------
# Plain ASCII display helpers
# ---------------------------------------------------------------------------
_sep() { printf '%s\n' "--------------------------------------------------------------------------------"; }
_sep2() { printf '%s\n' "================================================================================"; }
_header() { _sep2; printf ' %s\n' "$1"; _sep2; }
_section(){ _sep; printf ' %s\n' "$1"; _sep; }
# ---------------------------------------------------------------------------
# Determine install prefix candidates
# ---------------------------------------------------------------------------
_get_sys_prefix() {
case "${OS}" in
windows)
local pf
pf="$(cygpath -u "${PROGRAMFILES:-/c/Program Files}" 2>/dev/null || echo "/c/Program Files")"
echo "${pf}/airgap-cpp-devkit"
;;
linux) echo "/opt/airgap-cpp-devkit" ;;
esac
}
_get_user_prefix() {
case "${OS}" in
windows)
local lad
lad="$(cygpath -u "${LOCALAPPDATA:-${HOME}/AppData/Local}" 2>/dev/null || echo "${HOME}/AppData/Local")"
echo "${lad}/airgap-cpp-devkit"
;;
linux) echo "${HOME}/.local/share/airgap-cpp-devkit" ;;
esac
}
SYS_PREFIX="$(_get_sys_prefix)"
USER_PREFIX="$(_get_user_prefix)"
# ---------------------------------------------------------------------------
# CONFIRMATION SCREEN
# ---------------------------------------------------------------------------
if [[ "${AUTO_YES}" == "false" ]]; then
echo ""
_header " airgap-cpp-devkit -- CLI Installer (fallback)"
echo ""
echo " Tip: for a visual installer with live output, run instead:"
echo " bash launch.sh -> http://127.0.0.1:8080"
echo ""
echo " Platform : ${OS} Date : $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
_section " REQUIRED (installed automatically)"
echo " [1] tools/toolchains/clang clang-format + clang-tidy 22.1.3"
echo " [2] cmake 4.3.1"
echo " [3] python 3.14.4 (portable interpreter)"
if [[ "${OS}" == "linux" ]]; then
echo " [4] lcov 2.4 (Linux only)"
fi
echo " [5] style-formatter pre-commit hook"
echo ""
_section " OPTIONAL (you will be prompted)"
echo " Cross-platform:"
echo " [6] conan 2.27.1 C/C++ package manager [~5s]"
echo " [7] sqlite 3.53.0 Database inspection CLI [~3s]"
echo " [8] 7zip 26.00 Archive tool [~2s]"
echo " [9] vscode-ext C/C++, TestMate, Python [~30s]"
echo " [10] matlab Toolbox verification [~2s]"
if [[ "${OS}" == "windows" ]]; then
echo ""
echo " Windows-only:"
echo " [11] servy 7.9 Windows service manager [~3s]"
echo " [12] winlibs-gcc 15.2.0 GCC + MinGW-w64 [~8min]"
echo " [13] grpc 1.80.0 C++ framework (needs VS) [~20min]"
fi
echo ""
echo " Tip: use --profile <name> to skip prompts"
echo " Profiles: cpp-dev | devops | minimal | full"
echo ""
echo " Tip: prefer a browser UI? Run instead: bash launch.sh"
echo ""
_section " INSTALL MODE"
echo ""
echo " [A] System-wide (admin) -> ${SYS_PREFIX}"
echo " [U] Current user only -> ${USER_PREFIX}"
echo " [C] Custom prefix -> specify your own path"
echo ""
# --- Install mode choice ---
while true; do
printf " Choose install mode [A/U/C]: "
read -r MODE_CHOICE
case "${MODE_CHOICE^^}" in
A)
export INSTALL_PREFIX_OVERRIDE="${SYS_PREFIX}"
echo " [OK] System-wide install: ${SYS_PREFIX}"
break ;;
U)
export INSTALL_PREFIX_OVERRIDE="${USER_PREFIX}"
echo " [OK] User install: ${USER_PREFIX}"
break ;;
C)
printf " Enter custom prefix path: "
read -r CUSTOM_PATH
if [[ -z "${CUSTOM_PATH}" ]]; then
echo " [!!] Path cannot be empty."
else
export INSTALL_PREFIX_OVERRIDE="${CUSTOM_PATH}"
echo " [OK] Custom install: ${CUSTOM_PATH}"
break
fi ;;
*) echo " [!!] Invalid choice. Enter A, U, or C." ;;
esac
done
echo ""
# --- Optional tools ---
INSTALL_7ZIP=false
INSTALL_SERVY=false
INSTALL_CONAN=false
INSTALL_VSCODE=false
INSTALL_WINLIBS=false
INSTALL_GRPC=false
INSTALL_SQLITE=false
INSTALL_MATLAB=false
GRPC_VERSION="1.80.0"
# Apply profile pre-selections if specified
_apply_profile() {
case "${PROFILE}" in
cpp-dev)
INSTALL_CONAN=true; INSTALL_VSCODE=true
INSTALL_SQLITE=true; INSTALL_7ZIP=true
echo " [OK] Profile: cpp-dev (conan, vscode, sqlite, 7zip)"
;;
devops)
INSTALL_CONAN=true; INSTALL_SQLITE=true
INSTALL_7ZIP=true
echo " [OK] Profile: devops (conan, sqlite, 7zip)"
;;
minimal)
echo " [OK] Profile: minimal (required tools only)"
;;
full)
INSTALL_7ZIP=true; INSTALL_CONAN=true
INSTALL_VSCODE=true; INSTALL_SQLITE=true
INSTALL_MATLAB=true
if [[ "${OS}" == "windows" ]]; then
INSTALL_SERVY=true; INSTALL_WINLIBS=true; INSTALL_GRPC=true
fi
echo " [OK] Profile: full (all optional tools)"
;;
"")
# No profile -- use interactive prompts below
;;
*)
echo " [!!] Unknown profile: ${PROFILE}. Valid: cpp-dev, devops, minimal, full" >&2
exit 1
;;
esac
}
_apply_profile
if [[ -z "${PROFILE}" ]]; then
# --- Cross-platform tools ---
printf " Install conan 2.27.1? C/C++ package manager [~5s] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_CONAN=true
printf " Install sqlite 3.53.0 CLI? Database inspection tool [~3s] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_SQLITE=true
printf " Install 7zip 26.00? Archive tool [~2s] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_7ZIP=true
printf " Install vscode-extensions? C/C++, Python (needs 'code')[~30s] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_VSCODE=true
printf " Install matlab verification? Checks toolboxes [~2s] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_MATLAB=true
# --- Windows-only tools ---
if [[ "${OS}" == "windows" ]]; then
echo ""
echo " --- Windows-only tools ---"
printf " Install servy 7.9? Windows service manager [~3s] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_SERVY=true
printf " Install winlibs-gcc-ucrt? GCC 15.2.0 + MinGW-w64 [~8min] [y/N]: "
read -r reply
[[ "${reply^^}" == "Y" ]] && INSTALL_WINLIBS=true
printf " Install tools/frameworks/grpc? Requires Visual Studio [~20min] [y/N]: "
read -r reply
if [[ "${reply^^}" == "Y" ]]; then
INSTALL_GRPC=true
echo ""
echo " gRPC version:"
echo " [1] 1.80.0 (default)"
printf " Choose [1, default=1]: "
read -r ver_choice
case "${ver_choice}" in
*) GRPC_VERSION="1.80.0" ;;
esac
echo " [OK] gRPC version: ${GRPC_VERSION}"
fi
fi
fi
# --- Final confirmation ---
echo ""
_header " Ready to install -- please confirm"
echo ""
echo " Install prefix : ${INSTALL_PREFIX_OVERRIDE}"
echo " Rebuild : ${REBUILD}"
echo ""
echo " Tools to install:"
echo " [OK] tools/toolchains/clang, cmake 4.3.1, python 3.14.4, style-formatter"
[[ "${OS}" == "linux" ]] && echo " [OK] lcov 2.4"
[[ "${INSTALL_7ZIP}" == "true" ]] && echo " [OK] 7zip 26.00"
[[ "${INSTALL_SERVY}" == "true" ]] && echo " [OK] servy 7.9 (Windows only)"
[[ "${INSTALL_CONAN}" == "true" ]] && echo " [OK] conan 2.27.1"
[[ "${INSTALL_VSCODE}" == "true" ]] && echo " [OK] tools/dev-tools/vscode-extensions"
[[ "${INSTALL_WINLIBS}" == "true" ]] && echo " [OK] winlibs-gcc-ucrt"
[[ "${INSTALL_GRPC}" == "true" ]] && echo " [OK] tools/frameworks/grpc ${GRPC_VERSION}"
[[ "${INSTALL_SQLITE}" == "true" ]] && echo " [OK] sqlite 3.53.0"
[[ "${INSTALL_MATLAB}" == "true" ]] && echo " [OK] matlab (verification only)"
echo ""
_sep2
echo ""
printf " Press Enter to begin installation, or Ctrl+C to cancel..."
read -r
else
# --yes mode: use defaults
if [[ -n "${PREFIX_OVERRIDE}" ]]; then
export INSTALL_PREFIX_OVERRIDE="${PREFIX_OVERRIDE}"
else
export INSTALL_PREFIX_OVERRIDE="${USER_PREFIX}"
fi
INSTALL_7ZIP=false
INSTALL_SERVY=false
INSTALL_CONAN=false
INSTALL_VSCODE=false
INSTALL_WINLIBS=false
INSTALL_GRPC=false
INSTALL_SQLITE=false
INSTALL_MATLAB=false
GRPC_VERSION="1.80.0"
# Apply profile if given with --yes
if [[ -n "${PROFILE}" ]]; then
case "${PROFILE}" in
cpp-dev) INSTALL_CONAN=true; INSTALL_VSCODE=true; INSTALL_SQLITE=true; INSTALL_7ZIP=true ;;
devops) INSTALL_CONAN=true; INSTALL_SQLITE=true; INSTALL_7ZIP=true ;;
minimal) ;;
full)
INSTALL_7ZIP=true; INSTALL_CONAN=true; INSTALL_VSCODE=true
INSTALL_SQLITE=true; INSTALL_MATLAB=true
[[ "${OS}" == "windows" ]] && { INSTALL_SERVY=true; INSTALL_WINLIBS=true; INSTALL_GRPC=true; }
;;
esac
fi
echo ""
echo " [--yes] Non-interactive mode. Installing to: ${INSTALL_PREFIX_OVERRIDE}"
[[ -n "${PROFILE}" ]] && echo " [--yes] Profile: ${PROFILE}"
echo ""
fi
# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------
INSTALLED_TOOLS=()
FAILED_TOOLS=()
SKIPPED_TOOLS=()
_run_bootstrap_winlibs() {
local label="$1" script="$2"
local tool_prefix="${INSTALL_PREFIX_OVERRIDE}/${label}"
echo ""
_sep
echo " ${label}"
_sep
local rebuild_arg=()
[[ "${REBUILD}" == "true" ]] && rebuild_arg=("--rebuild")
if bash "${script}" "x86_64" --prefix "${tool_prefix}" "${rebuild_arg[@]}"; then
INSTALLED_TOOLS+=("${label}")
else
FAILED_TOOLS+=("${label}")
echo ""
echo " [!!] ${label} FAILED -- continuing with remaining tools."
fi
}
_run_bootstrap_no_prefix() {
local label="$1" script="$2"
shift 2
echo ""
_sep
echo " ${label}"
_sep
local rebuild_arg=()
[[ "${REBUILD}" == "true" ]] && rebuild_arg=("--rebuild")
if bash "${script}" "${rebuild_arg[@]}"; then
INSTALLED_TOOLS+=("${label}")
else
FAILED_TOOLS+=("${label}")
echo ""
echo " [!!] ${label} FAILED -- continuing with remaining tools."
fi
}
_run_bootstrap() {
local label="$1" script="$2"
shift 2
local extra_args=("$@")
echo ""
_sep
echo " ${label}"
_sep
local rebuild_arg=()
[[ "${REBUILD}" == "true" ]] && rebuild_arg=("--rebuild")
local tool_prefix="${INSTALL_PREFIX_OVERRIDE}/${label}"
if bash "${script}" \
--prefix "${tool_prefix}" \
"${rebuild_arg[@]}" \
"${extra_args[@]}"; then
INSTALLED_TOOLS+=("${label}")
else
FAILED_TOOLS+=("${label}")
echo ""
echo " [!!] ${label} FAILED -- continuing with remaining tools."
fi
}
_run_setup() {
local label="$1" script="$2"
shift 2
echo ""
_sep
echo " ${label}"
_sep
if bash "${script}" "$@"; then
INSTALLED_TOOLS+=("${label}")
else
FAILED_TOOLS+=("${label}")
echo ""
echo " [!!] ${label} FAILED -- continuing with remaining tools."
fi
}
# ---------------------------------------------------------------------------
# Banner
# ---------------------------------------------------------------------------
echo ""
_header " airgap-cpp-devkit -- Installing"
echo ""
echo " Platform : ${OS} Prefix : ${INSTALL_PREFIX_OVERRIDE}"
echo ""
# ---------------------------------------------------------------------------
# Step 1: prebuilt submodule
# ---------------------------------------------------------------------------
echo " [1/13] Checking prebuilt submodule..."
if ! git -C "${REPO_ROOT}" submodule status prebuilt 2>/dev/null | grep -q "^[^-]"; then
im_progress_start "Initialising prebuilt submodule"
git -C "${REPO_ROOT}" submodule update --init --recursive prebuilt
im_progress_stop "Submodule ready"
else
echo " [OK] prebuilt already initialized."
fi
# ---------------------------------------------------------------------------
# Step 2: tools/toolchains/clang
# ---------------------------------------------------------------------------
echo ""
echo " [2/13] Installing tools/toolchains/clang (required)..."
_run_bootstrap "toolchains/clang" \
"${REPO_ROOT}/tools/toolchains/clang/source-build/setup.sh"
# ---------------------------------------------------------------------------
# Step 3: cmake
# ---------------------------------------------------------------------------
echo ""
echo " [3/13] Installing cmake 4.3.1 (required)..."
_run_bootstrap "cmake" \
"${REPO_ROOT}/tools/build-tools/cmake/setup.sh"
# ---------------------------------------------------------------------------
# Step 4: python
# ---------------------------------------------------------------------------
echo ""
echo " [4/13] Installing python 3.14.4 (required)..."
_run_bootstrap "python" \
"${REPO_ROOT}/tools/languages/python/setup.sh"
# ---------------------------------------------------------------------------
# Step 5: lcov (Linux only)
# ---------------------------------------------------------------------------
if [[ "${OS}" == "linux" ]]; then
echo ""
echo " [5/13] Installing lcov 2.4 (required on Linux)..."
_run_bootstrap "lcov" \
"${REPO_ROOT}/tools/build-tools/lcov/setup.sh"
else
echo ""
echo " [5/13] lcov -- skipped (Linux only)"
SKIPPED_TOOLS+=("lcov (Linux only)")
fi
# ---------------------------------------------------------------------------
# Step 6: style-formatter
# ---------------------------------------------------------------------------
echo ""
echo " [6/13] Installing style-formatter (required)..."
_run_bootstrap_no_prefix "style-formatter" \
"${REPO_ROOT}/tools/toolchains/clang/style-formatter/bootstrap.sh"
# ---------------------------------------------------------------------------
# Step 7: 7zip (optional)
# ---------------------------------------------------------------------------
echo ""
echo " [7/13] 7-Zip 26.00 (optional)..."
if [[ "${INSTALL_7ZIP}" == "true" ]]; then
_run_setup "7zip" "${REPO_ROOT}/tools/dev-tools/7zip/setup.sh"
else
echo " [--] Skipped: 7zip"
SKIPPED_TOOLS+=("7zip")
fi
# ---------------------------------------------------------------------------
# Step 8: servy (optional, Windows only)
# ---------------------------------------------------------------------------
echo ""
echo " [8/13] Servy 7.8 (optional, Windows only)..."
if [[ "${INSTALL_SERVY}" == "true" ]]; then
_run_setup "servy" "${REPO_ROOT}/tools/dev-tools/servy/setup.sh"
else
echo " [--] Skipped: servy"
SKIPPED_TOOLS+=("servy")
fi
# ---------------------------------------------------------------------------
# Step 9: conan (optional, both platforms)
# ---------------------------------------------------------------------------
echo ""
echo " [9/13] Conan 2.27.1 (optional)..."
if [[ "${INSTALL_CONAN}" == "true" ]]; then
_run_setup "conan" "${REPO_ROOT}/tools/dev-tools/conan/setup.sh"
else
echo " [--] Skipped: conan"
SKIPPED_TOOLS+=("conan")
fi
# ---------------------------------------------------------------------------
# Step 10: tools/dev-tools/vscode-extensions (optional)
# ---------------------------------------------------------------------------
echo ""
echo " [10/13] VS Code extensions (optional)..."
if [[ "${INSTALL_VSCODE}" == "true" ]]; then
_run_bootstrap_no_prefix "dev-tools/vscode-extensions" \
"${REPO_ROOT}/tools/dev-tools/vscode-extensions/setup.sh"
else
echo " [--] Skipped: tools/dev-tools/vscode-extensions"
SKIPPED_TOOLS+=("tools/dev-tools/vscode-extensions")
fi
# ---------------------------------------------------------------------------
# Step 11: optional platform tools (Windows only)
# ---------------------------------------------------------------------------
echo ""
echo " [11/13] Optional platform tools..."
if [[ "${OS}" == "windows" ]]; then
if [[ "${INSTALL_WINLIBS}" == "true" ]]; then
_run_bootstrap_winlibs "winlibs-gcc-ucrt" \
"${REPO_ROOT}/tools/toolchains/gcc/windows/setup.sh"
else
echo " [--] Skipped: winlibs-gcc-ucrt"
SKIPPED_TOOLS+=("winlibs-gcc-ucrt")
fi
if [[ "${INSTALL_GRPC}" == "true" ]]; then
_run_bootstrap "grpc-${GRPC_VERSION}" \
"${REPO_ROOT}/tools/frameworks/grpc/setup_grpc.sh" \
"--version" "${GRPC_VERSION}"
else
echo " [--] Skipped: tools/frameworks/grpc"
SKIPPED_TOOLS+=("tools/frameworks/grpc")
fi
else
echo " [--] winlibs-gcc-ucrt -- skipped (Windows only)"
echo " [--] tools/frameworks/grpc -- skipped (Windows only)"
SKIPPED_TOOLS+=("winlibs-gcc-ucrt (Windows only)" "tools/frameworks/grpc (Windows only)")
fi
# ---------------------------------------------------------------------------
# Step 12: SQLite CLI (optional, both platforms)
# ---------------------------------------------------------------------------
echo ""
echo " [12/13] SQLite 3.53.0 CLI (optional)..."
if [[ "${INSTALL_SQLITE}" == "true" ]]; then
_run_setup "sqlite" "${REPO_ROOT}/tools/dev-tools/sqlite/setup.sh"
else
echo " [--] Skipped: sqlite"
SKIPPED_TOOLS+=("sqlite")
fi
# ---------------------------------------------------------------------------
# Step 13: MATLAB verification (optional, both platforms)
# ---------------------------------------------------------------------------
echo ""
echo " [13/13] MATLAB toolbox verification (optional)..."
if [[ "${INSTALL_MATLAB}" == "true" ]]; then
_run_bootstrap_no_prefix "matlab" \
"${REPO_ROOT}/tools/dev-tools/matlab/setup.sh"
else
echo " [--] Skipped: matlab"
SKIPPED_TOOLS+=("matlab")
fi
# ---------------------------------------------------------------------------
# Wire env.sh into ~/.bashrc
# ---------------------------------------------------------------------------
echo ""
echo " Wiring env.sh into ~/.bashrc..."
ENV_DIR="${INSTALL_PREFIX_OVERRIDE}"
ENV_FILE="${ENV_DIR}/env.sh"
BASHRC="${HOME}/.bashrc"
if [[ -f "${ENV_FILE}" ]]; then
SOURCE_LINE="source \"${ENV_FILE}\""
if grep -qF "${ENV_FILE}" "${BASHRC}" 2>/dev/null; then
echo " [OK] env.sh already wired into ${BASHRC}"
else
echo "" >> "${BASHRC}"
echo "# airgap-cpp-devkit -- added by install.sh" >> "${BASHRC}"
echo "${SOURCE_LINE}" >> "${BASHRC}"
echo " [OK] Added to ${BASHRC}: ${SOURCE_LINE}"
fi
else
echo " [!!] env.sh not found at ${ENV_FILE}"
echo " PATH not wired -- source manually after install completes."
fi
# ---------------------------------------------------------------------------
# Final summary
# ---------------------------------------------------------------------------
echo ""
_header " airgap-cpp-devkit -- Installation Complete"
echo ""
echo " Platform : ${OS} Date : $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
if [[ ${#INSTALLED_TOOLS[@]} -gt 0 ]]; then
echo " Installed:"
for t in "${INSTALLED_TOOLS[@]}"; do
echo " [OK] ${t}"
done
echo ""
fi
if [[ ${#SKIPPED_TOOLS[@]} -gt 0 ]]; then
echo " Skipped:"
for t in "${SKIPPED_TOOLS[@]}"; do
echo " [--] ${t}"
done
echo ""
fi
if [[ ${#FAILED_TOOLS[@]} -gt 0 ]]; then
echo " FAILED:"
for t in "${FAILED_TOOLS[@]}"; do
echo " [!!] ${t}"
done
echo ""
fi
_sep2
echo ""
echo " Prefix : ${INSTALL_PREFIX_OVERRIDE}"
[[ -f "${ENV_FILE}" ]] && echo " env.sh : ${ENV_FILE}"
echo ""
if [[ ${#FAILED_TOOLS[@]} -gt 0 ]]; then
echo " [!!] Some tools failed. Check logs in:"
case "${OS}" in
windows) echo " %TEMP%\\airgap-cpp-devkit\\logs\\" ;;
linux) echo " /var/log/airgap-cpp-devkit/" >&2 ;;
esac
echo ""
exit 1
fi
echo " Restart your shell or run:"
[[ -f "${ENV_FILE}" ]] && echo " source \"${ENV_FILE}\""
echo ""
echo " All installed tools will then be available on PATH."
echo ""
echo " To manage tools visually: bash launch.sh"
echo " Opens http://127.0.0.1:8080 -- dashboard, install, logs."
echo ""