Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build on NixOS after libinput overlay removal #73

Open
sjcobb2022 opened this issue Sep 1, 2024 · 9 comments
Open

Fail to build on NixOS after libinput overlay removal #73

sjcobb2022 opened this issue Sep 1, 2024 · 9 comments

Comments

@sjcobb2022
Copy link
Contributor

After cff0019

Aquamarine no longer builds for me on nixos.

Here is the error:

@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/79ixzxfc4c0ng5xf53wx8iyajk3lcdxl-hiqq0j5lq9wddwhyxii4jwxyhsk96f6z-source
source root is hiqq0j5lq9wddwhyxii4jwxyhsk96f6z-source
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running 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=RelWithDebInfo -DBUILD_>
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/43m1ckc0kivkq37xbm3l7gva8k3plwyf-gcc-wrapper-13.2.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/43m1ckc0kivkq37xbm3l7gva8k3plwyf-gcc-wrapper-13.2.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /nix/store/brnclrxnf277km61a4ksmqcwz5idrz6n-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2")
-- Found OpenGL: /nix/store/kswiznzih5sj5qy99nv18r3h4hhs6cl4-libGL-1.7.0/lib/libOpenGL.so  found components: GLES2
-- Checking for modules 'libseat>=0.8.0;libinput>=1.26.0;wayland-client;wayland-protocols;hyprutils>=0.1.5;pixman-1;libdrm;gbm;libudev;libdisplay-info;hwdata'
--   Requested 'libinput >= 1.26.0' but version of Libinput is 1.25.0
CMake Error at /nix/store/28s979fhz8d6h1rny3n5zh1ybmby6kjz-cmake-3.29.2/share/cmake-3.29/Modules/FindPkgConfig.cmake:634 (message):
  The following required packages were not found:

   - libinput>=1.26.0

Call Stack (most recent call first):
  /nix/store/28s979fhz8d6h1rny3n5zh1ybmby6kjz-cmake-3.29.2/share/cmake-3.29/Modules/FindPkgConfig.cmake:862 (_pkg_check_modules_internal)
  CMakeLists.txt:24 (pkg_check_modules)

I guess still needs the overlay? @fufexan

@fufexan
Copy link
Member

fufexan commented Sep 1, 2024

Are you overriding the nixpkgs input by any chance?

@sjcobb2022
Copy link
Contributor Author

Are you overriding the nixpkgs input by any chance?

Yes, because it fails to build 0.42 without overriding. hyprwm/Hyprland#6967 (comment)

@fufexan
Copy link
Member

fufexan commented Sep 1, 2024

Makes sense then. I wanted to backport libinput 1.26 to NixOS 24.05 but some committers deemed it a breaking change (with more recursive breakages). I think the best option for you currently is to manually add the overlay.

I've removed it due to it causing mass rebuilds for people using hyprland through the overlay.

@sjcobb2022
Copy link
Contributor Author

Makes sense then. I wanted to backport libinput 1.26 to NixOS 24.05 but some committers deemed it a breaking change (with more recursive breakages). I think the best option for you currently is to manually add the overlay.

I've removed it due to it causing mass rebuilds for people using hyprland through the overlay.

Yeh that makes sense. I could also just pin hyprland/aquamarine to b4 the change was made.

@sjcobb2022
Copy link
Contributor Author

@fufexan

You know any way to add an overlay that affects the build of an external flake. Simply overriding aquamarine / libinput has not been successful for me.

This is what I have tried so far. Any thoughts on getting this to work? Or do you think that pinning until 24.11 is good enough.

       aquamarine = prev.aquamarine.override {
         libinput = prev.libinput.overrideAttrs (self: super: {
           version = "1.26.0";
           src = final.fetchFromGitLab {
             domain = "gitlab.freedesktop.org";
             owner = "libinput";
             repo = "libinput";
             rev = self.version;
             hash = "sha256-mlxw4OUjaAdgRLFfPKMZDMOWosW9yKAkzDccwuLGCwQ=";
           };
         });
       };
     };
         libinput = prev.libinput.overrideAttrs (self: super: {
           version = "1.26.0";
           src = final.fetchFromGitLab {
             domain = "gitlab.freedesktop.org";
             owner = "libinput";
             repo = "libinput";
             rev = self.version;
             hash = "sha256-mlxw4OUjaAdgRLFfPKMZDMOWosW9yKAkzDccwuLGCwQ=";
           };
         });
       };

@fufexan
Copy link
Member

fufexan commented Sep 10, 2024

That looks good at first sight, but perhaps other dependencies of aquamarine also depend on libinput. I believe a "global" overlay might fix this, but it will also require you to rebuild some other packages.

@sjcobb2022
Copy link
Contributor Author

This is actually a global overlay. And it still fails with the aquamarine PkgConfig.cmake failing. Bit strange.

  nixpkgs = {
    overlays = builtins.attrValues outputs.overlays;
  }; 

I have this section of nix in both my home-manager and my system level config.

I believe that that should totally override it.

Perhaps I will also need to set nixpkgs.config.packageOverrides?

@fufexan
Copy link
Member

fufexan commented Sep 10, 2024

Not sure, but it's worth a try.

@sjcobb2022
Copy link
Contributor Author

sjcobb2022 commented Sep 15, 2024

Ok I have a fix, couple of weird behaviors with wayland-scanner but it's all good.

So:

With these inputs:

 inputs = {
    aquamarine = {
      type = "git";
      url = "https://github.com/hyprwm/aquamarine";
      ref = "refs/tags/v0.4.1";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };

    hyprland = {
      type = "git";
      url = "https://github.com/hyprwm/hyprland";
      ref = "refs/tags/v0.43.0";
      submodules = true;
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.aquamarine.follows = "aquamarine";
    };
  }

I have this overlay:

  modifications = final: prev: {
    hyprland-patched = let
      libinput = prev.libinput.overrideAttrs (self: {
        name = "libinput";
        version = "1.26.0";
        src = final.fetchFromGitLab {
          domain = "gitlab.freedesktop.org";
          owner = "libinput";
          repo = "libinput";
          rev = self.version;
          hash = "sha256-mlxw4OUjaAdgRLFfPKMZDMOWosW9yKAkzDccwuLGCwQ=";
        };
      });
    in
      inputs.hyprland.packages.${prev.system}.hyprland.override {
        libinput = libinput;
        aquamarine = inputs.hyprland.inputs.aquamarine.packages.${prev.system}.aquamarine.override {
          libinput = libinput;
        };
        # need this to fix meson build for some reason?
        wayland-scanner = final.unstable.wayland-scanner;
      };
   };

Where final.unstable is from my unstable overlay:

  unstable-packages = final: _prev: {
    unstable = import inputs.nixpkgs-unstable {
      inherit (final) system;
      config.allowUnfree = true;
    };
  };

Important to note: using unstable wayland-scanner and unstable nixpkgs for aquamarine.

TristenYim added a commit to TristenYim/DesktopConfig that referenced this issue Sep 25, 2024
Libinput was what was preventing Hyprland from building on update. See
hyprwm/aquamarine#73. The overlay ensures even
after an update, Hyprland will build with the right version of libinput.
@fufexan fufexan pinned this issue Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants