Last active
April 3, 2022 15:03
-
-
Save rexroof/76ddee88a14d6a0532762ce5f6290200 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SRCDIR="${HOME}/github/alacritty" | |
if command -v podman ;then | |
PODMAN=$(command -v podman) | |
DOCKERFILE="Containerfile" | |
fi | |
if command -v docker ;then | |
PODMAN=$(command -v docker) | |
DOCKERFILE="Dockerfile" | |
fi | |
if [ -z "$PODMAN" ] ; then | |
echo podman/docker not found | |
exit 1 | |
fi | |
OS_IMAGE="ubuntu" | |
if [ "$ID" = "arch" ] ; then | |
OS_IMAGE="archlinux" | |
fi | |
if [ ! -d "$SRCDIR" ] ; then | |
git clone https://github.com/alacritty/alacritty $SRCDIR | |
fi | |
cd $SRCDIR | |
git fetch --all | |
if [ -n "$1" ] ; then | |
git checkout $1 | |
else | |
git pull | |
fi | |
rm -f $DOCKERFILE | |
cat <<'END' > $DOCKERFILE | |
FROM rust | |
RUN apt-get update \ | |
&& apt-get install -y cmake pkg-config libfreetype6-dev \ | |
libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev \ | |
python3 | |
WORKDIR /src | |
CMD cargo clean && cargo build --release | |
END | |
$PODMAN pull rust | |
$PODMAN build -t buildalacritty . | |
$PODMAN run --rm -it -v $PWD:/src buildalacritty | |
ls -al target/release/alacritty /usr/bin/alacritty | |
sudo mv /usr/bin/alacritty /tmp/alacritty | |
sudo cp target/release/alacritty /usr/bin/alacritty | |
ls -al target/release/alacritty /usr/bin/alacritty | |
if [ -d $HOME/.local/share/applications/ ]; then | |
if [ ! -f $HOME/.local/share/applications/Alacritty.desktop ] ; then | |
cp extra/linux/Alacritty.desktop $HOME/.local/share/applications/ | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment