-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
111 lines (97 loc) · 2.61 KB
/
setup.sh
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
#!/bin/sh
# Compilation script for the NymphCast MediaServer
# Installs needed dependencies and compiles the project.
# Install the dependencies.
PLATFORM="unknown"
case "$(uname -s)" in
Darwin)
echo 'Mac OS X'
PLATFORM="macos"
if [ -x "$(command -v brew)" ]; then
brew update
brew install poco
fi
;;
Linux)
echo 'Linux'
PLATFORM="linux"
if [ -x "$(command -v apt)" ]; then
sudo apt update
sudo apt -y install git g++ libpoco-dev
elif [ -x "$(command -v apk)" ]; then
sudo apk update
sudo apk add poco-dev
elif [ -x "$(command -v pacman)" ]; then
sudo pacman -Syy
sudo pacman -S --noconfirm --needed git poco
fi
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*)
echo 'MS Windows/MinGW'
PLATFORM="mingw"
if [ -x "$(command -v pacman)" ]; then
pacman -Syy
pacman -S --noconfirm --needed git mingw-w64-x86_64-poco
fi
;;
*)
echo 'Unsupported OS'
exit
;;
esac
if [ -n "${UPDATE}" ]; then
if [ "${PLATFORM}" == "linux" ]; then
if [ -f "/usr/local/lib/libnymphrpc.a" ]; then
sudo rm /usr/local/lib/libnymphrpc.*
sudo rm -rf /usr/local/include/nymph
fi
elif [ "${PLATFORM}" == "mingw" ]; then
if [ -f "/mingw64/lib/libnymphrpc.a" ]; then
rm /mingw64/lib/libnymphrpc.a
fi
fi
fi
if [ -f "/usr/lib/libnymphrpc.so" ]; then
echo "NymphRPC dynamic library found in /usr/lib. Skipping installation."
elif [ -f "/mingw64/lib/libnymphrpc.so" ]; then
echo "NymphRPC dynamic library found in /mingw64/lib. Skipping installation."
else
# Obtain current version of NymphRPC
git clone --depth 1 https://github.com/MayaPosch/NymphRPC.git
# Build NymphRPC and install it.
echo "Installing NymphRPC..."
make -C NymphRPC/ lib
if [ "${PLATFORM}" == "mingw" ]; then
make -C NymphRPC/ install
else
sudo make -C NymphRPC/ install
fi
fi
# Remove NymphRPC folder.
rm -rf NymphRPC
# Build NymphCast client library.
#make -C src/client_lib/ clean
#make -C src/client_lib/
if [ -f "/usr/lib/libnymphcast.so" ]; then
echo "LibNymphCast dynamic library found in /usr/lib. Skipping installation."
elif [ -f "/mingw64/lib/libnymphcast.so" ]; then
echo "LibNymphCast dynamic library found in /mingw64/lib. Skipping installation."
else
# Obtain current version of LibNymphCast
git clone --depth 1 https://github.com/MayaPosch/libnymphcast.git
# Build libnymphcast and install it.
echo "Installing LibNymphCast..."
make -C libnymphcast/ lib
if [ "${PLATFORM}" == "mingw" ]; then
make -C libnymphcast/ install
else
sudo make -C libnymphcast/ install
fi
fi
# Remove libnymphcast folder
rm -rf libnymphcast
# Build the server.
make
#if [ ! -z "${PACKAGE}" ]; then
# Packaging step.
#fi