From 693eee0c0315c095c167602e1c68619d7a1a80fd Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:24:38 +0200 Subject: [PATCH 1/7] 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)') From 97e477777e2d90ee7197770d789b13f632813226 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:33:47 +0200 Subject: [PATCH 2/7] meson: install static documentation files related to #4086 --- meson.build | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/meson.build b/meson.build index 229ce7ebf..be528bf97 100644 --- a/meson.build +++ b/meson.build @@ -125,6 +125,33 @@ if get_option('docs') endforeach endif +install_data( + [ + 'docs/bigpicture.png', + 'docs/single_terminal.png', + 'docs/snapping.png', + 'docs/two_columns.png', + 'docs/two_terminals.png', + 'docs/modes.png', + 'docs/wsbar.png', + 'docs/keyboard-layer1.png', + 'docs/keyboard-layer2.png', + 'docs/i3-sync-working.png', + 'docs/i3-sync.png', + 'docs/tree-layout1.png', + 'docs/tree-layout2.png', + 'docs/tree-shot1.png', + 'docs/tree-shot2.png', + 'docs/tree-shot3.png', + 'docs/tree-shot4.png', + 'docs/refcard.html', + 'docs/refcard_style.css', + 'docs/logo-30.png', + 'docs/layout-saving-1.png', + ], + install_dir: docdir, +) + if meson.version().version_compare('>=0.53') summary('build docs (-Ddocs)', get_option('docs')) endif From ff6c2d221448c1311970691d17e425e353b7f63e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:48:16 +0200 Subject: [PATCH 3/7] debian: set buildsystem to meson, not meson+ninja The latter fails on Ubuntu, presumably due to an older debhelper version. related to #4086 --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 1377494ec..2e139b1c9 100755 --- a/debian/rules +++ b/debian/rules @@ -22,4 +22,4 @@ override_dh_builddeb: dh_builddeb -- -Zgzip %: - dh $@ --buildsystem=meson+ninja + dh $@ --buildsystem=meson From 0bea175b51e8b14f88e57a7e186c93a052f9338a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:49:03 +0200 Subject: [PATCH 4/7] disable dh_autoreconf We still have autotools in the tree, so this is not a no-op yet. related to #4086 --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index 2e139b1c9..28436d292 100755 --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,11 @@ override_dh_strip: override_dh_auto_test: # TODO: enable tests +# TODO(autotools-removal): remove this override: +override_dh_autoreconf: + # Not needed with meson, but not a no-op either until we get rid of the + # autotools files. + override_dh_auto_configure: # Set -Ddocdir; the default is /usr/share/doc/i3 dh_auto_configure -- -Ddocdir=/usr/share/doc/i3-wm From 2e23412f5dbb09a5105f6fd1998ae6c0d6703a0a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:52:10 +0200 Subject: [PATCH 5/7] debian-build: use release tarball from build step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …instead of building a release tarball over and over again. This has become an issue as meson insists on running tests before creating a release tarball (which is a good policy). related to #4086 --- .travis.yml | 2 +- travis/debian-build.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e56db17f9..17bb6dd71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ script: # # TODO(autotools-removal): autoconf build has to keep working until i3 4.19 # is released, so we keep building it in travis. - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common"' - - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'rm -rf build; mkdir -p build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common" meson .. -Ddocs=true -Dmans=true -Db_sanitize=address && ninja -v' + - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'rm -rf build; mkdir -p build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common" meson .. -Ddocs=true -Dmans=true -Db_sanitize=address && ninja -v && mkdir ../distbuild && cd ../distbuild && meson .. -Ddocs=true -Dmans=true && ninja -v dist' - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST diff --git a/travis/debian-build.sh b/travis/debian-build.sh index 9ce5a5aff..1c34f46a7 100755 --- a/travis/debian-build.sh +++ b/travis/debian-build.sh @@ -5,14 +5,10 @@ set -x DEST=$1 -mkdir -p build cd build -../configure -make echo-version > ../I3_VERSION -make dist-bzip2 # unpack dist tarball mkdir -p "${DEST}" -tar xf *.tar.bz2 -C "${DEST}" --strip-components=1 +tar xf meson-dist/*.tar.xz -C "${DEST}" --strip-components=1 cp -r ../debian "${DEST}" sed -i '/^\s*libxcb-xrm-dev/d' deb/ubuntu-*/DIST/debian/control || true cd "${DEST}" From 315f64687642948a477923d266452ffd9e1d64b0 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 18:59:56 +0200 Subject: [PATCH 6/7] meson: install docs from release tarball related to #4086 --- meson.build | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index be528bf97..3f7592c39 100644 --- a/meson.build +++ b/meson.build @@ -123,6 +123,22 @@ if get_option('docs') install_dir: docdir, ) endforeach + +else + install_data( + [ + 'docs/hacking-howto.html', + 'docs/userguide.html', + 'docs/ipc.html', + 'docs/multi-monitor.html', + 'docs/wsbar.html', + 'docs/testsuite.html', + 'docs/i3bar-protocol.html', + 'docs/layout-saving.html', + 'docs/debugging.html', + ], + install_dir: docdir, + ) endif install_data( @@ -160,6 +176,8 @@ endif # manpages ################################################################################ +man1 = join_paths(get_option('mandir'), 'man1') + if get_option('mans') asciidoc = find_program('asciidoc') asciidoc_cdata = configuration_data() @@ -218,7 +236,7 @@ if get_option('mans') # https://github.com/mesonbuild/meson/issues/4981#issuecomment-467084867 # https://github.com/mesonbuild/meson/issues/1550#issuecomment-370164307 install: true, - install_dir: join_paths(get_option('mandir'), 'man1'), + install_dir: man1, ) endforeach @@ -241,9 +259,29 @@ if get_option('mans') # https://github.com/mesonbuild/meson/issues/4981#issuecomment-467084867 # https://github.com/mesonbuild/meson/issues/1550#issuecomment-370164307 install: true, - install_dir: join_paths(get_option('mandir'), 'man1'), + install_dir: man1, ) endforeach + +else + install_data( + [ + 'man/i3.1', + 'man/i3bar.1', + 'man/i3-msg.1', + 'man/i3-input.1', + 'man/i3-nagbar.1', + 'man/i3-config-wizard.1', + 'man/i3-migrate-config-to-v4.1', + 'man/i3-sensible-editor.1', + 'man/i3-sensible-pager.1', + 'man/i3-sensible-terminal.1', + 'man/i3-dump-log.1', + 'man/i3-dmenu-desktop.1', + 'man/i3-save-tree.1', + ], + install_dir: man1, + ) endif if meson.version().version_compare('>=0.53') From 571eec861ec37dc53308de8ed29c6d15f73a05b6 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 19 May 2020 19:07:21 +0200 Subject: [PATCH 7/7] debian: remove i3-wm.{docs,manpages}, meson installs them related to #4086 --- debian/i3-wm.docs | 32 -------------------------------- debian/i3-wm.manpages | 13 ------------- 2 files changed, 45 deletions(-) delete mode 100644 debian/i3-wm.docs delete mode 100644 debian/i3-wm.manpages diff --git a/debian/i3-wm.docs b/debian/i3-wm.docs deleted file mode 100644 index 437175b31..000000000 --- a/debian/i3-wm.docs +++ /dev/null @@ -1,32 +0,0 @@ -docs/debugging.html -docs/hacking-howto.html -docs/i3bar-protocol.html -docs/userguide.html -docs/bigpicture.png -docs/single_terminal.png -docs/snapping.png -docs/two_columns.png -docs/two_terminals.png -docs/modes.png -docs/ipc.html -docs/multi-monitor.html -docs/wsbar.html -docs/wsbar.png -docs/keyboard-layer1.png -docs/keyboard-layer2.png -docs/testsuite.html -docs/i3-sync-working.png -docs/i3-sync.png -docs/tree-layout1.png -docs/tree-layout2.png -docs/tree-shot1.png -docs/tree-shot2.png -docs/tree-shot3.png -docs/tree-shot4.png -docs/refcard.html -docs/refcard_style.css -docs/logo-30.png -docs/lib-i3test.html -docs/lib-i3test-test.html -docs/layout-saving.html -docs/layout-saving-1.png diff --git a/debian/i3-wm.manpages b/debian/i3-wm.manpages deleted file mode 100644 index 1953b6a85..000000000 --- a/debian/i3-wm.manpages +++ /dev/null @@ -1,13 +0,0 @@ -man/i3.1 -man/i3-msg.1 -man/i3-input.1 -man/i3-nagbar.1 -man/i3-config-wizard.1 -man/i3-dump-log.1 -man/i3-migrate-config-to-v4.1 -man/i3-sensible-pager.1 -man/i3-sensible-editor.1 -man/i3-sensible-terminal.1 -man/i3-dmenu-desktop.1 -man/i3-save-tree.1 -man/i3bar.1