hyprwm / hyprland-plugins

Official plugins for Hyprland
BSD 3-Clause "New" or "Revised" License
573 stars 60 forks source link

Compilation fails on NixOS #158

Closed John-Toohey closed 7 months ago

John-Toohey commented 7 months ago

When compiling any of the plugins on NixOS from the flake, I get the following compilation error (shown here for hyprbars):

@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/vzx1ifxm0xr343j4b9ichls0darhmb1r-hyprbars
source root is hyprbars
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
mesonConfigurePhase flags: --prefix=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1 --libdir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/lib --libexecdir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/libexec --bindir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/bin --sbindir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/sbin --includedir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/include --mandir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/share/man --infodir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/share/info --localedir=/nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain
The Meson build system
Version: 1.3.2
Source dir: /build/hyprbars
Build dir: /build/hyprbars/build
Build type: native build
Project name: hyprbars
Project version: 0.1
C++ compiler for the host machine: g++ (gcc 13.2.0 "g++ (GCC) 13.2.0")
C++ linker for the host machine: g++ ld.bfd 2.41
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C++ supports arguments -std=c++23: YES 
meson.build:8: WARNING: Consider using the built-in option for language standard version instead of using "-std=c++23".
Found pkg-config: YES (/nix/store/a3752l19hc76dmzh1wgrxbsxh6lfx67z-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
Run-time dependency hyprland found: YES 0.37.1
Dependency hyprland found: YES 0.37.1 (cached)
Run-time dependency pixman-1 found: YES 0.43.2
Run-time dependency libdrm found: YES 2.4.120
Run-time dependency pangocairo found: YES 1.51.0
Run-time dependency libinput found: YES 1.25.0
Run-time dependency libudev found: YES 255
Run-time dependency wayland-server found: YES 1.22.0
Run-time dependency xkbcommon found: YES 1.5.0
Build targets in project: 1

hyprbars 0.1

  User defined options
    auto_features: enabled
    bindir       : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/bin
    buildtype    : plain
    includedir   : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/include
    infodir      : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/share/info
    libdir       : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/lib
    libexecdir   : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/libexec
    localedir    : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/share/locale
    mandir       : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/share/man
    prefix       : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1
    sbindir      : /nix/store/01dwaw9wq9xl12n3y11gsiiv0n983acs-hyprbars-0.1/sbin
    wrap_mode    : nodownload

Found ninja-1.11.1 at /nix/store/d6bvhfhg3aw2lj0nyb08y0ahlj5md6p8-ninja-1.11.1/bin/ninja
mesonConfigurePhase: enabled\ parallel\ building
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
build flags: -j4
[1/3] Compiling C++ object libhyprbars.so.p/main.cpp.o
FAILED: libhyprbars.so.p/main.cpp.o 
g++ -Ilibhyprbars.so.p -I. -I.. -I/nix/store/rcg71x7slmv7g870g9hdzk4r5rdcpq7h-hyprland-0.37.1+date=2024-03-16_c5e28eb-dev/include -I/nix/store/rcg71x7slmv7g870g9hdzk4r5rdcpq7h-hyprland-0.37.1+date=2024-03-16_c5e28eb-dev/include/hyprland/protocols -I/nix/store/rcg71x7slmv7g870g9hdzk4r5rdcpq7h-hyprland-0.37.1+date=2024-03-16_c5e28eb-dev/include/hyprland/wlroots -I/nix/store/w03ab2dds66rq9avc6hy573xy4b9kify-pixman-0.43.2/include/pixman-1 -I/nix/store/gqs8w1zm07z1nzwsikc31qkc854556bg-libdrm-2.4.120-dev/include -I/nix/store/gqs8w1zm07z1nzwsikc31qkc854556bg-libdrm-2.4.120-dev/include/libdrm -I/nix/store/f5c1vn84b2sp05bxxnglqly6604dzlxv-cairo-1.18.0-dev/include/cairo -I/nix/store/f7aic8nbqyqfyy99hybycb8rd9b6ri0l-freetype-2.13.2-dev/include/freetype2 -I/nix/store/f7aic8nbqyqfyy99hybycb8rd9b6ri0l-freetype-2.13.2-dev/include -I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include -I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0 -I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include -I/nix/store/vwj6xmaiqi5mg4mj354xl2s46cj50mpg-pango-1.51.0-dev/include/pango-1.0 -I/nix/store/in98whpckwjklxnkr2ymg6c13nskxnz5-harfbuzz-8.3.0-dev/include/harfbuzz -I/nix/store/s6wrx2d9k72n8knhs4m3s819ahqhkd17-libinput-1.25.0-dev/include -I/nix/store/86sjcn4m8nza5ym4vawnzrax9aci9pcr-systemd-minimal-libs-255.2-dev/include -I/nix/store/qljvpa4lhj2qsnfsdwbai99lqjs81bqs-wayland-1.22.0-dev/include -I/nix/store/hgsn3aghb3dj7jwxmvlx69hvd49mkya3-libxkbcommon-1.5.0-dev/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wno-narrowing -std=c++23 -fPIC -MD -MQ libhyprbars.so.p/main.cpp.o -MF libhyprbars.so.p/main.cpp.o.d -o libhyprbars.so.p/main.cpp.o -c ../main.cpp
../main.cpp:7:10: fatal error: hyprland/src/desktop/Window.hpp: No such file or directory
    7 | #include <hyprland/src/desktop/Window.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[2/3] Compiling C++ object libhyprbars.so.p/barDeco.cpp.o
FAILED: libhyprbars.so.p/barDeco.cpp.o 
g++ -Ilibhyprbars.so.p -I. -I.. -I/nix/store/rcg71x7slmv7g870g9hdzk4r5rdcpq7h-hyprland-0.37.1+date=2024-03-16_c5e28eb-dev/include -I/nix/store/rcg71x7slmv7g870g9hdzk4r5rdcpq7h-hyprland-0.37.1+date=2024-03-16_c5e28eb-dev/include/hyprland/protocols -I/nix/store/rcg71x7slmv7g870g9hdzk4r5rdcpq7h-hyprland-0.37.1+date=2024-03-16_c5e28eb-dev/include/hyprland/wlroots -I/nix/store/w03ab2dds66rq9avc6hy573xy4b9kify-pixman-0.43.2/include/pixman-1 -I/nix/store/gqs8w1zm07z1nzwsikc31qkc854556bg-libdrm-2.4.120-dev/include -I/nix/store/gqs8w1zm07z1nzwsikc31qkc854556bg-libdrm-2.4.120-dev/include/libdrm -I/nix/store/f5c1vn84b2sp05bxxnglqly6604dzlxv-cairo-1.18.0-dev/include/cairo -I/nix/store/f7aic8nbqyqfyy99hybycb8rd9b6ri0l-freetype-2.13.2-dev/include/freetype2 -I/nix/store/f7aic8nbqyqfyy99hybycb8rd9b6ri0l-freetype-2.13.2-dev/include -I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include -I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0 -I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include -I/nix/store/vwj6xmaiqi5mg4mj354xl2s46cj50mpg-pango-1.51.0-dev/include/pango-1.0 -I/nix/store/in98whpckwjklxnkr2ymg6c13nskxnz5-harfbuzz-8.3.0-dev/include/harfbuzz -I/nix/store/s6wrx2d9k72n8knhs4m3s819ahqhkd17-libinput-1.25.0-dev/include -I/nix/store/86sjcn4m8nza5ym4vawnzrax9aci9pcr-systemd-minimal-libs-255.2-dev/include -I/nix/store/qljvpa4lhj2qsnfsdwbai99lqjs81bqs-wayland-1.22.0-dev/include -I/nix/store/hgsn3aghb3dj7jwxmvlx69hvd49mkya3-libxkbcommon-1.5.0-dev/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wno-narrowing -std=c++23 -fPIC -MD -MQ libhyprbars.so.p/barDeco.cpp.o -MF libhyprbars.so.p/barDeco.cpp.o.d -o libhyprbars.so.p/barDeco.cpp.o -c ../barDeco.cpp
../barDeco.cpp:4:10: fatal error: hyprland/src/desktop/Window.hpp: No such file or directory
    4 | #include <hyprland/src/desktop/Window.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
fufexan commented 7 months ago

Have you followed https://github.com/hyprwm/hyprland-plugins?tab=readme-ov-file#nix?

nix build github:hyprwm/hyprland-plugins#<plugin>

Won't work, because the lockfile has an old version of Hyprland pinned.

What you should do instead, if you want to build directly from the nix CLI, is

nix build github:hyprwm/hyprland-plugins#<plugin> --override-input hyprland github:hyprwm/hyprland
John-Toohey commented 7 months ago

Indeed it was an issue with version mismatch. Thank you for your help.