forked from TrisH0x2A/jade
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
67 lines (51 loc) · 1.96 KB
/
Copy pathsetup.sh
File metadata and controls
67 lines (51 loc) · 1.96 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
#!/bin/bash
install_linux_deps() {
echo "Installing dependencies for Linux..."
sudo apt update
sudo apt install -y cmake pkg-config libwebkit2gtk-4.0-dev libuv1-dev
echo "Linux dependencies installed."
}
install_mac_deps() {
echo "Installing dependencies for macOS..."
if ! command -v brew &>/dev/null; then
echo "Homebrew not found. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install cmake pkg-config webkit2gtk libuv
echo "macOS dependencies installed."
}
configure_for_mac() {
echo "Configuring CMakeLists.txt for macOS..."
echo -e "\n# macOS specific configuration" >> CMakeLists.txt
echo 'if(APPLE)' >> CMakeLists.txt
echo ' target_link_libraries(jade' >> CMakeLists.txt
echo ' ${WEBKIT_LIBRARIES}' >> CMakeLists.txt
echo ' ${LIBUV_LIBRARIES}' >> CMakeLists.txt
echo ' "-framework JavaScriptCore"' >> CMakeLists.txt
echo 'else()' >> CMakeLists.txt
echo ' target_link_libraries(jade' >> CMakeLists.txt
echo ' ${WEBKIT_LIBRARIES}' >> CMakeLists.txt
echo ' ${LIBUV_LIBRARIES}' >> CMakeLists.txt
echo ' )' >> CMakeLists.txt
echo 'endif()' >> CMakeLists.txt
echo "CMakeLists.txt configured for macOS."
}
configure_for_linux() {
echo "Configuring CMakeLists.txt for Linux..."
echo -e "\n# Linux specific configuration" >> CMakeLists.txt
echo 'if(NOT APPLE)' >> CMakeLists.txt
echo ' pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0)' >> CMakeLists.txt
echo 'endif()' >> CMakeLists.txt
echo "CMakeLists.txt configured for Linux."
}
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
install_linux_deps
configure_for_linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
install_mac_deps
configure_for_mac
else
echo "Unsupported operating system: $OSTYPE"
exit 1
fi
echo "Setup complete! You can now build the project using ./build.sh."