-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·48 lines (37 loc) · 1011 Bytes
/
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
#!/bin/sh
dir="$(dirname "$(readlink -f "$0" )" )"
buildDir="${dir}/build"
die() {
printf '%s\n' "$1"
exit 1
}
not_installed() {
die "$1 needs to be installed to build this."
}
check_installed_bin() {
which "$1" || not_installed "$1"
}
check_installed_lib() {
pkg-config "$1" || not_installed "$1"
}
as_flatpak() { # not working I believe
check_installed_bin dex
check_installed_bin flatpak-builder
check_installed_bin flatpak
flatpak-builder --force-clean "${buildDir}" xyz.merlinx.Spotipyne.json
dex "${buildDir}/export/share/applications/xyz.merlinx.Spotipyne.desktop"
}
as_bin() {
check_installed_bin "meson"
check_installed_bin "ninja"
check_installed_bin "geckodriver"
check_installed_bin "gettext"
check_installed_lib "libhandy-1"
check_installed_bin "python3"
check_installed_bin "pip3"
pip3 install -r requirements.txt
meson "${dir}/build" "${dir}" && \
ninja -C "${dir}/build" && \
echo "Almost done! To install just type: ninja -C \""${dir}/build"\" install"
}
as_bin