-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpbp-install-alacritty
executable file
·95 lines (78 loc) · 2.89 KB
/
pbp-install-alacritty
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
#!/bin/sh
### Package: pbp-install-alacritty
### Version: v20200725.2300
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: (none)
## PBPTOOLSDIR
if [ -z $PBPTOOLSDIR ]; then
PBPTOOLSDIR="`pwd`"
fi
## VARS
DEVDIR=$PBPTOOLSDIR/upstream
GITREPO=https://github.com/alacritty
GITTREE=alacritty
## OVERRIDES
# Override v0.4.2 with <branch>.
if [ -z $GITBRANCH ]; then
GITBRANCH=v0.4.2
fi
echo "\n*** GITBRANCH selected is $GITBRANCH.\n"
# Override gles3 with gles2 or none.
if [ -z $GLESVER ]; then
GLESVER=gles3
fi
echo "\n*** GLESVER selected is $GLESVER.\n"
PKGDIR=$GITTREE\_$GITBRANCH
## DEPS
# Provide INSTALLDEPS=debian to install dependencies.
if [ $INSTALLDEPS ]; then
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y install build-essential coreutils libc-bin wget patch \
libfontconfig-dev libfreetype-dev libxcb1-dev libgcc-9-dev libc6-dev libexpat1-dev \
libuuid1 uuid-dev libpng-dev zlib1g-dev libxau-dev libxdmcp-dev libbsd-dev \
ncurses-bin libncurses-dev fish cargo desktop-file-utils
fi
fi
## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
## GLES
if [ $GLESVER = gles2 ]; then
[ -f $GITTREE\_$GLESVER.patch ] || wget https://github.com/cyclopsian/alacritty/commit/2e15b476ea1125c6fa6c0a694e8a911079577da7.patch -O $GITTREE\_$GLESVER.patch
fi
if [ $GLESVER = gles3 ]; then
[ -f $GITTREE\_$GLESVER.patch ] || wget https://github.com/cyclopsian/alacritty/commit/4a659169bd69312ec59fa283b069f6710088a688.patch -O $GITTREE\_$GLESVER.patch
fi
## GIT
[ -d $PKGDIR ] || git clone --depth=1 $GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
git clean -f
git reset --hard HEAD
git pull
## CLEAN
cargo clean
## PATCH
if [ $GLESVER = gles2 -o $GLESVER = gles3 ]; then
patch -p1 < $DEVDIR/$GITTREE\_$GLESVER.patch
fi
## BUILD
cargo build --release
## INSTALL
sudo desktop-file-install -m 644 --dir "/usr/local/share/applications/" "extra/linux/Alacritty.desktop"
sudo install -D -m644 "alacritty.yml" "/usr/local/share/doc/alacritty/example/alacritty.yml"
sudo install -D -m644 "extra/alacritty.man" "/usr/local/share/man/man1/alacritty.1"
sudo install -D -m644 "extra/completions/alacritty.bash" "/usr/local/share/bash-completion/completions/alacritty"
sudo install -D -m644 "extra/completions/_alacritty" "/usr/local/share/zsh/site-functions/_alacritty"
sudo install -D -m644 "extra/completions/alacritty.fish" "/usr/local/share/fish/vendor_completions.d/alacritty.fish"
sudo install -D -m644 "extra/linux/io.alacritty.Alacritty.appdata.xml" "/usr/local/share/appdata/io.alacritty.Alacritty.appdata.xml"
sudo install -D -m644 "extra/logo/alacritty-term.svg" "/usr/local/share/pixmaps/Alacritty.svg"
sudo install -D -m755 "target/release/alacritty" "/usr/local/bin/alacritty"
## X-TERMINAL-EMULATOR
if [ $INSTALLDEPS = debian ]; then
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/local/bin/alacritty 90
fi
## EXIT
exit
## ENJOY