-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathinstall_deps_root.sh
More file actions
executable file
·160 lines (141 loc) · 3.63 KB
/
install_deps_root.sh
File metadata and controls
executable file
·160 lines (141 loc) · 3.63 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
#!/bin/bash
# This script must be run as root (for example with sudo).
run_script() {
# If current user ID is NOT 0 (root)
if [[ $EUID -ne 0 ]]; then
echo "This script requires root to install dependencies. Rerun and escalate privileges (eg. sudo ...)"
return 1
fi
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
pushd "$SCRIPT_DIR"
source ./install_package_fn.sh
if ! install_package base-devel; then
return 1
fi
if ! install_package clang; then
return 1
fi
if ! install_package lldb; then
return 1
fi
if ! install_package cmake; then
return 1
fi
if ! install_package gnutls-dev; then
return 1
fi
if ! install_package icu-dev; then
return 1
fi
if ! install_package ffi-dev; then
return 1
fi
if ! install_package xslt-dev; then
return 1
fi
if ! install_package png-dev; then
return 1
fi
if ! install_package zlib-dev; then
return 1
fi
if ! install_package nspr-dev; then
return 1
fi
if ! install_package espeak-ng-dev; then
return 1
fi
# Some distributions put the data in arch-specific paths
HOSTARCH="$(usr/bin/arch 2>/dev/null || echo x86_64)"
if [ ! -d /usr/share/espeak-ng-data ]; then
if [ ! -d /usr/local/share/espeak-ng-data ]; then
if [ ! -d /usr/lib/"$HOSTARCH"-linux-gnu/espeak-ng-data ]; then
echo "❌ espeak-ng-data not in /usr/share, /usr/local/share or /usr/lib/$HOST_ARCH-linux-gnu!"
return 1
fi
fi
fi
if ! install_package vorbis-dev; then
return 1
fi
if ! install_package openal-dev; then
return 1
fi
if ! install_package opengl-dev; then
return 1
fi
if ! install_package glu-dev; then
return 1
fi
if ! install_package sdl12-compat; then
return 1
fi
if ! install_package x11-dev; then
return 1
fi
# For building AppImage
if ! install_package file; then
return 1
fi
if ! install_package fuse; then
return 1
fi
# For building Flatpak
if ! install_package flatpak; then
return 1
fi
export CC=clang
export CXX=clang++
if ! cd ../../build; then
echo "❌ build folder doesn't exist!" >&2
return 1
fi
cd libobjc2
rm -rf build
mkdir build
cd build
if ! cmake -DTESTS=on -DCMAKE_BUILD_TYPE=Release -DGNUSTEP_INSTALL_TYPE=NONE -DEMBEDDED_BLOCKS_RUNTIME=ON -DOLDABI_COMPAT=OFF ../; then
echo "❌ libobjc2 cmake configure failed!" >&2
return 1
fi
if ! cmake --build .; then
echo "❌ libobjc2 cmake build failed!" >&2
return 1
fi
cmake --install .
cd ../..
cd tools-make
make clean
# Bash
if [[ ${CURRENT_DISTRO,,} == "redhat" ]]; then
LIB_PARAM="--with-libdir=lib64"
else
LIB_PARAM=""
fi
if ! ./configure --with-library-combo=ng-gnu-gnu --with-runtime-abi=gnustep-2.2 ${LIB_PARAM:+"$LIB_PARAM"}; then
echo "❌ tools-make configure failed!" >&2
return 1
fi
make
make install
cd ..
cd libs-base
make clean
source /usr/local/share/GNUstep/Makefiles/GNUstep.sh
if ! ./configure; then
echo "❌ libs-base configure failed!" >&2
return 1
fi
if ! make -j$(nproc); then
echo "❌ libs-base make failed!" >&2
return 1
fi
make install
popd
}
run_script "$@"
status=$?
# Exit only if not sourced
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
exit $status
fi