diff options
author | Pierre Le Marre <dev@wismill.eu> | 2025-02-10 12:19:09 +0100 |
---|---|---|
committer | Pierre Le Marre <dev@wismill.eu> | 2025-09-30 09:19:00 +0200 |
commit | d03a4ab1c0b24f6581411622ccf729ceb329aeb8 (patch) | |
tree | 97b46782b54bd24c418dc2c68a2c0a59257066f7 | |
parent | b3ba248d8511b4b259ecb83358a4e9f76c1c6799 (diff) |
Part-of: <https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/merge_requests/28>
-rw-r--r-- | .gitlab-ci.yml | 108 |
1 files changed, 100 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69825e7..f98d619 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,12 +23,15 @@ variables: FDO_UPSTREAM_REPO: 'xorg/app/xkbcomp' # Changing the tag will rebuild the container images. The value is just a # string, but we use the date for human benefits. - FDO_DISTRIBUTION_TAG: '2021-01-20.0' + FDO_DISTRIBUTION_TAG: '2025-03-09.1' # minimal set of packages required to build and install - BASE_PACKAGES: 'pkgconf autoconf automake make gcc bison libxkbfile libx11 xorg-util-macros' + BASE_PACKAGES: 'bison clang gcc libxkbfile libx11 pkgconf' + AUTOTOOLS_PACKAGES: 'autoconf automake libtool make xorg-util-macros' + MESON_PACKAGES: 'meson ninja' # extra packages we need for various tests - EXTRA_PACKAGES: '' - FDO_DISTRIBUTION_PACKAGES: $BASE_PACKAGES $EXTRA_PACKAGES + EXTRA_PACKAGES: 'diffoscope diffutils findutils jq' + FDO_DISTRIBUTION_PACKAGES: $BASE_PACKAGES $AUTOTOOLS_PACKAGES $MESON_PACKAGES $EXTRA_PACKAGES + CONFIGURE_OPTIONS: '--disable-silent-rules' stages: @@ -85,17 +88,106 @@ container-prep: # -# The default build, runs on the image built above. +# The autotools build, runs on the image built above. # autotools: extends: - .fdo.distribution-image@arch stage: build script: - - mkdir -p ../_inst - autoreconf -vif - - ./configure --prefix="$PWD/../_inst" $CONFIGURE_OPTIONS + - mkdir _builddir + - pushd _builddir > /dev/null + - ../configure $CONFIGURE_OPTIONS - make - make check - - make install - make distcheck + - mv xkbcomp-*.tar.gz .. + - popd > /dev/null + artifacts: + paths: + - xkbcomp-*.tar.gz + + +# +# The meson build, runs on the image built above. +# +.meson_build: + extends: + - .fdo.distribution-image@arch + stage: build + script: + - CC="${CC}" meson setup _builddir --prefix="$PWD/_install" -Dwarning_level=3 + - meson compile -C _builddir + - meson test -C _builddir + - meson install -C _builddir + +# Run meson build with different compilers +meson: + extends: + - .meson_build + parallel: + matrix: + - CC: ["gcc", "clang"] + +meson from tarball: + extends: + - .fdo.distribution-image@arch + stage: test + script: + - mkdir -p _tarball_build + - tar xf xkbcomp-*.tar.gz -C _tarball_build + - cd _tarball_build/xkbcomp-* + - meson setup _builddir + - meson compile -C _builddir + - meson test -C _builddir + needs: + - autotools + +compare meson and autotools: + extends: + - .fdo.distribution-image@arch + stage: test + script: + - mkdir -p $PWD/_meson_inst $PWD/_autotools_inst + # Meson build + # the prefix ends up in the pkgconfig files, so we use a symlink + # to use the same --prefix for meson and autotools + - ln -sf $PWD/_meson_inst $PWD/_inst + - export XKB_CONFIG_ROOT=$PWD/_inst/share/X11/xkb + - CFLAGS="-O2 -fno-strict-aliasing" + meson setup builddir --prefix=$PWD/_inst --buildtype=plain + -Dxkb-config-root=$XKB_CONFIG_ROOT + - meson compile -C builddir -v + - meson install -C builddir + + # Autotools build + - rm $PWD/_inst + - ln -sf $PWD/_autotools_inst $PWD/_inst + - ./autogen.sh --prefix=$PWD/_inst CFLAGS="-O2 -D_FILE_OFFSET_BITS=64" + - make V=1 && make install + + # Get rid of expected differences between the two + - sed -i -e "s:\${datadir}/X11/xkb:$XKB_CONFIG_ROOT:" + _autotools_inst/lib/pkgconfig/xkbcomp.pc + + # Compare both + - find $PWD/_meson_inst $PWD/_autotools_inst + -exec touch -h -r $PWD/_meson_inst/ {} \+ + - diffoscope --text-color=always _autotools_inst _meson_inst + +check versions are in sync: + extends: + - .fdo.distribution-image@arch + stage: test + script: + - autoreconf -ivf + - ./configure $CONFIGURE_OPTIONS --version + | head -n 1 + | sed -e 's/xkbcomp configure //' + > autotools.version + - meson introspect meson.build --projectinfo + | jq -r '.version' + > meson.version + - diff -u autotools.version meson.version || + (echo "ERROR - autotools and meson versions not in sync" && false) |