-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·63 lines (56 loc) · 1.4 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: Andrew Hayzen <ahayzen@gmail.com>
#
# SPDX-License-Identifier: MPL-2.0
set -e
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
# shellcheck source=src/global.sh
source "$SCRIPTPATH/src/global.sh"
BIN_TARGET="$SCRIPTPATH/bin/$NAME"
mkdir -p "$SCRIPTPATH/bin"
# Build the binary from multiple sources
PROJECT_FILES=(
"src/global.sh"
"src/utils.sh"
"src/container/build.sh"
"src/container/exec.sh"
"src/container/main.sh"
"src/container/podman.sh"
"src/folders/box.sh"
"src/folders/persist.sh"
"src/folders/main.sh"
"src/sandbox/alsa.sh"
"src/sandbox/custom.sh"
"src/sandbox/gdb.sh"
"src/sandbox/git.sh"
"src/sandbox/gpu.sh"
"src/sandbox/group.sh"
"src/sandbox/kvm.sh"
"src/sandbox/name.sh"
"src/sandbox/pipewire.sh"
"src/sandbox/pulseaudio.sh"
"src/sandbox/selinux.sh"
"src/sandbox/ssh.sh"
"src/sandbox/term.sh"
"src/sandbox/timezone.sh"
"src/sandbox/usb.sh"
"src/sandbox/user.sh"
"src/sandbox/wayland.sh"
"src/sandbox/workdir.sh"
"src/sandbox/x11.sh"
"src/sandbox/xdg.sh"
"src/sandbox/main.sh"
"src/main.sh"
)
echo "#!/usr/bin/env bash" > "$BIN_TARGET"
for FILE in "${PROJECT_FILES[@]}"; do
echo "" >> "$BIN_TARGET"
cat "$SCRIPTPATH/${FILE}" >> "$BIN_TARGET"
done
{
echo ""
echo 'main "$@"'
} >> "$BIN_TARGET"
chmod +x "$BIN_TARGET"