forked from barnumbirr/alacritty-debian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·49 lines (40 loc) · 1.01 KB
/
entrypoint.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
#!/bin/bash
set -xeu
BRANCH="$VERSION"
DEBIAN_FRONTEND=noninteractive
DEB_BUILD_OPTIONS=parallel=$(nproc)
OS_VERSION=$(sed 's/\..*//' /etc/debian_version)
TARGET="$PWD"
export DEBIAN_FRONTEND DEB_BUILD_OPTIONS
dependencies() {
apt update && apt install -y devscripts equivs git
if [ "$OS_VERSION" = 11 ] || [ "$OS_VERSION" = 12 ]; then
apt install -y curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. ~/.cargo/env
fi
}
get_sources() {
cd "$(mktemp -d)"
git clone -b "$BRANCH" https://github.com/alacritty/alacritty.git alacritty
cd alacritty
}
build() {
cp -a "$TARGET/debian" .
yes | mk-build-deps --install
dpkg-source --before-build .
debian/rules build
debian/rules binary
}
copy() {
TARGET_UID="$(stat --printf %u "$TARGET")"
TARGET_GID="$(stat --printf %g "$TARGET")"
install -o "$TARGET_UID" -g "$TARGET_GID" -t "$TARGET/target" ../*.deb
}
main() {
dependencies
get_sources
build
copy
}
main