From eb47cc29d45c86e5b1c4235fca7498811203d1b0 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 19 Nov 2023 13:00:17 -0800 Subject: Add a meson build system Includes CI checks comparing installed files based on those from xorgproto Signed-off-by: Alan Coopersmith --- .gitlab-ci.yml | 64 +++++++++++++++++++++++-- Makefile.am | 2 +- masterdb/Makefile.am | 4 +- masterdb/masterdb.xml | 126 +++++++++++++++++++++++++------------------------- meson.build | 47 +++++++++++++++++++ 5 files changed, 174 insertions(+), 69 deletions(-) create mode 100644 meson.build diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e794fb2..55e25c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,8 +32,8 @@ variables: # The tag should be updated each time the list of packages is updated. # Changing a tag forces the associated image to be rebuilt. # Note: the tag has no meaning, we use a date format purely for readability - FDO_DISTRIBUTION_TAG: '2023-10-13.0' - FDO_DISTRIBUTION_PACKAGES: 'git pkgconf autoconf automake make xz-utils xutils-dev xmlto w3m xsltproc fop' + FDO_DISTRIBUTION_TAG: '2023-11-19.0' + FDO_DISTRIBUTION_PACKAGES: 'git pkgconf autoconf automake make xz-utils xutils-dev xmlto w3m xsltproc fop meson ninja-build jq' # @@ -108,7 +108,7 @@ install-macros: # The default build, runs on the image built above. # Sets ACLOCAL to use macros from "install macros" stage above. # -build: +autotools: stage: build extends: - .fdo.distribution-image@debian @@ -123,11 +123,13 @@ build: - make check - make install - make distcheck + - mv xorg-sgml-doctools-*.tar.xz .. - popd > /dev/null variables: artifacts: paths: - _inst + - xorg-sgml-doctools-*.tar.xz # # Make sure xorg-docs builds with the xorg-sgml-doctools package built above @@ -157,3 +159,59 @@ docs-build: artifacts: paths: - _inst + +meson: + extends: + - .fdo.distribution-image@debian + + stage: build + script: + - mkdir -p ../_inst + - meson setup builddir --prefix="$PWD/../_inst" + - meson install -C builddir + +meson from tarball: + extends: + - .fdo.distribution-image@debian + + stage: test + script: + - mkdir -p _tarball_build + - tar xf xorg-sgml-doctools-*.tar.xz -C _tarball_build + - pushd _tarball_build/xorg-sgml-doctools-* + - meson setup builddir + - meson install -C builddir + needs: + - autotools + variables: + GIT_STRATEGY: none + +compare meson and autotools: + extends: + - .fdo.distribution-image@debian + + stage: test + script: + - mkdir -p $PWD/_meson_inst + - mkdir -p $PWD/_autotools_inst + - meson setup builddir --prefix=/usr/X11 + - DESTDIR=$PWD/_meson_inst meson install -C builddir + - export INSTDIR="$PWD/_inst" + - export ACLOCAL="aclocal -I $INSTDIR/share/aclocal" + - autoreconf -ivf + - ./configure --prefix=/usr/X11 + - make && DESTDIR=$PWD/_autotools_inst make install + - diff --brief --recursive $PWD/_meson_inst $PWD/_autotools_inst + +check versions are in sync: + extends: + - .fdo.distribution-image@debian + + stage: test + script: + - export INSTDIR="$PWD/_inst" + - export ACLOCAL="aclocal -I $INSTDIR/share/aclocal" + - autoreconf -ivf + - ./configure --version | head -n 1 | sed -e 's/xorg-sgml-doctools 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) diff --git a/Makefile.am b/Makefile.am index b5d5ac4..63a9c60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,4 +43,4 @@ ChangeLog: dist-hook: ChangeLog INSTALL -EXTRA_DIST = README.md +EXTRA_DIST = README.md meson.build diff --git a/masterdb/Makefile.am b/masterdb/Makefile.am index fd571b0..2154845 100644 --- a/masterdb/Makefile.am +++ b/masterdb/Makefile.am @@ -9,10 +9,10 @@ CLEANFILES = $(sgmldbs_DATA) %.html.xml: %.xml $(AM_V_GEN)$(SED) \ - -e 's|__db__|html|g' \ + -e 's|@db@|html|g' \ -e 's|@datarootdir[@]|$(datarootdir)|g' < $< > $@ %.pdf.xml: %.xml $(AM_V_GEN)$(SED) \ - -e 's|__db__|pdf|g' \ + -e 's|@db@|pdf|g' \ -e 's|@datarootdir[@]|$(datarootdir)|g' < $< > $@ diff --git a/masterdb/masterdb.xml b/masterdb/masterdb.xml index c40f597..4628f64 100644 --- a/masterdb/masterdb.xml +++ b/masterdb/masterdb.xml @@ -38,24 +38,24 @@ listed here. This allows crosslinking between documents. - + - + - + - + @@ -63,7 +63,7 @@ listed here. This allows crosslinking between documents. - + @@ -71,28 +71,28 @@ listed here. This allows crosslinking between documents. - + - + - + - + @@ -100,14 +100,14 @@ listed here. This allows crosslinking between documents. - + - + @@ -115,81 +115,81 @@ listed here. This allows crosslinking between documents. - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -197,116 +197,116 @@ listed here. This allows crosslinking between documents. - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -314,109 +314,109 @@ listed here. This allows crosslinking between documents. - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -425,7 +425,7 @@ listed here. This allows crosslinking between documents. - + diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..5b38853 --- /dev/null +++ b/meson.build @@ -0,0 +1,47 @@ +project('xorg-sgml-doctools', + version: '1.12', + meson_version: '>= 0.49.0', + license: 'MIT' +) + +datarootdir = get_option('prefix') / get_option('datadir') +sgmlrootdir = datarootdir / 'sgml' +sgmlx11dir = sgmlrootdir / 'X11' +sgmldbsdir = sgmlx11dir / 'dbs' + +pc_conf = configuration_data({ + 'prefix': get_option('prefix'), + 'datarootdir': '${prefix}/share', + 'sgmlrootdir': '${datarootdir}/sgml', + 'PACKAGE_VERSION': meson.project_version() +}) +configure_file(input: 'xorg-sgml-doctools.pc.in', + output: 'xorg-sgml-doctools.pc', + install_dir: get_option('datadir') / 'pkgconfig', + configuration: pc_conf) + +sgmlx11_files = [ + 'defs.ent', + 'xorg.css', + 'xorg.xsl', + 'xorg-xhtml.xsl', + 'xorg-chunk.xsl', + 'xorg-fo.xsl' +] +install_data(sgmlx11_files, install_dir: sgmlx11dir) + +configure_file(output: 'masterdb.html.xml', + input: 'masterdb/masterdb.xml', + configuration: { + 'datarootdir': datarootdir, + 'db': 'html' + }, + install_dir: sgmldbsdir) + +configure_file(output: 'masterdb.pdf.xml', + input: 'masterdb/masterdb.xml', + configuration: { + 'datarootdir': datarootdir, + 'db': 'pdf' + }, + install_dir: sgmldbsdir) -- cgit v1.2.3