-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_linux_qt5.sh
More file actions
62 lines (42 loc) · 1.29 KB
/
build_linux_qt5.sh
File metadata and controls
62 lines (42 loc) · 1.29 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
#!/bin/bash
## Dependencies
# install dependencies
if [[ " $@ " =~ " --dependencies " ]]; then
if [[ -f /etc/arch-release ]]; then
# Arch/Manjaro
yay -S --noconfirm qt5-webkit
else
echo "unable to install dependencies - unsupported system"
#sudo apt install -y libqt5webkit5
fi
fi
## Prepare
# construct version string
BUILD="HUI-linux-$(uname -m)-webkit-qt5"
# create target directory
mkdir -p $BUILD
cd $BUILD
## Build
# build
g++ -shared -fPIC -o ./libHUI.so ../hui_webview__webkit_qt5.cc -I.. `pkg-config --cflags --libs Qt5Widgets Qt5WebKitWidgets`
# TODO: qmake *.moc
## Deploy
if [[ " $@ " =~ " --deploy " ]]; then
# TODO: linux packaging; AUR package, pkg config file
echo "deploying not supported"
fi
## Tests
if [[ " $@ " =~ " --tests " ]]; then
# build tests
g++ -o test_webview_js_api ../tests/test_webview_js_api.cc -I.. -L. -lHUI
fi
## Notes
# Qt uses moc (Meta-Object Compiler) so you may need to use `qmake` (and `make`) in order to generate `qt5_generated.moc` (pre-generated one is already present in the source tree - just in case you need to generate it, there is guide):
# ```
# cd .
# qmake ./qt5_build.pro
# make
# mv ./release/*.moc ./qt5_generated.moc
# ```
# (note: make doesnt have to complete compilation - we just need it to generate that one file)
cd ..