Skip to content

Meson: doc installation problems

Currently, the project unconditionally installs documentation to ${prefix}/${datadir}/doc/xfce4-panel-profiles. This violates two Gentoo policies:

  1. Documentation in Gentoo is installed into subdirectories matching exact package name and version (including Gentoo-specific revision).
  2. License files are not installed as part of the documentation, but they are maintained separately.

As for the first issue, meson is currently working on adding a docdir option that should facilitate overriding it. In the meantime, the usual solution is to add a local docdir option for this purpose. I think I've seen already another Xfce project doing it.

As for the second issue, meson provides a license_files argument to project() specifically to facilitate installing license files. Unfortunately, it is available since Meson 1.1.0. One possible solution (suggested by Eli Schwartz, thank him) is to use a conditional like:

if meson.version().version_compare('>=1.1.0')
  licensedir = get_option('licensedir')
  if licensedir != ''
    install_data(license_files, install_dir: licensedir)
  endif
else
  # install them as usual
endif

However, not installing that file at all would also work for us :-).