lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
943 stars 37 forks source link

Allow build without X11/XCB backend #31

Closed jirutka closed 2 years ago

jirutka commented 2 years ago

This PR replaces build option wayland with multi-choice option backends which allows to choose which backends to build:

I’ve tested it on Alpine Linux – the following diff shows the difference between tracked dynamic dependencies between rofi built with both XCB and Wayland backends (the current state) and with Wayland backend only:

--- wayland
+++ xcb,wayland
 so:libgobject-2.0.so.0
 so:libpango-1.0.so.0
 so:libpangocairo-1.0.so.0
-so:libstartup-notification-1.so.0
 so:libwayland-client.so.0
 so:libwayland-cursor.so.0
-so:libxcb-cursor.so.0
-so:libxcb-ewmh.so.2
-so:libxcb-icccm.so.4
-so:libxcb-randr.so.0
-so:libxcb-util.so.1
-so:libxcb-xinerama.so.0
-so:libxcb-xkb.so.1
-so:libxcb.so.1
-so:libxkbcommon-x11.so.0
 so:libxkbcommon.so.0

The difference in the rofi binary size: 350 kiB vs 408 kiB

NOTE: Alpine Linux package rofi-wayland is built with the patches from this PR (since 1.7.0-r1).

Resolves #29.

lbonn commented 2 years ago

I've merged it manually with the last three commits squashed, thanks again!

ram02z commented 2 years ago

Hey @jirutka,

I used your APKBUILD as a reference for my rofi-wayland template for voidlinux. It compiles fine when using -Dxcb=disabled, however, I cannot run rofi without compiling rofi-wayland with xcb-util-cursor-devel as a dependancy.

Error message:

rofi: error while loading shared libraries: libxcb-cursor.so.0: cannot open shared object file: No such file or directory

EDIT: actually this might be a local issue, I will look into this further.