hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
20.03k stars 852 forks source link

hyprpm failed to build plugin without XWayland support #4382

Closed WingsZeng closed 1 month ago

WingsZeng commented 9 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit 03ebbe18ed8517ee22591eac82cd54322f42cb7d (props: bump ver to 0.34.0). Date: Mon Jan 1 12:03:15 2024 Tag: v0.34.0 flags: (if any) no xwayland ```

Bug or Regression?

Bug

Description

hyprpm failed to build Plugin without XWayland support.

❯ hyprpm add https://github.com/hyprwm/hyprland-plugins -v     
✔ adding a new plugin repository from https://github.com/hyprwm/hyprland-plugins
  MAKE SURE that you trust the authors. DO NOT install random plugins without verifying the code and author.
  Are you sure? [Y/n] 

! old plugin repo build files found in temp directory, removing.                                                                                              
 → Cloning https://github.com/hyprwm/hyprland-plugins                                                                                                         
✔ cloned                                                                                                                                                      
✔ found hyprpm manifest                                                                                                                                       
✔ parsed manifest, found 5 plugins:                                                                                                                           
 → borders-plus-plus by Vaxry version                                                                                                                         
 → csgo-vulkan-fix by Vaxry version                                                                                                                           
 → hyprbars by Vaxry version                                                                                                                                  
 → hyprtrails by Vaxry version                                                                                                                                
 → hyprwinwrap by Vaxry version                                                                                                                               
 ━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  2 / 5  Verifying headers[v] version returned: Hyprland, built from branch HEAD at commit 03ebbe18ed8517ee22591eac82cd54322f42cb7d  (props: bump ver to 0.34.0).
Date: Mon Jan 1 12:03:15 2024
Tag: v0.34.0

flags: (if any)
no xwayland

[v] parsed commit 03ebbe18ed8517ee22591eac82cd54322f42cb7d at branch HEAD
✔ Hyprland headers OK                                                                                                                                         
 → Building borders-plus-plus                                                                                                                                 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╍━━━━━━━━━━━━━━━━━━━  3 / 5  Building plugin(s)                                                                                
✖ Plugin borders-plus-plus failed to build.
[v] shell returned: make: Entering directory '/tmp/hyprpm/new/borders-plus-plus'
x86_64-pc-linux-gnu-g++ -shared -fPIC --no-gnu-unique main.cpp borderDeco.cpp -o borders-plus-plus.so -g `pkg-config --cflags pixman-1 libdrm hyprland` -std=c++2b -O2
In file included from /usr/include/hyprland/src/defines.hpp:1,
                 from /usr/include/hyprland/src/Compositor.hpp:7,
                 from main.cpp:6:
/usr/include/hyprland/src/includes.hpp:119:10: fatal error: wlr/xwayland.h: No such file or directory
  119 | #include <wlr/xwayland.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/hyprland/src/defines.hpp:1,
                 from /usr/include/hyprland/src/render/decorations/IHyprWindowDecoration.hpp:4,
                 from borderDeco.hpp:5,
                 from borderDeco.cpp:1:
/usr/include/hyprland/src/includes.hpp:119:10: fatal error: wlr/xwayland.h: No such file or directory
  119 | #include <wlr/xwayland.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:2: all] Error 1
make: Leaving directory '/tmp/hyprpm/new/borders-plus-plus'

I found that wlr/xwayland.h will not be installed if building wlroots without xwayland feature. https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/include/meson.build?ref_type=heads#L14-L16

How to reproduce

  1. Build hyprland with NO_XWAYLAND flag.
  2. Run hyprpm add https://github.com/hyprwm/hyprland-plugins

Crash reports, logs, images, videos

No response

vaxerski commented 9 months ago

what if you find the installed headers and add #define NO_XWAYLAND at the top of includes.hpp?

WingsZeng commented 9 months ago

what if you find the installed headers and add #define NO_XWAYLAND at the top of includes.hpp?

It works! Also works by manually building plugins with -DNO_XWAYLAND. Maybe hyprpm should consider automatically detecting whether hyprland has the NO_XWAYLAND flag and adjust the plugin build process accordingly?

vaxerski commented 9 months ago

probably

izmyname commented 1 month ago

https://github.com/hyprwm/Hyprland/pull/7538 ?

vaxerski commented 1 month ago

no but this can be closed