mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 16:44:52 +00:00
Several sites we need to clone our dependencies from (eg. freedesktop.org) have pretty unreliable servers, so our CI jobs often fail just because of temporary clone failure. Therefore adding a separate cloning script, which is more clever with automatic retries, but it also tries to keep the traffic low (eg. trying shallow clones if possible) and automatically detecting whether we're pulling a ref or a direct commit. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
92 lines
1.9 KiB
Bash
92 lines
1.9 KiB
Bash
|
|
. .github/scripts/conf.sh
|
|
|
|
SOURCE_DIR=`pwd`
|
|
|
|
clone_source() {
|
|
local pkgname="$1"
|
|
local url="$2"
|
|
local ref="$3"
|
|
|
|
$SOURCE_DIR/.github/scripts/git-smart-checkout.sh \
|
|
--name "$pkgname" \
|
|
--url "$url" \
|
|
--ref "$ref"
|
|
}
|
|
|
|
build_meson() {
|
|
local pkgname="$1"
|
|
local url="$2"
|
|
local ref="$3"
|
|
shift
|
|
shift
|
|
shift || true
|
|
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
|
|
echo "package $pkgname already built"
|
|
else
|
|
clone_source "$pkgname" "$url" "$ref"
|
|
(
|
|
cd $pkgname
|
|
meson "$@" build -Dprefix=$X11_PREFIX
|
|
ninja -j${FDO_CI_CONCURRENT:-4} -C build install
|
|
)
|
|
touch $X11_PREFIX/$pkgname.DONE
|
|
fi
|
|
}
|
|
|
|
build_ac() {
|
|
local pkgname="$1"
|
|
local url="$2"
|
|
local ref="$3"
|
|
shift
|
|
shift
|
|
shift || true
|
|
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
|
|
echo "package $pkgname already built"
|
|
else
|
|
clone_source "$pkgname" "$url" "$ref"
|
|
(
|
|
cd $pkgname
|
|
./autogen.sh --prefix=$X11_PREFIX
|
|
make -j${FDO_CI_CONCURRENT:-4} install
|
|
)
|
|
touch $X11_PREFIX/$pkgname.DONE
|
|
fi
|
|
}
|
|
|
|
build_drv_ac() {
|
|
local pkgname="$1"
|
|
local url="$2"
|
|
local ref="$3"
|
|
shift
|
|
shift
|
|
shift || true
|
|
clone_source "$pkgname" "$url" "$ref"
|
|
(
|
|
cd $pkgname
|
|
./autogen.sh # --prefix=$X11_PREFIX
|
|
make -j${FDO_CI_CONCURRENT:-4} # install
|
|
)
|
|
}
|
|
|
|
build_ac_xts() {
|
|
local pkgname="$1"
|
|
local url="$2"
|
|
local ref="$3"
|
|
shift
|
|
shift
|
|
shift || true
|
|
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
|
|
echo "package $pkgname already built"
|
|
else
|
|
clone_source "$pkgname" "$url" "$ref"
|
|
(
|
|
cd $pkgname
|
|
CFLAGS='-fcommon'
|
|
./autogen.sh --prefix=$X11_PREFIX CFLAGS="$CFLAGS"
|
|
make -j${FDO_CI_CONCURRENT:-4} install
|
|
)
|
|
touch $X11_PREFIX/$pkgname.DONE
|
|
fi
|
|
}
|