diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-02-15 12:38:55 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-02-15 15:22:42 +1000 |
commit | 03280de5e94c215891d78565ddb953ec4f844478 (patch) | |
tree | 2047a7326bfe577f7677a3a3ef5859d54366c4ac /doc/user | |
parent | d0d2994254069bae1c5d3f99689530b2a760b872 (diff) |
doc/user: generate the required package list for the CI distributions
Use yq to extract the package list from the CI configuration, then dump that
into the user docs. This provides the long-requested commands to install all
dependencies without the maintenance effort or risk of going stale.
Note that we are *not* building this in the CI, it's just not needed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'doc/user')
-rw-r--r-- | doc/user/building.rst | 8 | ||||
-rw-r--r-- | doc/user/dependencies.rst | 21 | ||||
-rw-r--r-- | doc/user/meson.build | 18 |
3 files changed, 47 insertions, 0 deletions
diff --git a/doc/user/building.rst b/doc/user/building.rst index c30003bc..c5cca454 100644 --- a/doc/user/building.rst +++ b/doc/user/building.rst @@ -224,6 +224,14 @@ found``. See `this blog post here <https://who-t.blogspot.com/2018/07/meson-fails-with-native-dependency-not-found.html>`_ for instructions on how to fix it. +.............................................................................. +Build dependencies per distribution +.............................................................................. + + +.. include:: dependencies.rst + + .. _building_conditional: ------------------------------------------------------------------------------ diff --git a/doc/user/dependencies.rst b/doc/user/dependencies.rst new file mode 100644 index 00000000..4abec401 --- /dev/null +++ b/doc/user/dependencies.rst @@ -0,0 +1,21 @@ +.. warning:: The package lists are autogenerated from the `CI <https://gitlab.freedesktop.org/libinput/libinput/-/tree/master/.gitlab-ci.yml>`_. + +- Fedora: :: + + dnf install @FEDORA_PACKAGES@ + +- Ubuntu: :: + + apt install @UBUNTU_PACKAGES@ + +- Debian: :: + + apt install @DEBIAN_PACKAGES@ + +- Arch: :: + + pacman -S @ARCH_PACKAGES@ + +- Alpine: :: + + apk add @ALPINE_PACKAGES@ diff --git a/doc/user/meson.build b/doc/user/meson.build index d2c0eb00..ed4c7da8 100644 --- a/doc/user/meson.build +++ b/doc/user/meson.build @@ -4,6 +4,11 @@ if not sphinx.found() error('Program "sphinx-build" not found or not executable. Try building with -Ddocumentation=false') endif +yq = find_program('yq', required : false) +if not yq.found() + warning('Program "yq" not found or not executable. Dependency list will not be built.') +endif + sphinx_config = configuration_data() sphinx_config.set('PROJECT_NAME', meson.project_name()) sphinx_config.set('PROJECT_VERSION', meson.project_version()) @@ -180,6 +185,19 @@ configure_file(input: 'index.rst', output: 'index.rst', configuration: sphinx_config) +dependencies_config = configuration_data() +if yq.found() + distributions = ['fedora', 'ubuntu', 'debian', 'arch', 'alpine'] + foreach distro : distributions + yq_filter = '.distributions[] | select(.name == "@0@") | .packages | join(" ")'.format(distro) + deps = run_command(yq, '-r', yq_filter, + join_paths(meson.source_root(), '.gitlab-ci', 'config.yml')).stdout() + dependencies_config.set('@0@_PACKAGES'.format(distro.to_upper()), deps) +endforeach +endif +configure_file(input: 'dependencies.rst', + output: 'dependencies.rst', + configuration: dependencies_config) # do not use -j, it breaks on Ubuntu sphinx_output_dir = 'Documentation' |