Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alacritty #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions pbp-install-alacritty
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@
### Script Dependencies: (none)

## PBPTOOLSDIR
if [ -z $PBPTOOLSDIR ]; then
PBPTOOLSDIR="`pwd`"
if [ -z "$PBPTOOLSDIR" ]; then
PBPTOOLSDIR="$(pwd)"
fi

## VARS
DEVDIR=$PBPTOOLSDIR/upstream
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
# Override v0.10.0 with <branch>.
if [ -z "$GITBRANCH" ]; then
GITBRANCH=v0.10.0
fi
echo "\n*** GITBRANCH selected is $GITBRANCH.\n"
printf "\n*** GITBRANCH selected is %s.\n" "$GITBRANCH"

# Override gles3 with gles2 or none.
if [ -z $GLESVER ]; then
if [ -z "$GLESVER" ]; then
GLESVER=gles3
fi
echo "\n*** GLESVER selected is $GLESVER.\n"
printf "\n*** GLESVER selected is %s.\n" "$GLESVER"

PKGDIR=$GITTREE\_$GITBRANCH
PKGDIR="$GITTREE"\_"$GITBRANCH"

## DEPS
# Provide INSTALLDEPS=debian to install dependencies.
if [ $INSTALLDEPS ]; then
if [ $INSTALLDEPS = debian ]; then
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 \
Expand All @@ -44,20 +44,20 @@ fi

## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
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
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
if [ "$GLESVER" = gles3 ]; then
[ -f "$GITTREE"\_"$GLESVER".patch ] || wget -q -O- https://github.com/alacritty/alacritty/files/6819378/0001-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch.gz | zcat > "$GITTREE"\_"$GLESVER".patch
fi

## GIT
[ -d $PKGDIR ] || git clone --depth=1 $GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
[ -d "$PKGDIR" ] || git clone --depth=1 "$GITREPO"/"$GITTREE".git --branch="$GITBRANCH" "$PKGDIR"
cd "$PKGDIR"
git clean -f
git reset --hard HEAD
git pull
Expand All @@ -66,8 +66,8 @@ git pull
cargo clean

## PATCH
if [ $GLESVER = gles2 -o $GLESVER = gles3 ]; then
patch -p1 < $DEVDIR/$GITTREE\_$GLESVER.patch
if [ "$GLESVER" = gles2 ] || [ "$GLESVER" = gles3 ]; then
patch -p1 < "$DEVDIR"/"$GITTREE"\_"$GLESVER".patch
fi

## BUILD
Expand All @@ -85,8 +85,10 @@ sudo install -D -m644 "extra/logo/alacritty-term.svg" "/usr/local/share/pixmaps/
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
if [ "$INSTALLDEPS" ]; then
if [ "$INSTALLDEPS" = debian ]; then
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/local/bin/alacritty 90
fi
fi

## EXIT
Expand Down