From 693eee0c0315c095c167602e1c68619d7a1a80fd Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:24:38 +0200 Subject: [PATCH] meson: make docdir configurable The debian package wants to install docs to $datadir/doc/i3-wm. related to #4086 --- debian/rules | 4 ++-- meson.build | 9 +++++++-- meson_options.txt | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/rules b/debian/rules index 6b342141c..1377494ec 100755 --- a/debian/rules +++ b/debian/rules @@ -14,8 +14,8 @@ override_dh_auto_test: # TODO: enable tests override_dh_auto_configure: - # The default is /usr/share/doc/i3 - dh_auto_configure -- --docdir=/usr/share/doc/i3-wm + # Set -Ddocdir; the default is /usr/share/doc/i3 + dh_auto_configure -- -Ddocdir=/usr/share/doc/i3-wm override_dh_builddeb: # bintray does not support xz currently. diff --git a/meson.build b/meson.build index 0a94ac05e..229ce7ebf 100644 --- a/meson.build +++ b/meson.build @@ -71,6 +71,11 @@ config_h = declare_dependency( # docs generation ################################################################################ +docdir = get_option('docdir') +if docdir == '' + docdir = join_paths(get_option('datadir'), 'doc', 'i3') +endif + if get_option('docs') asciidoc = find_program('asciidoc') doc_toc_inputs = [ @@ -96,7 +101,7 @@ if get_option('docs') '@INPUT@', ], install: true, - install_dir: join_paths(get_option('datadir'), 'doc', 'i3'), + install_dir: docdir, ) endforeach @@ -115,7 +120,7 @@ if get_option('docs') '@INPUT@', ], install: true, - install_dir: join_paths(get_option('datadir'), 'doc', 'i3'), + install_dir: docdir, ) endforeach endif diff --git a/meson_options.txt b/meson_options.txt index 482e1c2c8..0c4d4cfb1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,3 +5,6 @@ option('docs', type: 'boolean', value: false, option('mans', type: 'boolean', value: false, description: 'Build manpages from source (release tarballs contain a generated copy)') + +option('docdir', type: 'string', value: '', + description: 'documentation directory (default: $datadir/docs/i3)')