.github: use new common driver build actions

Using the new driver build actions in X11Libre/actions-build-driver repo,
instead of having lots of duplicated pipeline and script in all the
individual driver repos.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-12-22 14:32:47 +01:00
committed by Enrico Weigelt
parent a3e6ef9f90
commit 7d7d039511
8 changed files with 13 additions and 406 deletions

View File

@@ -1,69 +0,0 @@
name: 'build driver'
description: 'build driver against specific Xserver'
inputs:
xserver-version:
required: true
runs:
using: "composite"
steps:
- name: check out driver repo
uses: actions/checkout@v4
- name: prepare build environment
shell: bash
run: |
MACHINE=`gcc -dumpmachine`
echo "MACHINE=$MACHINE" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
sudo chown root /bin/tar && sudo chmod u+s /bin/tar
- name: apt cache
uses: actions/cache@v4
with:
path: /var/cache/apt
key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }}
restore-keys: apt-cache-
- name: pkg install
shell: bash
run: sudo .github/scripts/ubuntu/install-pkg.sh
- name: X11 prereq cache
uses: actions/cache@v4
with:
path: |
${{ env.X11_PREFIX }}
key: ${{ runner.name }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }}
restore-keys: ${{ runner.name }}-x11-deps-
- name: generic prereq
shell: bash
run: .github/scripts/install-prereq.sh
- name: check out xserver repo
uses: actions/checkout@v4
with:
repository: X11Libre/xserver
path: xserver-sdk
ref: ${{ inputs.xserver-version }}
- name: build xserver sdk
shell: bash
env:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dnamespace=false -Dxselinux=false -Dxephyr=false -Dwerror=false -Dxcsecurity=false -Dxorg=true -Dxvfb=false -Dxnest=false -Ddocs=false
run: |
cd xserver-sdk
echo -n > .meson_environment
echo "export MESON_BUILDDIR=$MESON_BUILDDIR" >> .meson_environment
echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> .meson_environment
.gitlab-ci/meson-build.sh --skip-test
sudo meson install --no-rebuild -C "$MESON_BUILDDIR"
sudo mkdir -p /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules
sudo chown -R runner /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules
- name: compile driver
shell: bash
run: |
CFLAGS="-Wall" ./autogen.sh # --prefix=$X11_PREFIX
CFLAGS="-Wall" make -j # install

View File

@@ -1,13 +0,0 @@
export X11_OS=`uname -s`
export X11_PREFIX="${X11_PREFIX:-$HOME/x11}"
export X11_BUILD_DIR="${X11_BUILD_DIR:-$HOME/build-deps}"
export DRV_BUILD_DIR="${DRV_BUILD_DIR:-$HOME/build-drivers}"
case "$X11_OS" in
Darwin) export FDO_CI_CONCURRENT=`sysctl -n hw.logicalcpu` ;;
Linux) export FDO_CI_CONCURRENT=`nproc` ;;
esac
export PATH="$X11_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="$X11_PREFIX/lib/x86_64-linux-gnu/pkgconfig:$X11_PREFIX/lib/pkgconfig:$X11_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"

View File

@@ -1,17 +0,0 @@
#!/bin/bash
err() {
echo "$0: $*"
}
[ "$GITHUB_REPOSITORY" ] || err "missing variable GITHUB_REPOSITORY"
TITLE=$(git tag -l --format='%(contents)' $tag)
echo "tag=$tag"
echo "title=$TITLE"
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--generate-notes

View File

@@ -1,15 +0,0 @@
#!/bin/bash
set -e
. .github/scripts/util.sh
mkdir -p $X11_BUILD_DIR
cd $X11_BUILD_DIR
if [ "$X11_OS" = "Linux" ]; then
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

View File

@@ -1,94 +0,0 @@
#!/bin/bash
set -e
# Packages which are needed by this script, but not for the xserver build
EPHEMERAL="
libexpat-dev
libgles2-mesa-dev
libxkbcommon-dev
x11-utils
x11-xserver-utils
xauth
xvfb
"
apt-get update
apt-get install -y \
$EPHEMERAL \
autoconf \
automake \
build-essential \
ca-certificates \
libaudit-dev \
libbsd-dev \
libcairo2-dev \
libdbus-1-dev \
libdrm-dev \
libegl1-mesa-dev \
libepoxy-dev \
libevdev2 \
libexpat1 \
libffi-dev \
libgbm-dev \
libgcrypt-dev \
libgl1-mesa-dev \
libgles2 \
libglx-mesa0 \
libinput10 \
libinput-dev \
libnvidia-egl-wayland-dev \
libpciaccess-dev \
libpixman-1-dev \
libspice-protocol-dev \
libsystemd-dev \
libudev-dev \
libunwind-dev \
libx11-dev \
libx11-xcb-dev \
libxau-dev \
libxaw7-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-util0-dev \
libxcb-xf86dri0-dev \
libxcb-xkb-dev \
libxcb-xv0-dev \
libxcb1-dev \
libxdmcp-dev \
libxext-dev \
libxfixes-dev \
libxfont-dev \
libxi-dev \
libxinerama-dev \
libxkbcommon0 \
libxkbfile-dev \
libxmu-dev \
libxmuu-dev \
libxpm-dev \
libxrender-dev \
libxres-dev \
libxshmfence-dev \
libxt-dev \
libxtst-dev \
libxv-dev \
mesa-common-dev \
meson \
nettle-dev \
libpango1.0-dev \
pkg-config \
x11-xkb-utils \
xfonts-utils \
xkb-data \
xtrans-dev \
xutils-dev \
libxaw7-dev \
python3-mako

View File

@@ -1,85 +0,0 @@
. .github/scripts/conf.sh
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"
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" "$commit"
(
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"
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" "$commit"
(
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"
local commit="$4"
shift
shift
shift
shift || true
clone_source "$pkgname" "$url" "$ref" "$commit"
(
cd $pkgname
./autogen.sh # --prefix=$X11_PREFIX
make -j${FDO_CI_CONCURRENT:-4} # install
)
}

View File

@@ -1,43 +1,27 @@
name: Build driver
permissions:
contents: write
env:
MESON_BUILDDIR: "build"
X11_PREFIX: /home/runner/x11
X11_BUILD_DIR: /home/runner/build-deps
on:
push:
pull_request:
jobs:
for-xserver-stable-25_0:
target-ubuntu:
strategy:
matrix:
xserver-version: [ master, xlibre-xserver-25.1.0, xlibre-xserver-25.0.0.18 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-driver
- uses: X11Libre/action-build-driver/target/ubuntu@v0.0.1
with:
xserver-version: xlibre-xserver-25.0.0.5
xserver-version: ${{ matrix.xserver-version }}
for-xserver-master:
release-notes:
name: Release pushed tag
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/xlibre-') }}
needs: target-ubuntu
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-driver
with:
xserver-version: master
release:
name: Release pushed tag
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/xlibre-') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: .github/scripts/github/make-release
- uses: X11Libre/action-build-driver/release@v0.0.1

View File

@@ -1,84 +0,0 @@
#!/bin/bash
set -e
set -o xtrace
echo 'deb-src https://deb.debian.org/debian bookworm main' >/etc/apt/sources.list.d/deb-src.list
apt-get update
# Ephemeral packages (installed for this script and removed again at the end)
EPHEMERAL="
ca-certificates
git
"
# libXfont/xserver build dependencies
apt-get install -y --no-remove \
autoconf \
automake \
build-essential \
libtool \
pkg-config \
$EPHEMERAL
echo 'APT::Get::Build-Dep-Automatic "true";' >>/etc/apt/apt.conf
apt-get build-dep -y xorg-server
# xserver 1.18 and older branches require libXfont 1.5 instead of 2.0
git clone https://gitlab.freedesktop.org/xorg/lib/libXfont.git
cd libXfont
git checkout libXfont-1.5-branch
./autogen.sh
make install-pkgconfigDATA
cd ..
rm -rf libXfont
git clone https://gitlab.freedesktop.org/xorg/xserver.git
cd xserver
for VERSION in 1.13 1.14 1.15; do
git checkout server-${VERSION}-branch
# Workaround glvnd having reset the version in gl.pc from what Mesa used
# similar to xserver commit e6ef2b12404dfec7f23592a3524d2a63d9d25802
sed -i -e 's/gl >= [79].[12].0/gl >= 1.2/' configure.ac
./autogen.sh --prefix=/usr/local/xserver-$VERSION --enable-dri2 --disable-dmx
make -C include install-nodist_sdkHEADERS
make install-headers install-aclocalDATA install-pkgconfigDATA clean
git restore configure.ac
done
for VERSION in 1.16 1.17 1.18 1.19 1.20 21.1; do
git checkout server-${VERSION}-branch
# Workaround glvnd having reset the version in gl.pc from what Mesa used
# similar to xserver commit e6ef2b12404dfec7f23592a3524d2a63d9d25802
sed -i -e 's/gl >= [79].[12].0/gl >= 1.2/' configure.ac
./autogen.sh --prefix=/usr/local/xserver-$VERSION --enable-dri2 --enable-dri3 --enable-glamor --disable-dmx
make -C include install-nodist_sdkHEADERS
make install-headers install-aclocalDATA install-pkgconfigDATA clean
git restore configure.ac
done
cd ..
rm -rf xserver
# xf86-video-ati build dependencies
apt-get install -y --no-remove \
clang \
libdrm-dev \
libgbm-dev \
libgl1-mesa-dev \
libpciaccess-dev \
libpixman-1-dev \
libudev-dev \
libxcvt-dev \
mesa-common-dev \
xutils-dev \
x11proto-dev
# Remove unneeded packages
apt-get purge -y $EPHEMERAL
apt-get autoremove -y --purge