.github: util.sh: allow explicit commit on clone_source

Add 4th parameter to clone_source() helper for checking out specific commit.
It will clone the given branch (but with full depth) and then checkout
the given commit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-07-07 11:04:04 +02:00 committed by Enrico Weigelt
parent fc9bd6b175
commit 2aa982b9a8
2 changed files with 26 additions and 9 deletions

View File

@ -9,18 +9,18 @@ cd $X11_BUILD_DIR
build_meson rendercheck https://gitlab.freedesktop.org/xorg/test/rendercheck rendercheck-1.6
if [ "$X11_OS" = "Linux" ]; then
build_meson drm https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.121 \
build_meson drm https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.121 "" \
-Domap=enabled
fi
build_meson libxcvt https://gitlab.freedesktop.org/xorg/lib/libxcvt libxcvt-0.1.0
build_ac xorgproto https://gitlab.freedesktop.org/xorg/proto/xorgproto xorgproto-2024.1
if [ "$X11_OS" = "Linux" ]; then
build_meson wayland https://gitlab.freedesktop.org/wayland/wayland 1.21.0 \
build_meson wayland https://gitlab.freedesktop.org/wayland/wayland 1.21.0 "" \
-Dtests=false -Ddocumentation=false -Ddtd_validation=false
build_meson wayland-protocols https://gitlab.freedesktop.org/wayland/wayland-protocols 1.38
build_meson libdecor https://gitlab.freedesktop.org/libdecor/libdecor 0.1.1 \
build_meson libdecor https://gitlab.freedesktop.org/libdecor/libdecor 0.1.1 "" \
-D{demo,install_demo}=false
build_meson libei https://gitlab.freedesktop.org/libinput/libei 1.0.0 \
build_meson libei https://gitlab.freedesktop.org/libinput/libei 1.0.0 "" \
-Dtests=disabled -Ddocumentation=[] -Dliboeffis=enabled
fi
if [ "$X11_OS" = "Darwin" ]; then

View File

@ -5,26 +5,37 @@ clone_source() {
local pkgname="$1"
local url="$2"
local ref="$3"
local commit="$4"
if [ ! -f $pkgname/.git/config ]; then
echo "need to clone $pkgname"
git clone $url $pkgname --branch=$ref --depth 1
if [ "$commit" ]; then
git clone $url $pkgname --branch=$ref
else
git clone $url $pkgname --branch=$ref --depth 1
fi
else
echo "already cloned $pkgname"
fi
if [ "$commit" ]; then
( cd $pkgname && git checkout -f "$commit" )
fi
}
build_meson() {
local pkgname="$1"
local url="$2"
local ref="$3"
local commit="$4"
shift
shift
shift
shift || true
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
clone_source "$pkgname" "$url" "$ref" "$commit"
(
cd $pkgname
meson "$@" build -Dprefix=$X11_PREFIX
@ -38,13 +49,15 @@ build_ac() {
local pkgname="$1"
local url="$2"
local ref="$3"
local commit="$4"
shift
shift
shift
shift || true
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
clone_source "$pkgname" "$url" "$ref" "$commit"
(
cd $pkgname
./autogen.sh --prefix=$X11_PREFIX
@ -58,10 +71,12 @@ build_drv_ac() {
local pkgname="$1"
local url="$2"
local ref="$3"
local commit="$4"
shift
shift
shift
clone_source "$pkgname" "$url" "$ref"
shift || true
clone_source "$pkgname" "$url" "$ref" "$commit"
(
cd $pkgname
./autogen.sh # --prefix=$X11_PREFIX
@ -73,13 +88,15 @@ build_ac_xts() {
local pkgname="$1"
local url="$2"
local ref="$3"
local commit="$4"
shift
shift
shift
shift || true
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
clone_source "$pkgname" "$url" "$ref" "$commit"
(
cd $pkgname
CFLAGS='-fcommon'