hyprwm / hyprpaper

Hyprpaper is a blazing fast wayland wallpaper utility with IPC controls.
https://wiki.hyprland.org/Hypr-Ecosystem/hyprpaper/
BSD 3-Clause "New" or "Revised" License
758 stars 54 forks source link

hyprpaper not building on NixOS since 36e83af #199

Closed Ysujy closed 1 week ago

Ysujy commented 1 week ago

Using the hyprpaper home-manager package.

Trying to rebuild my system after the aforementioned commit results in the following error:

error: builder for '/nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv' failed with exit code 2;
       last 10 log lines:
       > [ 13%] Generating /build/source/protocols/fractional-scale-v1.cpp, /build/source/protocols/fractional-scale-v1.hpp
       > [ 17%] Generating /build/source/protocols/linux-dmabuf-v1.cpp, /build/source/protocols/linux-dmabuf-v1.hpp
       > [ 20%] Generating /build/source/protocols/wayland.cpp, /build/source/protocols/wayland.hpp
       > [ 24%] Generating /build/source/protocols/cursor-shape-v1.cpp, /build/source/protocols/cursor-shape-v1.hpp
       > [ 27%] Generating /build/source/protocols/wlr-layer-shell-unstable-v1.cpp, /build/source/protocols/wlr-layer-shell-unstable-v1.hpp
       > Couldn't load proto
       > make[2]: *** [CMakeFiles/hyprpaper.dir/build.make:74: /build/source/protocols/wayland.cpp] Error 1
       > make[2]: *** Waiting for unfinished jobs....
       > make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/hyprpaper.dir/all] Error 2
       > make: *** [Makefile:156: all] Error 2
       For full logs, run 'nix log /nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv'.
error: 1 dependencies of derivation '/nix/store/hyjhrpg6scmsg2j8ww98f7j9ppj2lnah-hyprpaper.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/b8iaxddyx2bhmc3bpzx6qdj9rn87v858-system-path.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-hyprland-0.42.0+date=2024-09-01_6934e7a.drv-1/build/source': Directory not empty
error: 1 dependencies of derivation '/nix/store/cgxksvdrv7sfjchkjb54zinnr6r0ggwn-nixos-system-nixos-24.11.20240831.12228ff.drv' failed to build

nix log /nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv':

warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/5x6fxsdcnkik3djpvz10baaxghbw6r8k-hyprpaper-0.7.1.drv^*'
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/glq45m6948xs0n8k7gbm60qd6grircri-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
substituteStream() in derivation hyprpaper-0.7.1: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'src/main.cpp')
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/doc/hyprpaper -DCMAKE_INSTALL_INFODIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/ranlib -DCMAKE_AR=/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/45h2lqfr241whaw8sdq6p9m3yhprdv4w-hyprpaper-0.7.1
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring hyprpaper!
bash: line 1: git: command not found
bash: line 1: git: command not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found PkgConfig: /nix/store/fcmc82gp5qc0s8qvcw4c0w46c67zd295-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2")
-- Checking for modules 'wayland-client;wayland-protocols;cairo;pango;pangocairo;libjpeg;libwebp;hyprlang>=0.2.0;hyprutils>=0.2.0;hyprwayland-scanner>=0.4.0'
--   Found wayland-client, version 1.23.0
--   Found wayland-protocols, version 1.36
--   Found cairo, version 1.18.0
--   Found pango, version 1.52.2
--   Found pangocairo, version 1.52.2
--   Found libjpeg, version 3.0.3
--   Found libwebp, version 1.4.0
--   Found hyprlang, version 0.5.2
--   Found hyprutils, version 0.2.1
--   Found hyprwayland-scanner, version 0.4.0
-- Found wayland-protocols at //nix/store/sm9mxbw5lanjmabjgd53yps0b9j3lrc9-wayland-protocols-1.36/share/wayland-protocols
-- Found wayland-client at //nix/store/0xxjgp8nqgdwfnqbvavp1g61n8vbvyh1-wayland-1.23.0/share/wayland
-- Configuring done (1.2s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTING
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_DOCDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_INFODIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_LOCALEDIR
    CMAKE_INSTALL_MANDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR
    CMAKE_POLICY_DEFAULT_CMP0025

-- Build files have been written to: /build/source/build
cmake: enabled parallel building
cmake: enabled parallel installing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: -j16 SHELL=/nix/store/vpvy79k1qq02p1vyqjk6nb89gwhxqvyb-bash-5.2p32/bin/bash
[ 13%] Generating /build/source/protocols/tablet-v2.cpp, /build/source/protocols/tablet-v2.hpp
[ 13%] Generating /build/source/protocols/xdg-shell.cpp, /build/source/protocols/xdg-shell.hpp
[ 13%] Generating /build/source/protocols/viewporter.cpp, /build/source/protocols/viewporter.hpp
[ 13%] Generating /build/source/protocols/fractional-scale-v1.cpp, /build/source/protocols/fractional-scale-v1.hpp
[ 17%] Generating /build/source/protocols/linux-dmabuf-v1.cpp, /build/source/protocols/linux-dmabuf-v1.hpp
[ 20%] Generating /build/source/protocols/wayland.cpp, /build/source/protocols/wayland.hpp
[ 24%] Generating /build/source/protocols/cursor-shape-v1.cpp, /build/source/protocols/cursor-shape-v1.hpp
[ 27%] Generating /build/source/protocols/wlr-layer-shell-unstable-v1.cpp, /build/source/protocols/wlr-layer-shell-unstable-v1.hpp
Couldn't load proto
make[2]: *** [CMakeFiles/hyprpaper.dir/build.make:74: /build/source/protocols/wayland.cpp] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/hyprpaper.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Thank you in advance!

@fufexan

fufexan commented 1 week ago

This error is about the Nixpkgs hyprpaper package. A fix was submitted, and will land in nixos-unstable in a few days at most. This flake already had the fix applied, and you can use it in the meantime.

Ysujy commented 1 week ago

This flake already had the fix applied, and you can use it in the meantime.

I thought the hyprpaper flake home-manager module had been removed? I believe that the rebuild didn't complete, saying that it has been deprecated when I tried it some time ago.

fufexan commented 1 week ago

Yes, but you can use the flake package with the upstream Home Manager hyprpaper module.

deng232 commented 1 week ago

Yes, but you can use the flake package with the upstream Home Manager hyprpaper module.

"use the flake package with the upstream Home Manager hyprpaper module." can you tell me more detail on how to do that? I tried

  hyprpapr_tmpfix = builtins.fetchGit {
    url = "https://github.com/hyprwm/hyprpaper.git";
    rev ="1c18ad65032adb891b341292a1edf9e13adf4751";
  };

    services.hyprpaper = {
    enable = true;
    #package = pkgs.hyprpaper.overrideAttrs {src = hyprpapr_tmpfix;};
    settings = {
      splash = false;
      splash_offset = 2.0;
      preload = [ "${test}" ];
      wallpaper = [",${test}"];
    };

but this doesn't seem like a correct way.

ppenguin commented 1 week ago

but this doesn't seem like a correct way.

as a quick workaround you can just add the git to your flake inputs and put this in your overlay:

      hyprpaper =
        if (lib.hasAttr "hyprpaper" inputs)
        then inputs.hyprpaper.packages.${prev.system}.hyprpaper
        else prev.hyprpaper;

After fixed just comment out the input (or delete all this). You can use this method generally for stuff that has a flake and for which you sometimes want to switch between nixpkgs and git versions... (better not use for deep dependencies though, it will cause too many rebuilds)

deng232 commented 1 week ago

but this doesn't seem like a correct way.

as a quick workaround you can just add the git to your flake inputs and put this in your overlay:

      hyprpaper =
        if (lib.hasAttr "hyprpaper" inputs)
        then inputs.hyprpaper.packages.${prev.system}.hyprpaper
        else prev.hyprpaper;

After fixed just comment out the input (or delete all this). You can use this method generally for stuff that has a flake and for which you sometimes want to switch between nixpkgs and git versions... (better not use for deep dependencies though, it will cause too many rebuilds)

I added the hyprpaper.url and applied the overlay, but I got another build failure though.

error: builder for '/nix/store/79j2d16flwr56pkfrw8x2907j3q2pld1-xdg-desktop-portal-hyprland-1.3.3.drv' failed with exit code 1;
       last 10 log lines:
       > -- Generating done (0.0s)
       > CMake Warning:
       >   Manually-specified variables were not used by the project:
       >
       >     BUILD_TESTING
       >     CMAKE_EXPORT_NO_PACKAGE_REGISTRY
       >     CMAKE_POLICY_DEFAULT_CMP0025
       >
       > 
       > CMake Generate step failed.  Build files cannot be regenerated correctly.
       For full logs, run 'nix log /nix/store/79j2d16flwr56pkfrw8x2907j3q2pld1-xdg-desktop-portal-hyprland-1.3.3.drv'.
error: 1 dependencies of derivation '/nix/store/510hqm7zahik6y4j50anj3nccyy3cvb5-dbus-1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/34w634df9sj5av7ahy4zby58bdh0kc0v-system-path.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-nvidia-x11-560.35.03-6.6.48.drv-15/build/NVIDIA-Linux-x86_64-560.35.03': Directory not empty
error: 1 dependencies of derivation '/nix/store/z74krdgqlmra9sx0gkxhzacpld7dima6-nixos-system-nixos-24.11.20240831.12228ff.drv' failed to build
ppenguin commented 1 week ago

I added the hyprpaper.url and applied the overlay, but I got another build failure though.

Ah yes, it seems like another regression (I got it on yesterday's nixpkgs too); just use the same overlay method for hyprland and the portal (take the portal from the hyrpland input too)

Ysujy commented 1 week ago

The fix was merged into unstable. Should work without any workarounds.