-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.toml
156 lines (130 loc) · 3.22 KB
/
Makefile.toml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
[env]
LINUX_DEPLOY_DL = "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
QT_PLUGIN_DL = "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
OUT_DIR = ".appimage"
# Builds libherald with desktop deployment feature
[tasks.build_libherald]
private = true
script = [
'''
cd libherald
cargo build --release --features deploy
'''
]
# Creates AppImage build directory if it does not already exist
[tasks.make_out_dir]
private = true
command = "mkdir"
args = ["-p", "${OUT_DIR}"]
[tasks.make_out_dir.mac]
private = true
command = "mkdir"
args = ["-p", "build"]
# Installs the `linuxdeploy` tool, and plugins
[tasks.install_linuxdeploy]
private = true
install_script = [
'''
if ! [ -f "$OUT_DIR/linuxdeploy-x86_64.AppImage" ]; then
wget "$LINUX_DEPLOY_DL" -O $OUT_DIR/linuxdeploy-x86_64.AppImage
wget "$QT_PLUGIN_DL" -O $OUT_DIR/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x $OUT_DIR/linuxdeploy*.AppImage
fi
'''
]
dependencies = ["make_out_dir"]
[tasks.check_qmake_installation]
private = true
script = [
'''
if ! [ -x "$(command -v qmake)" ]; then
echo "Error: qmake is not installed." >&2
exit 1
fi
'''
]
[tasks.check_macdeployqt_installation]
script = [
'''
if ! [ -x "$(command -v macdeployqt)" ]; then
echo "Error: qmake is not installed." >&2
exit 1
fi
if ! qmake -v | grep "[5-9].1[4-9]"; then
echo "Error: macdeployqt version in the PATH is too low, run Brew update or the qt maintenance tool to get a the correct version" >&2
exit 1
fi
'''
]
# Runs qmake
[tasks.run_qmake]
private = true
command = "qmake"
args = ["client/desktop/herald.pro",
"-spec", "linux-g++",
"CONFIG+=qtquickcompiler",
"-o", "${OUT_DIR}/Makefile"]
dependencies = ["check_qmake_installation", "make_out_dir"]
# Runs qmake macos
[tasks.run_qmake.mac]
private = true
command = "qmake"
args = ["client/desktop/herald.pro",
"CONFIG+=qtquickcompiler",
"-o", "build/Makefile"]
dependencies = ["check_qmake_installation","check_macdeployqt_installation", "make_out_dir"]
[tasks.setup_outdir]
workspace = false
dependencies = ["build_libherald", "run_qmake"]
[tasks.run_make]
script = [
'''
make -C $OUT_DIR -j$(nproc)
'''
]
dependencies = ["setup_outdir"]
[tasks.run_make.mac]
script = [
'''
make -C build
'''
]
dependencies = ["setup_outdir"]
[tasks.run_make_install]
workspace = false
command = "make"
args = ["-C", "${OUT_DIR}",
"install", "INSTALL_ROOT=AppDir"]
dependencies = ["run_make"]
[tasks.run_make_install.mac]
workspace = false
command = "make"
args = ["-C", "build"]
dependencies = ["run_make"]
[tasks.build_appimage]
workspace = false
script = [
'''
export QML_SOURCES_PATHS=../client/desktop
cd $OUT_DIR
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--output appimage \
--plugin qt \
-i ../client/foundation/icons/herald.png \
-d ../client/desktop/herald.desktop \
'''
]
dependencies = ["run_make_install"]
[tasks.build_appbundle]
workspace = false
script = [
'''
export QML_SOURCES_PATHS=../client/desktop
cd build
macdeployqt \
herald.app \
-qmldir=../client/desktop
'''
]
dependencies = ["run_make_install"]