-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·54 lines (43 loc) · 1.07 KB
/
build.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
#! /bin/bash
echo "Checking dependencies... "
for name in cmake g++ python3
do
if command -v $name >/dev/null 2>&1;
then
echo "$name OK."
else
echo "$name not installed! Please install it accordingly."
exit 1
fi
done
echo -e "All dependencies OK.\n"
echo -n "Checking if ytmusicapi module installed... "
python3 -c "import ytmusicapi" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e "OK\n"
else
echo "FAIL"
echo "Please install the ytmusicapi module. Check out the README at the repo for more info."
exit 1
fi
echo "Entering source folder..."
cd ./discord-rpc-buttons
if [ -d "./build" ]
then
echo "'build' folder exists. Cleaning all its contents..."
rm -r build
fi
mkdir build
echo "Entering build folder..."
cd build
echo -e "\nSetting up CMake..."
cmake .. -DCMAKE_INSTALL_PREFIX="../../"
echo -e "\nBuilding discord-rpc-buttons library..."
cmake --build . --config Release --target install
echo -e "\nCleaning up 'build' folder..."
cd ..
rm -r build
echo -e "\nCompiling program using Makefile..."
cd ..
make
echo "Done!"