[sway] embed more libs + refactoring

This commit is contained in:
Gwenhael Le Moine 2023-03-07 11:20:13 +01:00
parent 967d334833
commit e81e7302eb
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -3,9 +3,7 @@
# variables # variables
GITHUB_REPO=swaywm/sway GITHUB_REPO=swaywm/sway
VERSION=${VERSION:-"latest"} VERSION=${VERSION:-"latest"}
WLROOTS_VERSION=${WLROOTS_VERSION:-$VERSION} BUILD=11
LIBLIFTOFF_VERSION=${LIBLIFTOFF_VERSION:-$VERSION}
BUILD=10
TAG=gwh TAG=gwh
OUTPUT=/tmp OUTPUT=/tmp
@ -18,8 +16,6 @@ PKG=$TMP/pkg-$PRGNAM
ARCH=$(uname -m) ARCH=$(uname -m)
REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM
WLROOTS_REPOSITORY=/home/installs/SlackBuilds/_repositories/wlroots
LIBLIFTOFF_REPOSITORY=/home/installs/SlackBuilds/_repositories/libliftoff
PREFIX=/usr PREFIX=/usr
@ -54,20 +50,23 @@ esac
wget -c https://patch-diff.githubusercontent.com/raw/swaywm/sway/pull/6249.patch -O "$CWD"/patches/6249-tray-menu.patch wget -c https://patch-diff.githubusercontent.com/raw/swaywm/sway/pull/6249.patch -O "$CWD"/patches/6249-tray-menu.patch
patch -p1 < "$CWD"/patches/6249-tray-menu.patch patch -p1 < "$CWD"/patches/6249-tray-menu.patch
# for p in "$CWD"/patches/*.patch; do PKGNAM=${PRGNAM}
# git am --show-current-patch=diff "$p" PKGVERSION=$(echo "${VERSION}" | tr - _)
# done
# Embed wlroots # Embed wlroots
[ ! -e "$WLROOTS_REPOSITORY" ] && git clone https://gitlab.freedesktop.org/wlroots/wlroots.git "$WLROOTS_REPOSITORY" EMBED_WLROOTS=${EMBED_WLROOTS:-"yes"}
cd "$WLROOTS_REPOSITORY" || exit 1 if [ "$EMBED_WLROOTS" = "yes" ]; then
git reset --hard HEAD WLROOTS_VERSION=${WLROOTS_VERSION:-$VERSION}
git pull --all WLROOTS_REPOSITORY=/home/installs/SlackBuilds/_repositories/wlroots
[ ! -e "$WLROOTS_REPOSITORY" ] && git clone https://gitlab.freedesktop.org/wlroots/wlroots.git "$WLROOTS_REPOSITORY"
cd "$WLROOTS_REPOSITORY" || exit 1
git reset --hard HEAD
git pull --all
mkdir -p "$TMP/$PRGNAM"/subprojects/ mkdir -p "$TMP/$PRGNAM"/subprojects/
cp -a "$WLROOTS_REPOSITORY" "$TMP/$PRGNAM"/subprojects/wlroots cp -a "$WLROOTS_REPOSITORY" "$TMP/$PRGNAM"/subprojects/wlroots
cd "$TMP/$PRGNAM"/subprojects/wlroots || exit 1 cd "$TMP/$PRGNAM"/subprojects/wlroots || exit 1
case $WLROOTS_VERSION in case $WLROOTS_VERSION in
trunk) trunk)
WLROOTS_VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)" WLROOTS_VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)"
;; ;;
@ -78,18 +77,25 @@ case $WLROOTS_VERSION in
*) *)
git checkout "$WLROOTS_VERSION" git checkout "$WLROOTS_VERSION"
;; ;;
esac esac
PKGNAM="${PKGNAM}+wlroots"
PKGVERSION="${PKGVERSION}+${WLROOTS_VERSION}"
fi
# Embed libliftoff # Embed libliftoff
[ ! -e "$LIBLIFTOFF_REPOSITORY" ] && git clone https://gitlab.freedesktop.org/emersion/libliftoff.git "$LIBLIFTOFF_REPOSITORY" EMBED_LIBLIFTOFF=${EMBED_LIBLIFTOFF:-"yes"}
cd "$LIBLIFTOFF_REPOSITORY" || exit 1 if [ "$EMBED_LIBLIFTOFF" = "yes" ]; then
git reset --hard HEAD LIBLIFTOFF_VERSION=${LIBLIFTOFF_VERSION:-$VERSION}
git pull --all LIBLIFTOFF_REPOSITORY=/home/installs/SlackBuilds/_repositories/libliftoff
[ ! -e "$LIBLIFTOFF_REPOSITORY" ] && git clone https://gitlab.freedesktop.org/emersion/libliftoff.git "$LIBLIFTOFF_REPOSITORY"
cd "$LIBLIFTOFF_REPOSITORY" || exit 1
git reset --hard HEAD
git pull --all
mkdir -p "$TMP/$PRGNAM"/subprojects/ mkdir -p "$TMP/$PRGNAM"/subprojects/
cp -a "$LIBLIFTOFF_REPOSITORY" "$TMP/$PRGNAM"/subprojects/libliftoff cp -a "$LIBLIFTOFF_REPOSITORY" "$TMP/$PRGNAM"/subprojects/libliftoff
cd "$TMP/$PRGNAM"/subprojects/libliftoff || exit 1 cd "$TMP/$PRGNAM"/subprojects/libliftoff || exit 1
case $LIBLIFTOFF_VERSION in case $LIBLIFTOFF_VERSION in
trunk) trunk)
LIBLIFTOFF_VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)" LIBLIFTOFF_VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)"
;; ;;
@ -100,7 +106,39 @@ case $LIBLIFTOFF_VERSION in
*) *)
git checkout "$LIBLIFTOFF_VERSION" git checkout "$LIBLIFTOFF_VERSION"
;; ;;
esac esac
PKGNAM="${PKGNAM}+libliftoff"
PKGVERSION="${PKGVERSION}+${LIBLIFTOFF_VERSION}"
fi
# Embed libdisplay-info
EMBED_LIBDISPLAYINFO=${EMBED_LIBDISPLAYINFO:-"yes"}
if [ "$EMBED_LIBDISPLAYINFO" = "yes" ]; then
LIBDISPLAYINFO_VERSION=${LIBDISPLAYINFO_VERSION:-$VERSION}
LIBDISPLAYINFO_REPOSITORY=/home/installs/SlackBuilds/_repositories/libdisplay-info
[ ! -e "$LIBDISPLAYINFO_REPOSITORY" ] && git clone https://gitlab.freedesktop.org/emersion/libdisplay-info.git "$LIBDISPLAYINFO_REPOSITORY"
cd "$LIBDISPLAYINFO_REPOSITORY" || exit 1
git reset --hard HEAD
git pull --all
mkdir -p "$TMP/$PRGNAM"/subprojects/
cp -a "$LIBDISPLAYINFO_REPOSITORY" "$TMP/$PRGNAM"/subprojects/libdisplay-info
cd "$TMP/$PRGNAM"/subprojects/libdisplay-info || exit 1
case $LIBDISPLAYINFO_VERSION in
trunk)
LIBDISPLAYINFO_VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)"
;;
latest)
LIBDISPLAYINFO_VERSION=$(git describe --tags --abbrev=0)
git checkout "$LIBDISPLAYINFO_VERSION"
;;
*)
git checkout "$LIBDISPLAYINFO_VERSION"
;;
esac
PKGNAM="${PKGNAM}+libdisplay_info"
PKGVERSION="${PKGVERSION}+${LIBDISPLAYINFO_VERSION}"
fi
# Back to compiling sway… # Back to compiling sway…
cd "$TMP/$PRGNAM/" || exit 1 cd "$TMP/$PRGNAM/" || exit 1
@ -213,4 +251,4 @@ EOF
# empaquetage # empaquetage
rm -f "$PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la" rm -f "$PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la"
/sbin/makepkg -l y -c n "$OUTPUT/${PRGNAM}+wlroots+libliftoff-$(echo "${VERSION}+${WLROOTS_VERSION}+${LIBLIFTOFF_VERSION}" | tr - _)-$ARCH-$BUILD$TAG.txz" /sbin/makepkg -l y -c n "$OUTPUT/${PKGNAM}-$(echo "$PKGVERSION" | tr - _)-$ARCH-$BUILD$TAG.txz"