2021-06-15 10:26:26 +02:00
|
|
|
#!/bin/bash
|
2019-04-09 09:19:17 +02:00
|
|
|
|
|
|
|
# variables
|
2021-09-23 15:52:55 +02:00
|
|
|
GITHUB_REPO=jwilm/alacritty
|
2023-12-11 09:37:52 +01:00
|
|
|
VERSION=${VERSION:-trunk} # 'latest' will not select the actual latest tag
|
2019-04-09 09:19:17 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
|
2020-06-25 11:23:11 +02:00
|
|
|
TAG=gwh
|
2019-04-09 09:19:17 +02:00
|
|
|
TMP=/tmp/$TAG
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
|
|
|
2022-01-22 19:52:02 +01:00
|
|
|
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
2019-04-09 09:19:17 +02:00
|
|
|
PREFIX=${PREFIX:-/usr}
|
|
|
|
|
|
|
|
# nettoyage préalable
|
|
|
|
rm -fr $PKG $TMP/$PRGNAM
|
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
|
|
# mise en place
|
|
|
|
cd $TMP
|
2021-09-23 15:52:55 +02:00
|
|
|
[ ! -e $REPOSITORY ] && git clone https://github.com/${GITHUB_REPO}.git $REPOSITORY
|
2021-06-15 10:59:49 +02:00
|
|
|
cd $REPOSITORY
|
|
|
|
git pull --all
|
2019-04-09 09:19:17 +02:00
|
|
|
|
|
|
|
cp -R $REPOSITORY $TMP/
|
|
|
|
cd $TMP/$PRGNAM
|
2022-10-03 16:35:04 +02:00
|
|
|
[ "x$VERSION" == "xlatest" ] && VERSION=$(git describe --tags --abbrev=0)
|
2022-01-22 10:52:07 +01:00
|
|
|
[ "x$VERSION" == "x" ] && VERSION=trunk
|
2023-03-23 09:54:21 +01:00
|
|
|
[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION
|
2019-04-09 09:19:17 +02:00
|
|
|
|
|
|
|
cargo build --release
|
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/bin
|
2021-04-08 14:49:15 +02:00
|
|
|
find target/release/ -type f -executable -maxdepth 1 -exec cp {} $PKG$PREFIX/bin/ \;
|
2019-04-09 09:19:17 +02:00
|
|
|
chmod 755 $PKG$PREFIX/bin/*
|
|
|
|
|
2021-07-11 11:36:06 +02:00
|
|
|
mkdir -p $PKG$PREFIX/man/man1
|
2023-12-07 14:46:14 +01:00
|
|
|
mkdir -p $PKG$PREFIX/man/man5
|
|
|
|
scdoc < extra/man/alacritty.1.scd | gzip -c | sudo tee $PKG$PREFIX/man/man1/alacritty.1.gz > /dev/null
|
|
|
|
scdoc < extra/man/alacritty-msg.1.scd | gzip -c | sudo tee $PKG$PREFIX/man/man1/alacritty-msg.1.gz > /dev/null
|
|
|
|
scdoc < extra/man/alacritty.5.scd | gzip -c | sudo tee $PKG$PREFIX/man/man5/alacritty.5.gz > /dev/null
|
|
|
|
scdoc < extra/man/alacritty-bindings.5.scd | gzip -c | sudo tee $PKG$PREFIX/man/man5/alacritty-bindings.5.gz > /dev/null
|
|
|
|
|
2021-07-11 11:36:06 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/info
|
|
|
|
cp extra/alacritty.info $PKG$PREFIX/info/
|
|
|
|
gzip -9 $PKG$PREFIX/info/alacritty.info
|
|
|
|
|
2023-12-07 14:46:14 +01:00
|
|
|
mkdir -p $PKG$PREFIX/share/applications $PKG$PREFIX/share/pixmaps
|
2021-07-11 11:36:06 +02:00
|
|
|
cp extra/linux/Alacritty.desktop $PKG$PREFIX/share/applications/
|
2023-12-07 14:46:14 +01:00
|
|
|
cp extra/logo/alacritty-term.svg $PKG$PREFIX/share/pixmaps/Alacritty.svg
|
2021-07-11 11:36:06 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/share/appdata
|
|
|
|
cp extra/linux/io.alacritty.Alacritty.appdata.xml $PKG$PREFIX/share/appdata/
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/bash-completion/completions
|
|
|
|
cp extra/completions/alacritty.bash $PKG/usr/share/bash-completion/completions/alacritty
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/zsh/site-functions
|
|
|
|
cp extra/completions/_alacritty $PKG/usr/share/zsh/site-functions/
|
|
|
|
|
2019-04-09 09:19:17 +02:00
|
|
|
# move doc/ to the appropriate location
|
|
|
|
mkdir -p $PKG$PREFIX/doc/$PRGNAM
|
2023-12-07 14:59:09 +01:00
|
|
|
cp -a docs/ extra/ scripts/ *.md $PKG$PREFIX/doc/$PRGNAM
|
2019-04-09 09:19:17 +02:00
|
|
|
|
|
|
|
# correction
|
|
|
|
cd $PKG
|
|
|
|
chown -R root:root *
|
|
|
|
|
2022-03-03 10:28:31 +01:00
|
|
|
[ -d $PKG$PREFIX/man ] && find $PKG$PREFIX/man -type f -not -name \*.gz -exec gzip -9 {} \;
|
2019-04-09 09:19:17 +02:00
|
|
|
|
|
|
|
# embaumement
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
|
|
# HOW TO EDIT THIS FILE:
|
|
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
|
|
# up the first '|' above the ':' following the base package name, and the '|'
|
|
|
|
# on the right side marks the last column you can put a character in. You must
|
|
|
|
# make exactly 11 lines for the formatting to be correct. It's also
|
|
|
|
# customary to leave one space after the ':'.
|
|
|
|
|
|
|
|
|-----handy-ruler------------------------------------------------------|
|
|
|
|
$PRGNAM: $PRGNAM (A cross-platform, GPU-accelerated terminal emulator)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: Alacritty is a terminal emulator with a strong focus on simplicity
|
|
|
|
$PRGNAM: and performance. With such a strong focus on performance, included
|
|
|
|
$PRGNAM: features are carefully considered and you can always expect Alacritty
|
|
|
|
$PRGNAM: to be blazingly fast. By making sane choices for defaults, Alacritty
|
|
|
|
$PRGNAM: requires no additional setup. However, it does allow configuration of
|
|
|
|
$PRGNAM: many aspects of the terminal.
|
|
|
|
$PRGNAM:
|
2021-09-23 15:52:55 +02:00
|
|
|
$PRGNAM: https://github.com/${GITHUB_REPO}
|
2021-04-08 14:49:15 +02:00
|
|
|
$PRGNAM:
|
2019-04-09 09:19:17 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
# empaquetage
|
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2023-08-16 12:23:26 +02:00
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | tr - _)-$ARCH-$BUILD$TAG.txz
|