From e816d5a105c60ee3266d73d2ded8fbfde175977c Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 23 Dec 2025 10:12:57 +0100 Subject: [PATCH] .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 --- .github/actions/build-driver/action.yaml | 69 ----------------- .github/scripts/conf.sh | 13 ---- .github/scripts/github/make-release | 17 ----- .github/scripts/install-prereq.sh | 15 ---- .github/scripts/ubuntu/install-pkg.sh | 94 ------------------------ .github/scripts/util.sh | 85 --------------------- .github/workflows/build.yml | 42 ++++------- 7 files changed, 13 insertions(+), 322 deletions(-) delete mode 100644 .github/actions/build-driver/action.yaml delete mode 100644 .github/scripts/conf.sh delete mode 100755 .github/scripts/github/make-release delete mode 100755 .github/scripts/install-prereq.sh delete mode 100755 .github/scripts/ubuntu/install-pkg.sh delete mode 100644 .github/scripts/util.sh diff --git a/.github/actions/build-driver/action.yaml b/.github/actions/build-driver/action.yaml deleted file mode 100644 index 3032abd..0000000 --- a/.github/actions/build-driver/action.yaml +++ /dev/null @@ -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 diff --git a/.github/scripts/conf.sh b/.github/scripts/conf.sh deleted file mode 100644 index 7cdab25..0000000 --- a/.github/scripts/conf.sh +++ /dev/null @@ -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" diff --git a/.github/scripts/github/make-release b/.github/scripts/github/make-release deleted file mode 100755 index 89152ba..0000000 --- a/.github/scripts/github/make-release +++ /dev/null @@ -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 diff --git a/.github/scripts/install-prereq.sh b/.github/scripts/install-prereq.sh deleted file mode 100755 index e2bd846..0000000 --- a/.github/scripts/install-prereq.sh +++ /dev/null @@ -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 diff --git a/.github/scripts/ubuntu/install-pkg.sh b/.github/scripts/ubuntu/install-pkg.sh deleted file mode 100755 index 0cdaf88..0000000 --- a/.github/scripts/ubuntu/install-pkg.sh +++ /dev/null @@ -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 diff --git a/.github/scripts/util.sh b/.github/scripts/util.sh deleted file mode 100644 index dea16ae..0000000 --- a/.github/scripts/util.sh +++ /dev/null @@ -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 - ) -} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23644b0..ed3fdd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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