Codebase list i3-gaps / 4d3b269
Merge remote-tracking branch 'vanilla/next' into gaps-next Ingo Bürk 3 years ago
44 changed file(s) with 975 addition(s) and 228 deletion(s). Raw diff Collapse all Expand all
3939 i3-command-parser.stamp
4040 i3-config-parser.stamp
4141 .clang_complete
42 compile_commands.json
43 /.ccls-cache
44 /.clangd
4245 LAST_VERSION
4346 build
47
48 # We recommend building in a subdirectory called build.
49 # If you chose a different directory name,
50 # it is up to you to arrange for it to be ignored by git,
51 # e.g. by listing your directory in .git/info/exclude.
52 /build
53
54 # TODO(autotools-removal): remove autotools from .gitignore:
4455
4556 ################################################################################
4657 # https://raw.githubusercontent.com/github/gitignore/master/Autotools.gitignore
3030 script:
3131 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-safe-wrappers.sh
3232 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-formatting.sh
33 # # TODO(autotools-removal): autoconf build has to keep working until i3 4.19
34 # is released, so we keep building it in travis.
3335 - 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"'
36 - 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'
3437 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl
3538 - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh
3639 - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST
44
55 bin_PROGRAMS = \
66 i3 \
7 i3bar/i3bar \
8 i3-config-wizard/i3-config-wizard \
9 i3-dump-log/i3-dump-log \
10 i3-input/i3-input \
11 i3-msg/i3-msg \
12 i3-nagbar/i3-nagbar
7 i3bar \
8 i3-config-wizard \
9 i3-dump-log \
10 i3-input \
11 i3-msg \
12 i3-nagbar
1313
1414 install-exec-hook:
1515 $(LN_S) -f i3 $(DESTDIR)$(bindir)/i3-with-shmlog
330330 libi3/strndup.c \
331331 libi3/ucs2_conversion.c
332332
333 i3_dump_log_i3_dump_log_CFLAGS = \
333 i3_dump_log_CFLAGS = \
334334 $(AM_CFLAGS) \
335335 $(PTHREAD_CFLAGS) \
336336 $(libi3_CFLAGS)
337337
338 i3_dump_log_i3_dump_log_LDADD = \
338 i3_dump_log_LDADD = \
339339 $(PTHREAD_LIBS) \
340340 $(libi3_LIBS)
341341
342 i3_dump_log_i3_dump_log_SOURCES = \
342 i3_dump_log_SOURCES = \
343343 i3-dump-log/main.c
344344
345 i3_input_i3_input_CFLAGS = \
345 i3_input_CFLAGS = \
346346 $(AM_CFLAGS) \
347347 $(libi3_CFLAGS)
348348
349 i3_input_i3_input_LDADD = \
349 i3_input_LDADD = \
350350 $(libi3_LIBS) \
351351 $(XCB_UTIL_KEYSYMS_LIBS)
352352
353 i3_input_i3_input_SOURCES = \
353 i3_input_SOURCES = \
354354 i3-input/i3-input.h \
355355 i3-input/keysym2ucs.c \
356356 i3-input/keysym2ucs.h \
357357 i3-input/main.c
358358
359 i3_msg_i3_msg_CFLAGS = \
359 i3_msg_CFLAGS = \
360360 $(AM_CFLAGS) \
361361 $(libi3_CFLAGS)
362362
363 i3_msg_i3_msg_LDADD = \
363 i3_msg_LDADD = \
364364 $(libi3_LIBS)
365365
366 i3_msg_i3_msg_SOURCES = \
366 i3_msg_SOURCES = \
367367 i3-msg/main.c
368368
369 i3_nagbar_i3_nagbar_CFLAGS = \
369 i3_nagbar_CFLAGS = \
370370 $(AM_CFLAGS) \
371371 $(LIBSN_CFLAGS) \
372372 $(libi3_CFLAGS)
373373
374 i3_nagbar_i3_nagbar_LDADD = \
374 i3_nagbar_LDADD = \
375375 $(libi3_LIBS) \
376376 $(LIBSN_LIBS) \
377377 $(XCB_UTIL_CURSOR_LIBS)
378378
379 i3_nagbar_i3_nagbar_SOURCES = \
380 i3-nagbar/atoms.xmacro \
379 i3_nagbar_SOURCES = \
380 i3-nagbar/i3-nagbar-atoms.xmacro.h \
381381 i3-nagbar/main.c
382382
383 i3bar_i3bar_CPPFLAGS = \
383 i3bar_CPPFLAGS = \
384384 $(AM_CPPFLAGS) \
385385 -I$(top_srcdir)/i3bar/include
386386
387 i3bar_i3bar_CFLAGS = \
387 i3bar_CFLAGS = \
388388 $(AM_CFLAGS) \
389389 $(libi3_CFLAGS) \
390390 $(XCB_CFLAGS) \
392392 $(PANGOCAIRO_CFLAGS) \
393393 $(YAJL_CFLAGS)
394394
395 i3bar_i3bar_LDADD = \
395 i3bar_LDADD = \
396396 $(libi3_LIBS) \
397397 $(XCB_LIBS) \
398398 $(XCB_UTIL_CURSOR_LIBS) \
400400 $(PANGOCAIRO_LIBS) \
401401 $(YAJL_LIBS)
402402
403 i3bar_i3bar_SOURCES = \
403 i3bar_SOURCES = \
404404 i3bar/include/child.h \
405405 i3bar/include/common.h \
406406 i3bar/include/configuration.h \
423423 i3bar/src/workspaces.c \
424424 i3bar/src/xcb.c
425425
426 i3_config_wizard_i3_config_wizard_CFLAGS = \
426 i3_config_wizard_CFLAGS = \
427427 $(AM_CFLAGS) \
428428 $(libi3_CFLAGS) \
429429 $(LIBSN_CFLAGS) \
430430 $(XKBCOMMON_CFLAGS)
431431
432 i3_config_wizard_i3_config_wizard_LDADD = \
432 i3_config_wizard_LDADD = \
433433 $(libi3_LIBS) \
434434 $(LIBSN_LIBS) \
435435 $(XCB_UTIL_KEYSYMS_LIBS) \
436436 $(XKBCOMMON_LIBS)
437437
438 i3_config_wizard_i3_config_wizard_SOURCES = \
439 i3-config-wizard/atoms.xmacro \
438 i3_config_wizard_SOURCES = \
439 i3-config-wizard/i3-config-wizard-atoms.xmacro.h \
440440 i3-config-wizard/main.c \
441441 i3-config-wizard/xcb.h
442442
443 i3_config_wizard_i3_config_wizard_DEPENDENCIES = \
443 i3_config_wizard_DEPENDENCIES = \
444444 $(top_builddir)/libi3.a
445445
446446 test_inject_randr15_CPPFLAGS = \
499499 i3_SOURCES = \
500500 include/all.h \
501501 include/assignments.h \
502 include/atoms_NET_SUPPORTED.xmacro \
503 include/atoms_rest.xmacro \
504 include/atoms.xmacro \
502 include/i3-atoms_NET_SUPPORTED.xmacro.h \
503 include/i3-atoms_rest.xmacro.h \
505504 include/bindings.h \
506505 include/click.h \
507506 include/cmdparse.h \
620619 ################################################################################
621620
622621 anyevent-i3.stamp: AnyEvent-I3/lib/AnyEvent/I3.pm
623 $(AM_V_BUILD) (cd $(top_srcdir)/AnyEvent-I3 && perl Makefile.PL && make)
622 $(AM_V_BUILD) (cp -r $(top_srcdir)/AnyEvent-I3 . && cd AnyEvent-I3 && perl Makefile.PL && make)
624623 $(AM_V_at) touch $@
625624
626625 CLEANFILES = \
44
55 This is i3 v4.19. This version is considered stable. All users of i3 are
66 strongly encouraged to upgrade.
7
8 In this release, we switched from the autotools build system to the meson build
9 system (https://mesonbuild.com/). Check https://github.com/i3/i3/issues/4086 for
10 details. If this causes problems for you, you can revert the commit which
11 removed autotools from the tree: we tried our best to keep both build systems
12 working. Please reach out to us in that case!
713
814 ┌────────────────────────────┐
915 │ Changes in i3 v4.19 │
44 AC_INIT([i3], [4.18.1], [https://github.com/i3/i3/issues])
55 # For AX_EXTEND_SRCDIR
66 AX_ENABLE_BUILDDIR
7 AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2])
7 AM_INIT_AUTOMAKE([foreign -Wall no-dist-gzip dist-bzip2])
88 # Default to silent rules, use V=1 to get verbose compilation output.
99 AM_SILENT_RULES([yes])
1010 # Make it possible to disable maintainer mode to disable re-generation of build
11 Section: x11
22 Priority: extra
33 Maintainer: Michael Stapelberg <[email protected]>
4 Build-Depends: debhelper (>= 9),
5 dh-autoreconf,
4 Build-Depends: debhelper (>= 10),
5 meson,
66 libx11-dev,
77 libxcb-util0-dev (>= 0.3.8),
88 libxcb-keysyms1-dev,
+0
-32
debian/i3-wm.docs less more
0 docs/debugging.html
1 docs/hacking-howto.html
2 docs/i3bar-protocol.html
3 docs/userguide.html
4 docs/bigpicture.png
5 docs/single_terminal.png
6 docs/snapping.png
7 docs/two_columns.png
8 docs/two_terminals.png
9 docs/modes.png
10 docs/ipc.html
11 docs/multi-monitor.html
12 docs/wsbar.html
13 docs/wsbar.png
14 docs/keyboard-layer1.png
15 docs/keyboard-layer2.png
16 docs/testsuite.html
17 docs/i3-sync-working.png
18 docs/i3-sync.png
19 docs/tree-layout1.png
20 docs/tree-layout2.png
21 docs/tree-shot1.png
22 docs/tree-shot2.png
23 docs/tree-shot3.png
24 docs/tree-shot4.png
25 docs/refcard.html
26 docs/refcard_style.css
27 docs/logo-30.png
28 docs/lib-i3test.html
29 docs/lib-i3test-test.html
30 docs/layout-saving.html
31 docs/layout-saving-1.png
+0
-13
debian/i3-wm.manpages less more
0 man/i3.1
1 man/i3-msg.1
2 man/i3-input.1
3 man/i3-nagbar.1
4 man/i3-config-wizard.1
5 man/i3-dump-log.1
6 man/i3-migrate-config-to-v4.1
7 man/i3-sensible-pager.1
8 man/i3-sensible-editor.1
9 man/i3-sensible-terminal.1
10 man/i3-dmenu-desktop.1
11 man/i3-save-tree.1
12 man/i3bar.1
1212 override_dh_auto_test:
1313 # TODO: enable tests
1414
15 # TODO(autotools-removal): remove this override:
16 override_dh_autoreconf:
17 # Not needed with meson, but not a no-op either until we get rid of the
18 # autotools files.
19
1520 override_dh_auto_configure:
16 # The default is /usr/share/doc/i3
17 dh_auto_configure -- --docdir=/usr/share/doc/i3-wm
21 # Set -Ddocdir; the default is /usr/share/doc/i3
22 dh_auto_configure -- -Ddocdir=/usr/share/doc/i3-wm
1823
1924 override_dh_builddeb:
2025 # bintray does not support xz currently.
2126 dh_builddeb -- -Zgzip
2227
2328 %:
24 dh $@ --parallel --builddirectory=build --with=autoreconf
29 dh $@ --buildsystem=meson
2222
2323 == Building i3
2424
25 You can build i3 like you build any other software package which uses autotools.
25 You can build i3 like you build any other software package which uses meson.
2626 Here’s a memory refresher:
2727
28 $ autoreconf -fi
2928 $ mkdir -p build && cd build
30 $ ../configure
31 $ make -j8
32
33 The autoreconf -fi step is unnecessary if you are building from a release
34 tarball, but shouldn’t hurt either.
29 $ meson ..
30 $ ninja
3531
3632 === Build system features
3733
253249 Handlers to update X11 window properties like +WM_CLASS+, +_NET_WM_NAME+,
254250 +CLIENT_LEADER+, etc.
255251
256 include/atoms.xmacro::
252 include/*.xmacro.*::
257253 A file containing all X11 atoms which i3 uses. This file will be included
258254 various times (for defining, requesting and receiving the atoms), each time
259255 with a different definition of xmacro().
+0
-6
i3-config-wizard/atoms.xmacro less more
0 xmacro(_NET_WM_NAME)
1 xmacro(_NET_WM_WINDOW_TYPE)
2 xmacro(_NET_WM_WINDOW_TYPE_DIALOG)
3 xmacro(ATOM)
4 xmacro(CARDINAL)
5 xmacro(UTF8_STRING)
0 // clang-format off
1 #define CONFIG_WIZARD_ATOMS_XMACRO \
2 xmacro(_NET_WM_NAME) \
3 xmacro(_NET_WM_WINDOW_TYPE) \
4 xmacro(_NET_WM_WINDOW_TYPE_DIALOG) \
5 xmacro(ATOM) \
6 xmacro(CARDINAL) \
7 xmacro(UTF8_STRING)
4949 #include <X11/XKBlib.h>
5050 #include <X11/Xlib.h>
5151 #include <X11/keysym.h>
52
53 #include "i3-config-wizard-atoms.xmacro.h"
5254
5355 /* We need SYSCONFDIR for the path to the keycode config template, so raise an
5456 * error if it’s not defined for whatever reason */
842844 /* Place requests for the atoms we need as soon as possible */
843845 #define xmacro(atom) \
844846 xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
845 #include "atoms.xmacro"
847 CONFIG_WIZARD_ATOMS_XMACRO
846848 #undef xmacro
847849
848850 /* Init startup notification. */
899901 A_##name = reply->atom; \
900902 free(reply); \
901903 } while (0);
902 #include "atoms.xmacro"
904 CONFIG_WIZARD_ATOMS_XMACRO
903905 #undef xmacro
904906
905907 /* Set dock mode */
22 /* from X11/keysymdef.h */
33 #define XCB_NUM_LOCK 0xff7f
44
5 #include "i3-config-wizard-atoms.xmacro.h"
6
57 #define xmacro(atom) xcb_atom_t A_##atom;
6 #include "atoms.xmacro"
8 CONFIG_WIZARD_ATOMS_XMACRO
79 #undef xmacro
+0
-6
i3-nagbar/atoms.xmacro less more
0 xmacro(_NET_WM_WINDOW_TYPE)
1 xmacro(_NET_WM_WINDOW_TYPE_DOCK)
2 xmacro(_NET_WM_STRUT_PARTIAL)
3 xmacro(I3_SOCKET_PATH)
4 xmacro(ATOM)
5 xmacro(CARDINAL)
0 // clang-format off
1 #define NAGBAR_ATOMS_XMACRO \
2 xmacro(_NET_WM_WINDOW_TYPE) \
3 xmacro(_NET_WM_WINDOW_TYPE_DOCK) \
4 xmacro(_NET_WM_STRUT_PARTIAL) \
5 xmacro(I3_SOCKET_PATH) \
6 xmacro(ATOM) \
7 xmacro(CARDINAL)
3434 #define SN_API_NOT_YET_FROZEN 1
3535 #include <libsn/sn-launchee.h>
3636
37 #include "i3-nagbar-atoms.xmacro.h"
38
3739 #define MSG_PADDING logical_px(8)
3840 #define BTN_PADDING logical_px(3)
3941 #define BTN_BORDER logical_px(3)
4244 #define BAR_BORDER logical_px(2)
4345
4446 #define xmacro(atom) xcb_atom_t A_##atom;
45 #include "atoms.xmacro"
47 NAGBAR_ATOMS_XMACRO
4648 #undef xmacro
4749
4850 #define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
425427 /* Place requests for the atoms we need as soon as possible */
426428 #define xmacro(atom) \
427429 xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
428 #include "atoms.xmacro"
430 NAGBAR_ATOMS_XMACRO
429431 #undef xmacro
430432
431433 /* Init startup notification. */
507509 A_##name = reply->atom; \
508510 free(reply); \
509511 } while (0);
510 #include "atoms.xmacro"
512 NAGBAR_ATOMS_XMACRO
511513 #undef xmacro
512514
513515 /* Set dock mode */
+0
-2
include/atoms.xmacro less more
0 #include "atoms_NET_SUPPORTED.xmacro"
1 #include "atoms_rest.xmacro"
+0
-35
include/atoms_NET_SUPPORTED.xmacro less more
0 xmacro(_NET_SUPPORTED)
1 xmacro(_NET_SUPPORTING_WM_CHECK)
2 xmacro(_NET_WM_NAME)
3 xmacro(_NET_WM_VISIBLE_NAME)
4 xmacro(_NET_WM_MOVERESIZE)
5 xmacro(_NET_WM_STATE_STICKY)
6 xmacro(_NET_WM_STATE_FULLSCREEN)
7 xmacro(_NET_WM_STATE_DEMANDS_ATTENTION)
8 xmacro(_NET_WM_STATE_MODAL)
9 xmacro(_NET_WM_STATE_HIDDEN)
10 xmacro(_NET_WM_STATE_FOCUSED)
11 xmacro(_NET_WM_STATE)
12 xmacro(_NET_WM_WINDOW_TYPE)
13 xmacro(_NET_WM_WINDOW_TYPE_NORMAL)
14 xmacro(_NET_WM_WINDOW_TYPE_DOCK)
15 xmacro(_NET_WM_WINDOW_TYPE_DIALOG)
16 xmacro(_NET_WM_WINDOW_TYPE_UTILITY)
17 xmacro(_NET_WM_WINDOW_TYPE_TOOLBAR)
18 xmacro(_NET_WM_WINDOW_TYPE_SPLASH)
19 xmacro(_NET_WM_WINDOW_TYPE_MENU)
20 xmacro(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
21 xmacro(_NET_WM_WINDOW_TYPE_POPUP_MENU)
22 xmacro(_NET_WM_WINDOW_TYPE_TOOLTIP)
23 xmacro(_NET_WM_WINDOW_TYPE_NOTIFICATION)
24 xmacro(_NET_WM_DESKTOP)
25 xmacro(_NET_WM_STRUT_PARTIAL)
26 xmacro(_NET_CLIENT_LIST)
27 xmacro(_NET_CLIENT_LIST_STACKING)
28 xmacro(_NET_CURRENT_DESKTOP)
29 xmacro(_NET_NUMBER_OF_DESKTOPS)
30 xmacro(_NET_DESKTOP_NAMES)
31 xmacro(_NET_DESKTOP_VIEWPORT)
32 xmacro(_NET_ACTIVE_WINDOW)
33 xmacro(_NET_CLOSE_WINDOW)
34 xmacro(_NET_MOVERESIZE_WINDOW)
+0
-20
include/atoms_rest.xmacro less more
0 xmacro(_NET_WM_USER_TIME)
1 xmacro(_NET_STARTUP_ID)
2 xmacro(_NET_WORKAREA)
3 xmacro(WM_PROTOCOLS)
4 xmacro(WM_DELETE_WINDOW)
5 xmacro(UTF8_STRING)
6 xmacro(WM_STATE)
7 xmacro(WM_CLIENT_LEADER)
8 xmacro(WM_TAKE_FOCUS)
9 xmacro(WM_WINDOW_ROLE)
10 xmacro(I3_SOCKET_PATH)
11 xmacro(I3_CONFIG_PATH)
12 xmacro(I3_SYNC)
13 xmacro(I3_SHMLOG_PATH)
14 xmacro(I3_PID)
15 xmacro(I3_FLOATING_WINDOW)
16 xmacro(_NET_REQUEST_FRAME_EXTENTS)
17 xmacro(_NET_FRAME_EXTENTS)
18 xmacro(_MOTIF_WM_HINTS)
19 xmacro(WM_CHANGE_STATE)
0 // clang-format off
1 #define I3_NET_SUPPORTED_ATOMS_XMACRO \
2 xmacro(_NET_SUPPORTED) \
3 xmacro(_NET_SUPPORTING_WM_CHECK) \
4 xmacro(_NET_WM_NAME) \
5 xmacro(_NET_WM_VISIBLE_NAME) \
6 xmacro(_NET_WM_MOVERESIZE) \
7 xmacro(_NET_WM_STATE_STICKY) \
8 xmacro(_NET_WM_STATE_FULLSCREEN) \
9 xmacro(_NET_WM_STATE_DEMANDS_ATTENTION) \
10 xmacro(_NET_WM_STATE_MODAL) \
11 xmacro(_NET_WM_STATE_HIDDEN) \
12 xmacro(_NET_WM_STATE_FOCUSED) \
13 xmacro(_NET_WM_STATE) \
14 xmacro(_NET_WM_WINDOW_TYPE) \
15 xmacro(_NET_WM_WINDOW_TYPE_NORMAL) \
16 xmacro(_NET_WM_WINDOW_TYPE_DOCK) \
17 xmacro(_NET_WM_WINDOW_TYPE_DIALOG) \
18 xmacro(_NET_WM_WINDOW_TYPE_UTILITY) \
19 xmacro(_NET_WM_WINDOW_TYPE_TOOLBAR) \
20 xmacro(_NET_WM_WINDOW_TYPE_SPLASH) \
21 xmacro(_NET_WM_WINDOW_TYPE_MENU) \
22 xmacro(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU) \
23 xmacro(_NET_WM_WINDOW_TYPE_POPUP_MENU) \
24 xmacro(_NET_WM_WINDOW_TYPE_TOOLTIP) \
25 xmacro(_NET_WM_WINDOW_TYPE_NOTIFICATION) \
26 xmacro(_NET_WM_DESKTOP) \
27 xmacro(_NET_WM_STRUT_PARTIAL) \
28 xmacro(_NET_CLIENT_LIST) \
29 xmacro(_NET_CLIENT_LIST_STACKING) \
30 xmacro(_NET_CURRENT_DESKTOP) \
31 xmacro(_NET_NUMBER_OF_DESKTOPS) \
32 xmacro(_NET_DESKTOP_NAMES) \
33 xmacro(_NET_DESKTOP_VIEWPORT) \
34 xmacro(_NET_ACTIVE_WINDOW) \
35 xmacro(_NET_CLOSE_WINDOW) \
36 xmacro(_NET_MOVERESIZE_WINDOW)
0 // clang-format off
1 #define I3_REST_ATOMS_XMACRO \
2 xmacro(_NET_WM_USER_TIME) \
3 xmacro(_NET_STARTUP_ID) \
4 xmacro(_NET_WORKAREA) \
5 xmacro(WM_PROTOCOLS) \
6 xmacro(WM_DELETE_WINDOW) \
7 xmacro(UTF8_STRING) \
8 xmacro(WM_STATE) \
9 xmacro(WM_CLIENT_LEADER) \
10 xmacro(WM_TAKE_FOCUS) \
11 xmacro(WM_WINDOW_ROLE) \
12 xmacro(I3_SOCKET_PATH) \
13 xmacro(I3_CONFIG_PATH) \
14 xmacro(I3_SYNC) \
15 xmacro(I3_SHMLOG_PATH) \
16 xmacro(I3_PID) \
17 xmacro(I3_FLOATING_WINDOW) \
18 xmacro(_NET_REQUEST_FRAME_EXTENTS) \
19 xmacro(_NET_FRAME_EXTENTS) \
20 xmacro(_MOTIF_WM_HINTS) \
21 xmacro(WM_CHANGE_STATE)
100100 #if !defined(DLOG)
101101 void debuglog(char *fmt, ...)
102102 __attribute__((format(printf, 1, 2)));
103 #define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, STRIPPED__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
103 #define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
104104 #endif
105105
106106 /**
2525 is, delete the preceding comma */
2626 #define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)
2727 #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
28 #define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, STRIPPED__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
28 #define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
2929
3030 extern char *errorfilename;
3131 extern char *shmlogname;
4848 XCB_EVENT_MASK_FOCUS_CHANGE | \
4949 XCB_EVENT_MASK_ENTER_WINDOW)
5050
51 #include "i3-atoms_rest.xmacro.h"
52 #include "i3-atoms_NET_SUPPORTED.xmacro.h"
53
5154 #define xmacro(atom) extern xcb_atom_t A_##atom;
52 #include "atoms.xmacro"
55 I3_NET_SUPPORTED_ATOMS_XMACRO
56 I3_REST_ATOMS_XMACRO
5357 #undef xmacro
5458
5559 extern unsigned int xcb_numlock_mask;
1515 */
1616 bool is_debug_build(void) {
1717 /* i3_version contains either something like this:
18 * "4.0.2 (2011-11-11, branch "release")".
19 * or: "4.0.2-123-gCOFFEEBABE (2011-11-11, branch "next")".
18 * "4.0.2 (2011-11-11)" (release version)
19 * or: "4.0.2-123-gC0FFEE" (debug version)
2020 *
2121 * So we check for the offset of the first opening round bracket to
2222 * determine whether this is a git version or a release version. */
23 if (strchr(I3_VERSION, '(') == NULL) {
24 return true; // e.g. 4.0.2-123-gC0FFEE
25 }
26 /* In practice, debug versions do not contain parentheses at all,
27 * but leave the logic as it was before so that we can re-add
28 * parentheses if we chose to. */
2329 return ((strchr(I3_VERSION, '(') - I3_VERSION) > 10);
2430 }
0 #!/bin/sh
1
2 set -eu
3
4 cd "${MESON_DIST_ROOT}"
5
6 # Delete everything we do not want to have in the release tarballs:
7 rm -rf \
8 contrib/banner.svg \
9 contrib/show-download-count.sh \
10 contrib/sticker-7x5cm-stickma.tif.lzma \
11 contrib/sticker_stickma_black.svg \
12 debian/ \
13 docs/GPN-2009-06-27/ \
14 docs/NoName-2009-03-12/ \
15 docs/slides-2012-01-25/ \
16 docs/slides-2012-03-16/ \
17 testcases/.gitignore \
18 travis/ \
19 .clang-format \
20 .editorconfig \
21 i3bar/.gitignore \
22 .travis.yml \
23 logo.svg \
24 README.md \
25 RELEASE-NOTES-next \
26 release.sh
27
28 mkdir build
29 cd build
30 meson .. -Dprefix=/usr -Ddocs=true -Dmans=true
31 ninja
32 cp *.1 ../man/
33 cp *.html ../docs/
34 cd ..
35 rm -rf build
0 #!/bin/sh
1 ln -sf "i3" "${MESON_INSTALL_DESTDIR_PREFIX}/$1/i3-with-shmlog"
0 # -*- mode: meson -*-
1
2 # Style objective: be consistent with what mesonbuild.com documents/uses, and/or
3 # the meson book: https://meson-manual.com/
4
5 project(
6 'i3',
7 'c',
8 version: '4.18.1',
9 default_options: [
10 'c_std=c11',
11 'warning_level=1', # enable all warnings (-Wall)
12 # TODO(https://github.com/i3/i3/issues/4087): switch to
13 # 'buildtype=debugoptimized',
14 ],
15 # Ubuntu 18.04 (supported until 2023) has meson 0.45.
16 # We can revisit our minimum supported meson version
17 # if it turns out to be too hard to maintain.
18 meson_version: '>=0.45.0',
19 )
20
21 cc = meson.get_compiler('c')
22 add_project_arguments(cc.get_supported_arguments(['-Wunused-value']), language: 'c')
23
24 if meson.version().version_compare('>=0.48.0')
25 # https://github.com/mesonbuild/meson/issues/2166#issuecomment-629696911
26 meson.add_dist_script('meson/meson-dist-script')
27 else
28 message('meson <0.48.0 detected, dist tarballs will not be filtered')
29 endif
30
31 ################################################################################
32 # Version handling
33 ################################################################################
34
35 cdata = configuration_data()
36
37 version_array = meson.project_version().split('.')
38 cdata.set('MAJOR_VERSION', version_array[0].to_int())
39 cdata.set('MINOR_VERSION', version_array[1].to_int())
40 if version_array.length() > 2
41 cdata.set('PATCH_VERSION', version_array[2].to_int())
42 else
43 cdata.set('PATCH_VERSION', 0)
44 endif
45 cdata.set_quoted('I3_VERSION', '@VCS_TAG@')
46 cdata.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
47
48 if get_option('b_sanitize').split(',').contains('address')
49 cdata.set('I3_ASAN_ENABLED', 1)
50 endif
51
52 cdata.set('HAVE_STRNDUP', cc.has_function('strndup'))
53 cdata.set('HAVE_MKDIRP', cc.has_function('mkdirp'))
54
55 # Instead of generating config.h directly, make vcs_tag generate it so that
56 # @VCS_TAG@ is replaced.
57 config_h_in = configure_file(
58 output: 'config.h.in',
59 configuration: cdata,
60 )
61 config_h = declare_dependency(
62 sources: vcs_tag(
63 input: config_h_in,
64 output: 'config.h',
65 fallback: meson.project_version() + '-non-git',
66 )
67 )
68
69 ################################################################################
70 # docs generation
71 ################################################################################
72
73 docdir = get_option('docdir')
74 if docdir == ''
75 docdir = join_paths(get_option('datadir'), 'doc', 'i3')
76 endif
77
78 if get_option('docs')
79 asciidoc = find_program('asciidoc')
80 doc_toc_inputs = [
81 'docs/hacking-howto',
82 'docs/userguide',
83 'docs/ipc',
84 'docs/multi-monitor',
85 'docs/wsbar',
86 'docs/testsuite',
87 'docs/i3bar-protocol',
88 'docs/layout-saving',
89 ]
90 foreach m : doc_toc_inputs
91 custom_target(
92 m.underscorify()+'_asciidoc',
93 input: m,
94 output: '@[email protected]',
95 command: [
96 asciidoc,
97 '-a', 'toc',
98 '-n',
99 '-o', '@OUTPUT@',
100 '@INPUT@',
101 ],
102 install: true,
103 install_dir: docdir,
104 )
105 endforeach
106
107 doc_notoc_inputs = [
108 'docs/debugging',
109 ]
110 foreach m : doc_notoc_inputs
111 custom_target(
112 m.underscorify()+'_asciidoc',
113 input: m,
114 output: '@[email protected]',
115 command: [
116 asciidoc,
117 '-n',
118 '-o', '@OUTPUT@',
119 '@INPUT@',
120 ],
121 install: true,
122 install_dir: docdir,
123 )
124 endforeach
125
126 else
127 install_data(
128 [
129 'docs/hacking-howto.html',
130 'docs/userguide.html',
131 'docs/ipc.html',
132 'docs/multi-monitor.html',
133 'docs/wsbar.html',
134 'docs/testsuite.html',
135 'docs/i3bar-protocol.html',
136 'docs/layout-saving.html',
137 'docs/debugging.html',
138 ],
139 install_dir: docdir,
140 )
141 endif
142
143 install_data(
144 [
145 'docs/bigpicture.png',
146 'docs/single_terminal.png',
147 'docs/snapping.png',
148 'docs/two_columns.png',
149 'docs/two_terminals.png',
150 'docs/modes.png',
151 'docs/wsbar.png',
152 'docs/keyboard-layer1.png',
153 'docs/keyboard-layer2.png',
154 'docs/i3-sync-working.png',
155 'docs/i3-sync.png',
156 'docs/tree-layout1.png',
157 'docs/tree-layout2.png',
158 'docs/tree-shot1.png',
159 'docs/tree-shot2.png',
160 'docs/tree-shot3.png',
161 'docs/tree-shot4.png',
162 'docs/refcard.html',
163 'docs/refcard_style.css',
164 'docs/logo-30.png',
165 'docs/layout-saving-1.png',
166 ],
167 install_dir: docdir,
168 )
169
170 if meson.version().version_compare('>=0.53')
171 summary('build docs (-Ddocs)', get_option('docs'))
172 endif
173
174 ################################################################################
175 # manpages
176 ################################################################################
177
178 man1 = join_paths(get_option('mandir'), 'man1')
179
180 if get_option('mans')
181 asciidoc = find_program('asciidoc')
182 asciidoc_cdata = configuration_data()
183 asciidoc_cdata.set('PACKAGE_VERSION', meson.project_version())
184 asciidoc_conf = configure_file(
185 input: 'man/asciidoc.conf.in',
186 output: 'asciidoc.conf',
187 configuration: asciidoc_cdata,
188 )
189
190 xmlto = find_program('xmlto')
191
192 pod2man = find_program('pod2man')
193
194 man_inputs = [
195 'man/i3.man',
196 'man/i3bar.man',
197 'man/i3-msg.man',
198 'man/i3-input.man',
199 'man/i3-nagbar.man',
200 'man/i3-config-wizard.man',
201 'man/i3-migrate-config-to-v4.man',
202 'man/i3-sensible-editor.man',
203 'man/i3-sensible-pager.man',
204 'man/i3-sensible-terminal.man',
205 'man/i3-dump-log.man',
206 ]
207
208 foreach m : man_inputs
209 xml = custom_target(
210 m.underscorify()+'_asciidoc',
211 input: m,
212 output: '@[email protected]',
213 command: [
214 asciidoc,
215 '-d', 'manpage',
216 '-b', 'docbook',
217 '-f', asciidoc_conf,
218 '-o', '@OUTPUT@',
219 '@INPUT@',
220 ],
221 )
222
223 custom_target(
224 m.underscorify()+'_xmlto',
225 input: xml,
226 output: '@[email protected]',
227 command: [
228 xmlto,
229 'man',
230 '-o',
231 '@OUTDIR@',
232 '@INPUT@',
233 ],
234 # We should use install and install_dir instead of install_man as per:
235 # https://github.com/mesonbuild/meson/issues/4981#issuecomment-467084867
236 # https://github.com/mesonbuild/meson/issues/1550#issuecomment-370164307
237 install: true,
238 install_dir: man1,
239 )
240 endforeach
241
242 pod2man_inputs = [
243 'i3-dmenu-desktop',
244 'i3-save-tree',
245 ]
246 foreach m : pod2man_inputs
247 custom_target(
248 m.underscorify()+'_pod2man',
249 input: m,
250 output: '@[email protected]',
251 command: [
252 pod2man,
253 '--utf8',
254 '@INPUT@',
255 '@OUTPUT@',
256 ],
257 # We should use install and install_dir instead of install_man as per:
258 # https://github.com/mesonbuild/meson/issues/4981#issuecomment-467084867
259 # https://github.com/mesonbuild/meson/issues/1550#issuecomment-370164307
260 install: true,
261 install_dir: man1,
262 )
263 endforeach
264
265 else
266 install_data(
267 [
268 'man/i3.1',
269 'man/i3bar.1',
270 'man/i3-msg.1',
271 'man/i3-input.1',
272 'man/i3-nagbar.1',
273 'man/i3-config-wizard.1',
274 'man/i3-migrate-config-to-v4.1',
275 'man/i3-sensible-editor.1',
276 'man/i3-sensible-pager.1',
277 'man/i3-sensible-terminal.1',
278 'man/i3-dump-log.1',
279 'man/i3-dmenu-desktop.1',
280 'man/i3-save-tree.1',
281 ],
282 install_dir: man1,
283 )
284 endif
285
286 if meson.version().version_compare('>=0.53')
287 summary('build manpages (-Dmans)', get_option('docs'))
288 endif
289
290 # Required for e.g. struct ucred to be defined as per unix(7).
291 add_project_arguments('-D_GNU_SOURCE', language: 'c')
292
293 # https://mesonbuild.com/howtox.html#add-math-library-lm-portably
294 m_dep = cc.find_library('m', required: false)
295 rt_dep = cc.find_library('rt', required: false)
296 iconv_dep = cc.find_library('iconv', required: false)
297
298 libsn_dep = dependency('libstartup-notification-1.0', method: 'pkg-config')
299 xcb_dep = dependency('xcb', method: 'pkg-config')
300 xcb_xkb_dep = dependency('xcb-xkb', method: 'pkg-config')
301 xcb_xinerama_dep = dependency('xcb-xinerama', method: 'pkg-config')
302 xcb_randr_dep = dependency('xcb-randr', method: 'pkg-config')
303 xcb_shape_dep = dependency('xcb-shape', method: 'pkg-config')
304 xcb_util_dep = dependency('xcb-util', method: 'pkg-config')
305 xcb_util_cursor_dep = dependency('xcb-cursor', method: 'pkg-config')
306 xcb_util_keysyms_dep = dependency('xcb-keysyms', method: 'pkg-config')
307 xcb_util_wm_dep = dependency('xcb-icccm', method: 'pkg-config')
308 xcb_util_xrm_dep = dependency('xcb-xrm', method: 'pkg-config')
309 xkbcommon_dep = dependency('xkbcommon', method: 'pkg-config')
310 xkbcommon_x11_dep = dependency('xkbcommon-x11', method: 'pkg-config')
311 yajl_dep = dependency('yajl', method: 'pkg-config')
312 libpcre_dep = dependency('libpcre', version: '>=8.10', method: 'pkg-config')
313 cairo_dep = dependency('cairo', version: '>=1.14.4', method: 'pkg-config')
314 pangocairo_dep = dependency('pangocairo', method: 'pkg-config')
315 glib_dep = dependency('glib-2.0', method: 'pkg-config')
316 gobject_dep = dependency('gobject-2.0', method: 'pkg-config')
317
318 ev_dep = cc.find_library('ev')
319
320 inc = include_directories('include')
321
322 libi3srcs = [
323 'libi3/dpi.c',
324 'libi3/draw_util.c',
325 'libi3/fake_configure_notify.c',
326 'libi3/font.c',
327 'libi3/format_placeholders.c',
328 'libi3/get_colorpixel.c',
329 'libi3/get_config_path.c',
330 'libi3/get_exe_path.c',
331 'libi3/get_mod_mask.c',
332 'libi3/get_process_filename.c',
333 'libi3/get_visualtype.c',
334 'libi3/g_utf8_make_valid.c',
335 'libi3/ipc_connect.c',
336 'libi3/ipc_recv_message.c',
337 'libi3/ipc_send_message.c',
338 'libi3/is_debug_build.c',
339 'libi3/resolve_tilde.c',
340 'libi3/root_atom_contents.c',
341 'libi3/safewrappers.c',
342 'libi3/string.c',
343 'libi3/ucs2_conversion.c',
344 ]
345
346 if not cdata.get('HAVE_STRNDUP')
347 libi3srcs += 'libi3/strndup.c'
348 endif
349
350 if not cdata.get('HAVE_MKDIRP')
351 libi3srcs += 'libi3/mkdirp.c'
352 endif
353
354 libi3 = static_library(
355 'i3',
356 libi3srcs,
357 include_directories: inc,
358 dependencies: [
359 pangocairo_dep,
360 config_h,
361 ],
362 )
363
364 i3srcs = [
365 'src/assignments.c',
366 'src/bindings.c',
367 'src/click.c',
368 'src/commands.c',
369 'src/commands_parser.c',
370 'src/con.c',
371 'src/config.c',
372 'src/config_directives.c',
373 'src/config_parser.c',
374 'src/display_version.c',
375 'src/drag.c',
376 'src/ewmh.c',
377 'src/fake_outputs.c',
378 'src/floating.c',
379 'src/handlers.c',
380 'src/ipc.c',
381 'src/key_press.c',
382 'src/load_layout.c',
383 'src/log.c',
384 'src/main.c',
385 'src/manage.c',
386 'src/match.c',
387 'src/move.c',
388 'src/output.c',
389 'src/randr.c',
390 'src/regex.c',
391 'src/render.c',
392 'src/resize.c',
393 'src/restore_layout.c',
394 'src/scratchpad.c',
395 'src/sd-daemon.c',
396 'src/sighandler.c',
397 'src/startup.c',
398 'src/sync.c',
399 'src/tree.c',
400 'src/util.c',
401 'src/version.c',
402 'src/window.c',
403 'src/workspace.c',
404 'src/x.c',
405 'src/xcb.c',
406 'src/xcursor.c',
407 'src/xinerama.c',
408 ]
409
410 # Verify the perl interpreter is present for running parser_gen,
411 # ensuring a good error message when it isn’t:
412 perl = find_program('perl')
413 parser_gen = find_program('generate-command-parser.pl')
414
415 command_parser = custom_target(
416 'command_parser',
417 input: 'parser-specs/commands.spec',
418 output: [
419 'GENERATED_command_enums.h',
420 'GENERATED_command_tokens.h',
421 'GENERATED_command_call.h',
422 ],
423 command: [perl, parser_gen, '--input=@INPUT@', '--prefix=command'],
424 )
425
426 i3srcs += command_parser
427
428 config_parser = custom_target(
429 'config_parser',
430 input: 'parser-specs/config.spec',
431 output: [
432 'GENERATED_config_enums.h',
433 'GENERATED_config_tokens.h',
434 'GENERATED_config_call.h',
435 ],
436 command: [parser_gen, '--input=@INPUT@', '--prefix=config'],
437 )
438
439 i3srcs += config_parser
440
441 # src/log.c uses threading primitives for synchronization
442 thread_dep = dependency('threads')
443
444 common_deps = [
445 thread_dep,
446 m_dep,
447 iconv_dep,
448 rt_dep,
449 libsn_dep,
450 xcb_dep,
451 xcb_xkb_dep,
452 xcb_xinerama_dep,
453 xcb_randr_dep,
454 xcb_shape_dep,
455 xcb_util_dep,
456 xcb_util_cursor_dep,
457 xcb_util_keysyms_dep,
458 xcb_util_wm_dep,
459 xcb_util_xrm_dep,
460 xkbcommon_dep,
461 xkbcommon_x11_dep,
462 yajl_dep,
463 libpcre_dep,
464 cairo_dep,
465 pangocairo_dep,
466 glib_dep,
467 gobject_dep,
468 ev_dep,
469 config_h,
470 ]
471
472 executable(
473 'i3',
474 i3srcs,
475 install: true,
476 include_directories: inc,
477 dependencies: common_deps,
478 link_with: libi3,
479 )
480
481 # This is the only currently working way of installing a symbolic link:
482 meson.add_install_script(
483 'meson/meson-install-i3-with-shmlog',
484 get_option('bindir'),
485 )
486
487 executable(
488 'i3bar',
489 [
490 'i3bar/src/child.c',
491 'i3bar/src/config.c',
492 'i3bar/src/ipc.c',
493 'i3bar/src/main.c',
494 'i3bar/src/mode.c',
495 'i3bar/src/outputs.c',
496 'i3bar/src/parse_json_header.c',
497 'i3bar/src/workspaces.c',
498 'i3bar/src/xcb.c',
499 ],
500 install: true,
501 include_directories: include_directories('include', 'i3bar/include'),
502 dependencies: common_deps,
503 link_with: libi3,
504 )
505
506 executable(
507 'i3-config-wizard',
508 [
509 'i3-config-wizard/i3-config-wizard-atoms.xmacro.h',
510 'i3-config-wizard/main.c',
511 'i3-config-wizard/xcb.h',
512 ],
513 install: true,
514 include_directories: include_directories('include', 'i3-config-wizard'),
515 dependencies: common_deps,
516 link_with: libi3,
517 )
518
519 executable(
520 'i3-dump-log',
521 'i3-dump-log/main.c',
522 install: true,
523 include_directories: inc,
524 dependencies: common_deps,
525 link_with: libi3,
526 )
527
528 executable(
529 'i3-input',
530 [
531 'i3-input/i3-input.h',
532 'i3-input/keysym2ucs.h',
533 'i3-input/keysym2ucs.c',
534 'i3-input/main.c',
535 ],
536 install: true,
537 include_directories: inc,
538 dependencies: common_deps,
539 link_with: libi3,
540 )
541
542 executable(
543 'i3-msg',
544 'i3-msg/main.c',
545 install: true,
546 include_directories: inc,
547 dependencies: common_deps,
548 link_with: libi3,
549 )
550
551 executable(
552 'i3-nagbar',
553 [
554 'i3-nagbar/i3-nagbar-atoms.xmacro.h',
555 'i3-nagbar/main.c',
556 ],
557 install: true,
558 include_directories: include_directories('include', 'i3-nagbar'),
559 dependencies: common_deps,
560 link_with: libi3,
561 )
562
563 install_data(
564 [
565 'i3-dmenu-desktop',
566 'i3-migrate-config-to-v4',
567 'i3-save-tree',
568 'i3-sensible-editor',
569 'i3-sensible-pager',
570 'i3-sensible-terminal',
571 ],
572 install_dir: 'bin',
573 )
574
575 install_subdir(
576 'etc',
577 strip_directory: true,
578 install_dir: join_paths(get_option('sysconfdir'), 'i3'),
579 )
580
581 install_subdir(
582 'share/',
583 strip_directory: true,
584 install_dir: get_option('datadir'),
585 )
586
587 install_headers(
588 'include/i3/ipc.h',
589 subdir: 'i3',
590 )
591
592 # We cannot use configure_file for complete-run.pl.in and i3test.pm.in
593 # because configure_file strips the backslash in e.g. \@display,
594 # resulting in @display, breaking our Perl code:
595 # https://github.com/mesonbuild/meson/issues/7165
596 sed = find_program('sed')
597 replace_dirs = [
598 sed,
599 '-e',
600 's,@abs_top_builddir@,'+meson.current_build_dir()+',g;s,@abs_top_srcdir@,'+meson.current_source_dir()+',g',
601 '@INPUT@',
602 ]
603 complete_run = custom_target(
604 'complete-run',
605 input: ['testcases/complete-run.pl.in'],
606 output: ['complete-run.pl'],
607 capture: true,
608 command: replace_dirs,
609 )
610 i3test_pm = custom_target(
611 'i3test-pm',
612 input: ['testcases/lib/i3test.pm.in'],
613 output: ['i3test.pm'],
614 capture: true,
615 command: replace_dirs,
616 )
617
618 if get_option('docs')
619 i3_pod2html = find_program('docs/i3-pod2html')
620
621 custom_target(
622 'lib-i3test.html',
623 input: i3test_pm,
624 output: 'lib-i3test.html',
625 command: [
626 i3_pod2html,
627 '@INPUT@',
628 '@OUTPUT@',
629 ],
630 install: true,
631 install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
632 )
633
634 custom_target(
635 'lib-i3test-test.html',
636 input: 'testcases/lib/i3test/Test.pm',
637 output: 'lib-i3test-test.html',
638 command: [
639 i3_pod2html,
640 '@INPUT@',
641 '@OUTPUT@',
642 ],
643 install: true,
644 install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
645 )
646 endif
647
648 executable(
649 'test.inject_randr15',
650 'testcases/inject_randr1.5.c',
651 include_directories: inc,
652 dependencies: common_deps,
653 link_with: libi3,
654 )
655
656 executable(
657 'test.commands_parser',
658 'src/commands_parser.c',
659 include_directories: inc,
660 c_args: '-DTEST_PARSER',
661 dependencies: common_deps,
662 link_with: libi3,
663 )
664
665 executable(
666 'test.config_parser',
667 'src/config_parser.c',
668 include_directories: inc,
669 c_args: '-DTEST_PARSER',
670 dependencies: common_deps,
671 link_with: libi3,
672 )
673
674 anyevent_i3 = custom_target(
675 'anyevent-i3',
676 # Should be AnyEvent-I3/blib/lib/AnyEvent/I3.pm,
677 # but see https://github.com/mesonbuild/meson/issues/2320
678 output: 'AnyEvent-I3.stamp',
679 command: [
680 'sh',
681 '-c',
682 'cp -r @0@/AnyEvent-I3 . && cd AnyEvent-I3 && perl Makefile.PL && make && touch ../AnyEvent-I3.stamp'.format(meson.current_source_dir()),
683 ],
684 )
685
686 if meson.version().version_compare('>=0.46.0')
687 test(
688 'complete-run',
689 perl,
690 args: [complete_run],
691 depends: [
692 # i3test.pm is generated at meson configure time,
693 # so no explicit dependency is required.
694 anyevent_i3,
695 ],
696 )
697 else
698 # meson < 0.46.0 does not support the depends arg in test targets.
699 # Just hope for the best.
700 test(
701 'complete-run',
702 perl,
703 args: [complete_run],
704 )
705 message('meson < 0.46 detected, you might need to run ninja test twice')
706 endif
0 # -*- mode: meson -*-
1
2 option('docs', type: 'boolean', value: false,
3 description: 'Build documentation from source (release tarballs contain a generated copy)')
4
5 option('mans', type: 'boolean', value: false,
6 description: 'Build manpages from source (release tarballs contain a generated copy)')
7
8 option('docdir', type: 'string', value: '',
9 description: 'documentation directory (default: $datadir/docs/i3)')
5454 cp "${STARTDIR}/RELEASE-NOTES-${RELEASE_VERSION}" "RELEASE-NOTES-${RELEASE_VERSION}"
5555 git add RELEASE-NOTES-${RELEASE_VERSION}
5656 git rm RELEASE-NOTES-${PREVIOUS_VERSION}
57 sed -i "s,RELEASE-NOTES-${PREVIOUS_VERSION},RELEASE-NOTES-${RELEASE_VERSION},g" Makefile.am
58 sed -i "s/AC_INIT(\[i3\], \[${PREVIOUS_VERSION}\]/AC_INIT([i3], [${RELEASE_VERSION}]/" configure.ac
59 echo "${RELEASE_VERSION} ($(date +%F))" > I3_VERSION
60 git add I3_VERSION
57 sed -i "s/^\s*version: '${PREVIOUS_VERSION}'/ version: '${RELEASE_VERSION}'/" meson.build
6158 git commit -a -m "release i3 ${RELEASE_VERSION}"
6259 git tag "${RELEASE_VERSION}" -m "release i3 ${RELEASE_VERSION}" --sign --local-user=0x4AC8EE1D
6360
64 autoreconf -fi
6561 mkdir build
66 (cd build && ../configure && make dist-bzip2 -j8)
67 cp build/i3-${RELEASE_VERSION}.tar.bz2 .
62 (cd build && meson .. && ninja dist)
63 cp build/meson-build/i3-${RELEASE_VERSION}.tar.xz .
6864
6965 echo "Differences in the release tarball file lists:"
7066
7167 diff --color -u \
72 <(tar tf ../i3-${PREVIOUS_VERSION}.tar.bz2 | sed "s,i3-${PREVIOUS_VERSION}/,,g" | sort) \
73 <(tar tf i3-${RELEASE_VERSION}.tar.bz2 | sed "s,i3-${RELEASE_VERSION}/,,g" | sort)
74
75 gpg --armor -b i3-${RELEASE_VERSION}.tar.bz2
68 <(tar tf ../i3-${PREVIOUS_VERSION}.tar.xz | sed "s,i3-${PREVIOUS_VERSION}/,,g" | sort) \
69 <(tar tf i3-${RELEASE_VERSION}.tar.xz | sed "s,i3-${RELEASE_VERSION}/,,g" | sort)
70
71 gpg --armor -b i3-${RELEASE_VERSION}.tar.xz
7672
7773 echo "${RELEASE_VERSION}-non-git" > I3_VERSION
7874 git add I3_VERSION
112108 FROM debian:sid
113109 RUN sed -i 's,^deb \(.*\),deb \1\ndeb-src \1,g' /etc/apt/sources.list
114110 RUN apt-get update && apt-get install -y dpkg-dev devscripts
115 COPY i3/i3-${RELEASE_VERSION}.tar.bz2 /usr/src/i3-wm_${RELEASE_VERSION}.orig.tar.bz2
111 COPY i3/i3-${RELEASE_VERSION}.tar.xz /usr/src/i3-wm_${RELEASE_VERSION}.orig.tar.xz
116112 WORKDIR /usr/src/
117 RUN tar xf i3-wm_${RELEASE_VERSION}.orig.tar.bz2
113 RUN tar xf i3-wm_${RELEASE_VERSION}.orig.tar.xz
118114 WORKDIR /usr/src/i3-${RELEASE_VERSION}
119115 COPY i3/debian /usr/src/i3-${RELEASE_VERSION}/debian/
120116 RUN mkdir debian/source
158154 git add docs/${PREVIOUS_VERSION}
159155 git commit -a -m "save docs for ${PREVIOUS_VERSION}"
160156
161 cp ${TMPDIR}/i3/i3-${RELEASE_VERSION}.tar.bz2* downloads/
162 git add downloads/i3-${RELEASE_VERSION}.tar.bz2*
157 cp ${TMPDIR}/i3/i3-${RELEASE_VERSION}.tar.xz* downloads/
158 git add downloads/i3-${RELEASE_VERSION}.tar.xz*
163159 cp ${TMPDIR}/i3/RELEASE-NOTES-${RELEASE_VERSION} downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt
164160 git add downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt
165161 sed -i "s,<h2>Documentation for i3 v[^<]*</h2>,<h2>Documentation for i3 v${RELEASE_VERSION}</h2>,g" docs/index.html
166162 sed -i "s,<span style=\"margin-left: 2em; color: #c0c0c0\">[^<]*</span>,<span style=\"margin-left: 2em; color: #c0c0c0\">${RELEASE_VERSION}</span>,g" index.html
167163 sed -i "s,The current stable version is .*$,The current stable version is ${RELEASE_VERSION}.,g" downloads/index.html
168 sed -i "s,<tbody>,<tbody>\n <tr>\n <td>${RELEASE_VERSION}</td>\n <td><a href=\"/downloads/i3-${RELEASE_VERSION}.tar.bz2\">i3-${RELEASE_VERSION}.tar.bz2</a></td>\n <td>$(LC_ALL=en_US.UTF-8 ls -lh ../i3/i3-${RELEASE_VERSION}.tar.bz2 | awk -F " " {'print $5'} | sed 's/K$/ KiB/g' | sed 's/M$/ MiB/g')</td>\n <td><a href=\"/downloads/i3-${RELEASE_VERSION}.tar.bz2.asc\">signature</a></td>\n <td>$(date +'%Y-%m-%d')</td>\n <td><a href=\"/downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt\">release notes</a></td>\n </tr>\n,g" downloads/index.html
164 sed -i "s,<tbody>,<tbody>\n <tr>\n <td>${RELEASE_VERSION}</td>\n <td><a href=\"/downloads/i3-${RELEASE_VERSION}.tar.xz\">i3-${RELEASE_VERSION}.tar.xz</a></td>\n <td>$(LC_ALL=en_US.UTF-8 ls -lh ../i3/i3-${RELEASE_VERSION}.tar.xz | awk -F " " {'print $5'} | sed 's/K$/ KiB/g' | sed 's/M$/ MiB/g')</td>\n <td><a href=\"/downloads/i3-${RELEASE_VERSION}.tar.xz.asc\">signature</a></td>\n <td>$(date +'%Y-%m-%d')</td>\n <td><a href=\"/downloads/RELEASE-NOTES-${RELEASE_VERSION}.txt\">release notes</a></td>\n </tr>\n,g" downloads/index.html
169165
170166 git commit -a -m "add ${RELEASE_VERSION} release"
171167
77 *
88 */
99 #include "all.h"
10
11 #include "i3-atoms_NET_SUPPORTED.xmacro.h"
1012
1113 xcb_window_t ewmh_window;
1214
304306 void ewmh_setup_hints(void) {
305307 xcb_atom_t supported_atoms[] = {
306308 #define xmacro(atom) A_##atom,
307 #include "atoms_NET_SUPPORTED.xmacro"
309 I3_NET_SUPPORTED_ATOMS_XMACRO
308310 #undef xmacro
309311 };
310312
3030
3131 #include "sd-daemon.h"
3232
33 #include "i3-atoms_NET_SUPPORTED.xmacro.h"
34 #include "i3-atoms_rest.xmacro.h"
35
3336 /* The original value of RLIMIT_CORE when i3 was started. We need to restore
3437 * this before starting any other process, since we set RLIMIT_CORE to
3538 * RLIM_INFINITY for i3 debugging versions. */
97100
98101 /* Define all atoms as global variables */
99102 #define xmacro(atom) xcb_atom_t A_##atom;
100 #include "atoms.xmacro"
103 I3_NET_SUPPORTED_ATOMS_XMACRO
104 I3_REST_ATOMS_XMACRO
101105 #undef xmacro
102106
103107 /*
375379 char *socket_path = root_atom_contents("I3_SOCKET_PATH", NULL, 0);
376380 if (socket_path) {
377381 printf("%s\n", socket_path);
382 /* With -O2 (i.e. the buildtype=debugoptimized meson
383 * option, which we set by default), gcc 9.2.1 optimizes
384 * away socket_path at this point, resulting in a Leak
385 * Sanitizer report. An explicit free helps: */
386 free(socket_path);
378387 exit(EXIT_SUCCESS);
379388 }
380389
558567 /* Place requests for the atoms we need as soon as possible */
559568 #define xmacro(atom) \
560569 xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
561 #include "atoms.xmacro"
570 I3_NET_SUPPORTED_ATOMS_XMACRO
571 I3_REST_ATOMS_XMACRO
562572 #undef xmacro
563573
564574 root_depth = root_screen->root_depth;
604614 A_##name = reply->atom; \
605615 free(reply); \
606616 } while (0);
607 #include "atoms.xmacro"
617 I3_NET_SUPPORTED_ATOMS_XMACRO
618 I3_REST_ATOMS_XMACRO
608619 #undef xmacro
609620
610621 load_configuration(override_configpath, C_LOAD);
5050 Output *output;
5151 bool get_primary = (strcasecmp("primary", name) == 0);
5252 TAILQ_FOREACH (output, &outputs, outputs) {
53 if (require_active && !output->active) {
54 continue;
55 }
5356 if (output->primary && get_primary) {
5457 return output;
55 }
56 if (require_active && !output->active) {
57 continue;
5858 }
5959 struct output_name *output_name;
6060 SLIST_FOREACH (output_name, &output->names_head, names) {
1717 use IO::Handle;
1818
1919 # these are shipped with the testsuite
20 use lib qw(@abs_top_builddir@/testcases/lib @abs_top_srcdir@/testcases/lib @abs_top_srcdir@/AnyEvent-I3/blib/lib);
20 use lib qw(@abs_top_builddir@ @abs_top_builddir@/testcases/lib @abs_top_srcdir@/testcases/lib @abs_top_builddir@/AnyEvent-I3/blib/lib);
2121 use i3test::Util qw(slurp);
2222 use StartXServer;
2323 use StatusLine;
7777 # Check for missing executables
7878 my @binaries = qw(
7979 @abs_top_builddir@/i3
80 @abs_top_builddir@/i3bar/i3bar
81 @abs_top_builddir@/i3-config-wizard/i3-config-wizard
82 @abs_top_builddir@/i3-dump-log/i3-dump-log
83 @abs_top_builddir@/i3-input/i3-input
84 @abs_top_builddir@/i3-msg/i3-msg
85 @abs_top_builddir@/i3-nagbar/i3-nagbar
80 @abs_top_builddir@/i3bar
81 @abs_top_builddir@/i3-config-wizard
82 @abs_top_builddir@/i3-dump-log
83 @abs_top_builddir@/i3-input
84 @abs_top_builddir@/i3-msg
85 @abs_top_builddir@/i3-nagbar
8686 );
8787
8888 foreach my $binary (@binaries) {
102102 }
103103
104104 $ENV{PATH} = join(':',
105 '@abs_top_builddir@/i3-nagbar',
106 '@abs_top_builddir@/i3-msg',
107 '@abs_top_builddir@/i3-input',
108 '@abs_top_builddir@/i3-dump-log',
109 '@abs_top_builddir@/i3-config-wizard',
110 '@abs_top_builddir@/i3bar',
111105 '@abs_top_builddir@',
112106 '@abs_top_srcdir@',
113107 $ENV{PATH});
66
77 use Test::More;
88 use i3test::Util qw(get_socket_path);
9 use lib qw(@abs_top_srcdir@/AnyEvent-I3/blib/lib);
9 use lib qw(@abs_top_builddir@/AnyEvent-I3/blib/lib);
1010 use AnyEvent::I3;
1111 use ExtUtils::PkgConfig;
1212
66 use X11::XCB::Rect;
77 use X11::XCB::Window;
88 use X11::XCB qw(:all);
9 use lib qw(@abs_top_srcdir@/AnyEvent-I3/blib/lib);
9 use lib qw(@abs_top_builddir@/AnyEvent-I3/blib/lib);
1010 use AnyEvent::I3;
1111 use List::Util qw(first);
1212 use Time::HiRes qw(sleep);
3131
3232 is(int($version->{minor}), $version->{minor}, 'minor version is an integer');
3333 is(int($version->{patch}), $version->{patch}, 'patch version is an integer');
34 like($version->{human_readable}, qr/branch/, 'human readable version contains branch name');
3534
3635 done_testing;
3232 };
3333 my @binaries = qw(
3434 build/i3
35 build/i3-config-wizard/i3-config-wizard
36 build/i3-dump-log/i3-dump-log
37 build/i3-input/i3-input
38 build/i3-msg/i3-msg
39 build/i3-nagbar/i3-nagbar
40 build/i3bar/i3bar
35 build/i3-config-wizard
36 build/i3-dump-log
37 build/i3-input
38 build/i3-msg
39 build/i3-nagbar
40 build/i3bar
4141 );
4242 for my $binary (@binaries) {
4343 check_spelling(slurp($binary), $binary_spelling_exceptions, sub {
44
55 DEST=$1
66
7 mkdir -p build
87 cd build
9 ../configure
10 make echo-version > ../I3_VERSION
11 make dist-bzip2
128 # unpack dist tarball
139 mkdir -p "${DEST}"
14 tar xf *.tar.bz2 -C "${DEST}" --strip-components=1
10 tar xf meson-dist/*.tar.xz -C "${DEST}" --strip-components=1
1511 cp -r ../debian "${DEST}"
1612 sed -i '/^\s*libxcb-xrm-dev/d' deb/ubuntu-*/DIST/debian/control || true
1713 cd "${DEST}"
33
44 BASENAME=$1
55 DOCKERFILE=$2
6
7 # .dockerignore is created on demand so that release.sh and other scripts are
8 # not influenced by our travis setup.
9 echo .git > .dockerignore
106
117 docker build --pull --no-cache --rm -t=${BASENAME} -f ${DOCKERFILE} .
128 # For pull requests, travis does not add secure environment variables to the
2525
2626 # Try running the tests in parallel so that the common case (tests pass) is
2727 # quick, but fall back to running them in sequence to make debugging easier.
28 if ! make check
28 if ! ninja test
2929 then
30 ./testcases/complete-run.pl --parallel=1 || (cat latest/complete-run.log; false)
30 ./complete-run.pl --parallel=1 || (cat latest/complete-run.log; false)
3131 fi