Всем доброго!
Последние пару дней бьюсь со сборкой dwl на opensuse. С Leap 15.5 вчера стало понятно, что «как есть» его не собрать, т.к. в leap старая версия wlroots. С TW дела получше, собирается и запускается, но не без костылей:
$:~/.local/src> git clone https://codeberg.org/dwl/dwl.git
Cloning into 'dwl'...
remote: Enumerating objects: 3715, done.
remote: Counting objects: 100% (3715/3715), done.
remote: Compressing objects: 100% (1354/1354), done.
remote: Total 3715 (delta 2436), reused 3617 (delta 2351), pack-reused 0
Receiving objects: 100% (3715/3715), 1.21 MiB | 2.69 MiB/s, done.
Resolving deltas: 100% (2436/2436), done.
$:~/.local/src/dwl> make
cp config.def.h config.h
`pkg-config --variable=wayland_scanner wayland-scanner` server-header \
`pkg-config --variable=pkgdatadir wayland-protocols`/staging/cursor-shape/cursor-shape-v1.xml cursor-shape-v1-protocol.h
`pkg-config --variable=wayland_scanner wayland-scanner` server-header \
`pkg-config --variable=pkgdatadir wayland-protocols`/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml pointer-constraints-unstable-v1-protocol.h
`pkg-config --variable=wayland_scanner wayland-scanner` server-header \
protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
`pkg-config --variable=wayland_scanner wayland-scanner` server-header \
`pkg-config --variable=pkgdatadir wayland-protocols`/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
c99 `pkg-config --cflags wlroots wayland-server xkbcommon libinput ` -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"`git describe --tags --dirty 2>/dev/null || echo 0.5`\" -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion -O1 -c dwl.c
/bin/sh: line 1: c99: command not found
make: *** [Makefile:69: dwl.o] Error 127
это я победил с помощью данного треда: https://forums.freebsd.org/threads/building-dwl-fails-with-c99-illegal-option-p.92040/
$:~/.local/src/dwl> sed -i'' -e s/_POSIX_C_SOURCE=200809L/_XOPEN_SOURCE=700/ Makefile
$:~/.local/src/dwl> gmake CC=cc CFLAGS+='-std=c11' XWAYLAND="-DXWAYLAND" XLIBS="xcb xcb-icccm"
cc `pkg-config --cflags wlroots wayland-server xkbcommon libinput xcb xcb-icccm` -I. -DWLR_USE_UNSTABLE -D_XOPEN_SOURCE=700 -DVERSION=\"`git describe --tags --dirty 2>/dev/null || echo 0.5`\" -DXWAYLAND -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion -std=c11 -c dwl.c
cc `pkg-config --cflags wlroots wayland-server xkbcommon libinput xcb xcb-icccm` -I. -DWLR_USE_UNSTABLE -D_XOPEN_SOURCE=700 -DVERSION=\"`git describe --tags --dirty 2>/dev/null || echo 0.5`\" -DXWAYLAND -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion -std=c11 -c util.c
cc dwl.o util.o `pkg-config --libs wlroots wayland-server xkbcommon libinput xcb xcb-icccm` `pkg-config --cflags wlroots wayland-server xkbcommon libinput xcb xcb-icccm` -I. -DWLR_USE_UNSTABLE -D_XOPEN_SOURCE=700 -DVERSION=\"`git describe --tags --dirty 2>/dev/null || echo 0.5`\" -DXWAYLAND -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion -std=c11 -o dwl\
после чего dwl благополучно запускается. Далее проблемы возникают с патчем bar:
$:~/.local/src/dwl> git apply bar.patch
bar.patch:800: trailing whitespace.
warning: 1 line adds whitespace errors.
$:~/.local/src/dwl> gmake CC=cc CFLAGS+='-std=c11' XWAYLAND="-DXWAYLAND" XLIBS="xcb xcb-icccm"
cc `pkg-config --cflags wlroots wayland-server xkbcommon libinput pixman-1 fcft xcb xcb-icccm` -I. -DWLR_USE_UNSTABLE -D_XOPEN_SOURCE=700 -DVERSION=\"`git describe --tags --dirty 2>/dev/null || echo 0.5`\" -DXWAYLAND -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Wfloat-conversion -std=c11 -c dwl.c
In file included from dwl.c:461:
config.h:168:31: warning: initialization of ‘unsigned int’ from ‘void (*)(const Arg *)’ makes integer from pointer without a cast [-Wint-conversion]
168 | { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
| ^~~~~~~~~~
config.h:168:31: note: (near initialization for ‘buttons[0].button’)
config.h:168:31: error: initializer element is not computable at load time
config.h:168:31: note: (near initialization for ‘buttons[0].button’)
config.h:168:9: warning: braces around scalar initializer
168 | { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
| ^
config.h:168:9: note: (near initialization for ‘buttons[0].func’)
config.h:168:48: error: field name not in record or union initializer
168 | { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
| ^
config.h:168:48: note: (near initialization for ‘buttons[0].func’)
config.h:168:54: warning: initialization of ‘void (*)(const Arg *)’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
168 | { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
| ^~~~~~~
config.h:168:54: note: (near initialization for ‘buttons[0].func’)
config.h:168:9: warning: missing initializer for field ‘arg’ of ‘Button’ [-Wmissing-field-initializers]
168 | { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} },
| ^
dwl.c:109:19: note: ‘arg’ declared here
109 | const Arg arg;
| ^~~
config.h:169:31: warning: initialization of ‘unsigned int’ from ‘void (*)(const Arg *)’ makes integer from pointer without a cast [-Wint-conversion]
169 | { MODKEY, BTN_MIDDLE, togglefloating, {0} },
| ^~~~~~~~~~~~~~
config.h:169:31: note: (near initialization for ‘buttons[1].button’)
config.h:169:31: error: initializer element is not computable at load time
config.h:169:31: note: (near initialization for ‘buttons[1].button’)
config.h:169:9: warning: braces around scalar initializer
169 | { MODKEY, BTN_MIDDLE, togglefloating, {0} },
| ^
config.h:169:9: note: (near initialization for ‘buttons[1].func’)
config.h:169:9: warning: missing initializer for field ‘arg’ of ‘Button’ [-Wmissing-field-initializers]
dwl.c:109:19: note: ‘arg’ declared here
109 | const Arg arg;
| ^~~
config.h:170:31: warning: initialization of ‘unsigned int’ from ‘void (*)(const Arg *)’ makes integer from pointer without a cast [-Wint-conversion]
170 | { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
| ^~~~~~~~~~
config.h:170:31: note: (near initialization for ‘buttons[2].button’)
config.h:170:31: error: initializer element is not computable at load time
config.h:170:31: note: (near initialization for ‘buttons[2].button’)
config.h:170:9: warning: braces around scalar initializer
170 | { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
| ^
config.h:170:9: note: (near initialization for ‘buttons[2].func’)
config.h:170:48: error: field name not in record or union initializer
170 | { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
| ^
config.h:170:48: note: (near initialization for ‘buttons[2].func’)
config.h:170:54: warning: initialization of ‘void (*)(const Arg *)’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
170 | { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
| ^~~~~~~~~
config.h:170:54: note: (near initialization for ‘buttons[2].func’)
config.h:170:9: warning: missing initializer for field ‘arg’ of ‘Button’ [-Wmissing-field-initializers]
170 | { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
| ^
dwl.c:109:19: note: ‘arg’ declared here
109 | const Arg arg;
| ^~~
dwl.c: In function ‘arrangelayers’:
dwl.c:575:34: error: ‘topbar’ undeclared (first use in this function)
575 | usable_area.y += topbar ? m->b.height : 0;
| ^~~~~~
dwl.c:575:34: note: each undeclared identifier is reported only once for each function it appears in
dwl.c: In function ‘buttonpress’:
dwl.c:678:36: error: ‘tags’ undeclared (first use in this function); did you mean ‘tag’?
678 | x += TEXTW(tags[i]);
| ^~~~
dwl.c:85:53: note: in definition of macro ‘TEXTW’
85 | #define TEXTW(text) (draw_text(NULL, 0, 0, 0, 0, 0, text, NULL) + lrpad)
| ^~~~
dwl.c: In function ‘createmon’:
dwl.c:1022:22: error: ‘showbar’ undeclared (first use in this function)
1022 | m->showbar = showbar;
| ^~~~~~~
dwl.c: In function ‘drawbar’:
dwl.c:1459:71: error: ‘normbarbg’ undeclared (first use in this function)
1459 | draw_rect(pix, 0, 0, mon->b.width, mon->b.height, 1, &normbarbg);
| ^~~~~~~~~
dwl.c:1461:84: error: ‘normbarfg’ undeclared (first use in this function)
1461 | draw_text(pix, mon->b.width - tw, 0, tw, mon->b.height, 0, stext, &normbarfg);
| ^~~~~~~~~
dwl.c:1473:32: error: ‘tags’ undeclared (first use in this function); did you mean ‘tag’?
1473 | for (i = 0; i < LENGTH(tags); i++) {
| ^~~~
dwl.c:80:41: note: in definition of macro ‘LENGTH’
80 | #define LENGTH(X) (sizeof X / sizeof X[0])
| ^
dwl.c:1478:41: error: ‘selbarfg’ undeclared (first use in this function)
1478 | urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
| ^~~~~~~~
dwl.c:1478:60: error: ‘selbarbg’ undeclared (first use in this function)
1478 | urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
| ^~~~~~~~
dwl.c:1505:29: error: ‘topbar’ undeclared (first use in this function)
1505 | mon->m.y + (topbar ? 0 : mon->m.height - mon->b.height));
| ^~~~~~
dwl.c: In function ‘setup’:
dwl.c:2745:44: error: ‘fonts’ undeclared (first use in this function); did you mean ‘font’?
2745 | if (!(font = fcft_from_name(LENGTH(fonts), fonts, fontattrs)))
| ^~~~~
dwl.c:80:41: note: in definition of macro ‘LENGTH’
80 | #define LENGTH(X) (sizeof X / sizeof X[0])
| ^
dwl.c:2745:59: error: ‘fontattrs’ undeclared (first use in this function)
2745 | if (!(font = fcft_from_name(LENGTH(fonts), fonts, fontattrs)))
| ^~~~~~~~~
dwl.c: In function ‘tag’:
dwl.c:82:48: error: ‘tags’ undeclared (first use in this function); did you mean ‘tag’?
82 | #define TAGMASK ((1u << LENGTH(tags)) - 1)
| ^~~~
dwl.c:80:41: note: in definition of macro ‘LENGTH’
80 | #define LENGTH(X) (sizeof X / sizeof X[0])
| ^
dwl.c:2824:32: note: in expansion of macro ‘TAGMASK’
2824 | if (!sel || (arg->ui & TAGMASK) == 0)
| ^~~~~~~
dwl.c: In function ‘toggletag’:
dwl.c:82:48: error: ‘tags’ undeclared (first use in this function); did you mean ‘tag’?
82 | #define TAGMASK ((1u << LENGTH(tags)) - 1)
| ^~~~
dwl.c:80:41: note: in definition of macro ‘LENGTH’
80 | #define LENGTH(X) (sizeof X / sizeof X[0])
| ^
dwl.c:2905:56: note: in expansion of macro ‘TAGMASK’
2905 | if (!sel || !(newtags = sel->tags ^ (arg->ui & TAGMASK)))
| ^~~~~~~
dwl.c: In function ‘toggleview’:
dwl.c:82:48: error: ‘tags’ undeclared (first use in this function); did you mean ‘tag’?
82 | #define TAGMASK ((1u << LENGTH(tags)) - 1)
| ^~~~
dwl.c:80:41: note: in definition of macro ‘LENGTH’
80 | #define LENGTH(X) (sizeof X / sizeof X[0])
| ^
dwl.c:2918:81: note: in expansion of macro ‘TAGMASK’
2918 | if (!(newtagset = selmon ? selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK) : 0))
| ^~~~~~~
dwl.c: In function ‘view’:
dwl.c:82:48: error: ‘tags’ undeclared (first use in this function); did you mean ‘tag’?
82 | #define TAGMASK ((1u << LENGTH(tags)) - 1)
| ^~~~
dwl.c:80:41: note: in definition of macro ‘LENGTH’
80 | #define LENGTH(X) (sizeof X / sizeof X[0])
| ^
dwl.c:3121:35: note: in expansion of macro ‘TAGMASK’
3121 | if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
| ^~~~~~~
dwl.c: At top level:
dwl.c:2876:1: warning: ‘togglebar’ defined but not used [-Wunused-function]
2876 | togglebar(const Arg *arg)
| ^~~~~~~~~
gmake: *** [Makefile:69: dwl.o] Error 1
Я не специалист в C, но мне кажется, что проблема с флагами компилятора. ЕМНИП на void (или debian) сам dwl собирался без каких либо проблем, далее не испытывал. Возможно, самая первая ошибка при сборке dwl (/bin/sh: line 1: c99: command not found) должна решаться иначе? Или с dwl пока все плохо?