forked from steemit/steem
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall-deps-linux.sh
More file actions
112 lines (101 loc) · 2.79 KB
/
install-deps-linux.sh
File metadata and controls
112 lines (101 loc) · 2.79 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
#!/usr/bin/env bash
# ============================================================================
# VIZ Linux Dependency Installer
#
# Installs all build dependencies required for viz-cpp-node.
# Must be run with root privileges (sudo).
#
# Usage:
# sudo ./install-deps-linux.sh
#
# Supported distros:
# - Ubuntu / Debian (apt-get)
# - Fedora / RHEL (dnf)
# ============================================================================
set -euo pipefail
# --- Colors ---
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
info() { echo -e "${GREEN}[INFO]${NC} $*"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
error() { echo -e "${RED}[ERROR]${NC} $*" >&2; exit 1; }
# --- Require root ---
if [[ $EUID -ne 0 ]]; then
error "This script must be run as root: sudo $0"
fi
# --- Install Ubuntu/Debian deps ---
install_deps_ubuntu() {
info "Installing build dependencies (Ubuntu/Debian)..."
apt-get update -qq
apt-get install -y --no-install-recommends \
autoconf \
automake \
autotools-dev \
binutils \
bsdmainutils \
build-essential \
cmake \
git \
ccache \
libboost-chrono-dev \
libboost-context-dev \
libboost-coroutine-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-locale-dev \
libboost-program-options-dev \
libboost-serialization-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libbz2-dev \
liblzma-dev \
libzstd-dev \
libreadline-dev \
libssl-dev \
libtool \
ncurses-dev \
pkg-config \
zlib1g-dev
info "Dependencies installed successfully."
}
# --- Install Fedora/RHEL deps ---
install_deps_fedora() {
info "Installing build dependencies (Fedora/RHEL)..."
dnf install -y \
autoconf \
automake \
cmake \
gcc-c++ \
git \
ccache \
boost-devel \
bzip2-devel \
lzma-devel \
libzstd-devel \
readline-devel \
openssl-devel \
libtool \
ncurses-devel \
pkg-config \
zlib-devel
info "Dependencies installed successfully."
}
# --- Dispatch ---
if command -v apt-get &>/dev/null; then
install_deps_ubuntu
elif command -v dnf &>/dev/null; then
install_deps_fedora
else
warn "Unsupported package manager. Please install dependencies manually."
warn "See documentation/building.md for the required package list."
exit 1
fi
echo ""
echo "============================================"
echo -e " ${GREEN}Dependency installation complete!${NC}"
echo " Now run: ./build-linux.sh"
echo "============================================"