Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4096 from stapelberg/meson-fixes
Browse files Browse the repository at this point in the history
meson fixes for unbreaking the Debian/Ubuntu package builds on Travis
  • Loading branch information
stapelberg committed May 19, 2020
2 parents aba6ec3 + 571eec8 commit 0c0aef8
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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
Expand Down
32 changes: 0 additions & 32 deletions debian/i3-wm.docs

This file was deleted.

13 changes: 0 additions & 13 deletions debian/i3-wm.manpages

This file was deleted.

11 changes: 8 additions & 3 deletions debian/rules
Expand Up @@ -13,13 +13,18 @@ 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:
# 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.
dh_builddeb -- -Zgzip

%:
dh $@ --buildsystem=meson+ninja
dh $@ --buildsystem=meson
78 changes: 74 additions & 4 deletions meson.build
Expand Up @@ -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 = [
Expand All @@ -96,7 +101,7 @@ if get_option('docs')
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
install_dir: docdir,
)
endforeach

Expand All @@ -115,11 +120,54 @@ if get_option('docs')
'@INPUT@',
],
install: true,
install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
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(
[
'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
Expand All @@ -128,6 +176,8 @@ endif
# manpages
################################################################################

man1 = join_paths(get_option('mandir'), 'man1')

if get_option('mans')
asciidoc = find_program('asciidoc')
asciidoc_cdata = configuration_data()
Expand Down Expand Up @@ -186,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

Expand All @@ -209,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')
Expand Down
3 changes: 3 additions & 0 deletions meson_options.txt
Expand Up @@ -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)')
6 changes: 1 addition & 5 deletions travis/debian-build.sh
Expand Up @@ -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}"
Expand Down

0 comments on commit 0c0aef8

Please sign in to comment.