forked from FeynmanTech/cathook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-all
More file actions
executable file
·44 lines (35 loc) · 1.49 KB
/
install-all
File metadata and controls
executable file
·44 lines (35 loc) · 1.49 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
#!/usr/bin/env bash
RUNUSER="sudo -u $LOGNAME"
#
# Install git in case this is a install-all only install
#
if [ -x "$(command -v pacman)" ]; then
sudo pacman -S --needed --noconfirm git
elif [ -x "$(command -v apt-get)" ]; then
sudo apt-get install -y git
else
echo -e "\033[1;31m\nCathook autoinstall is not supported on this system! Please install the following packages before continuing: Git, Boost + Headers, CMake, Gcc with 32 bit support, Gdb, 32 Bit SDL + Headers, 32 Bit Glew + Headers, 32 Bit Freetype 2 + Headers, Rsync, 32 Bit libglvnd\n\033[0m"
read -p "Press enter to continue or CTRL+C to cancel."
fi
#
# Update cathook
#
if [ ! -d "./.git" ]; then
$RUNUSER git init
$RUNUSER git remote add origin https://github.com/nullworks/cathook
fi
$RUNUSER git fetch --force --depth 1 origin refs/tags/latest:refs/tags/latest && $RUNUSER git reset --hard latest # pull changes from github
$RUNUSER git submodule update --depth 1 --init --recursive # update/init submodules
# install all dependencies and allow non interactive install
./scripts/dependencycheck true
#
# Set config version for update script
#
$RUNUSER bash -c ". ./scripts/config.shlib; cfg_write ./scripts/updater-preferences version 1"
#
# Build cathook
#
$RUNUSER mkdir -p ./build; pushd build #create a directory for building cathook
$RUNUSER cmake ..;$RUNUSER make -j$(grep -c '^processor' /proc/cpuinfo) # create makefile and build using all available threads
sudo make data # create /opt/cathook/data
popd; cd ..