77 lines
1.8 KiB
Bash
Executable file
77 lines
1.8 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# variables
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=$(basename "$CWD")
|
|
GITHUB_REPO=ghostty-org/ghostty
|
|
VERSION=${VERSION:-latest}
|
|
ARCH=${ARCH:-noarch}
|
|
BUILD=1
|
|
|
|
TAG=gwh
|
|
TMP=/tmp/$TAG
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
OUTPUT=/tmp
|
|
|
|
REPOSITORY=/var/cache/SlackBuilds.gwh/$PRGNAM
|
|
|
|
PREFIX=/usr
|
|
|
|
# nettoyage préalable
|
|
rm -fr "$PKG" "${TMP:?}/$PRGNAM"
|
|
|
|
mkdir -p "$PKG"
|
|
|
|
# mise en place
|
|
cd $TMP || exit 1
|
|
[ ! -e "$REPOSITORY" ] && git clone https://github.com/${GITHUB_REPO}.git "$REPOSITORY"
|
|
cd $REPOSITORY
|
|
git pull --all
|
|
|
|
cp -R "$REPOSITORY" "$TMP/$PRGNAM"
|
|
cd "$TMP/$PRGNAM" || exit 1
|
|
[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-version:refname | head -n1)
|
|
[ "$VERSION" == "" ] && VERSION=trunk
|
|
[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout "$VERSION"
|
|
|
|
DESTDIR=$PKG \
|
|
zig build \
|
|
--prefix /usr \
|
|
-Doptimize=ReleaseFast \
|
|
-Dcpu=baseline
|
|
|
|
# # installation
|
|
# mkdir -p "$PKG$PREFIX"/bin/
|
|
# cp duf "$PKG$PREFIX"/bin/
|
|
|
|
# mkdir -p "$PKG$PREFIX"/man/man1/
|
|
# cp duf.1 "$PKG$PREFIX"/man/man1/
|
|
# gzip -9 "$PKG$PREFIX"/man/man1/duf.1
|
|
|
|
# mkdir -p "$PKG$PREFIX/doc/$PRGNAM"
|
|
# cp -a LICENSE README.md duf.png "$PKG$PREFIX/doc/$PRGNAM"
|
|
|
|
# correction
|
|
cd "$PKG" || exit 1
|
|
chown -R root:root ./*
|
|
|
|
[ -d "$PKG"/usr/man ] && find "$PKG"/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
# embaumement
|
|
mkdir -p "$PKG/install"
|
|
cat <<EOF > "$PKG"/install/slack-desc
|
|
$PRGNAM: $PRGNAM ()
|
|
$PRGNAM:
|
|
$PRGNAM: 👻 Ghostty is a fast, feature-rich, and cross-platform
|
|
$PRGNAM: terminal emulator that uses platform-native UI and GPU
|
|
$PRGNAM: acceleration.
|
|
$PRGNAM: REQUIRES: libadwaita
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: https://ghostty.org
|
|
$PRGNAM: https://github.com/${GITHUB_REPO}
|
|
EOF
|
|
|
|
# empaquetage
|
|
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION//-/}-$ARCH-$BUILD$TAG.txz"
|