zakk4223 / hyprXPrimary

Set a primary X11 display for hyprland
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Failure(s) trying to build on multiple distros #6

Open rykugur opened 9 months ago

rykugur commented 9 months ago

EDIT: ignore the previous bit about not building on arch; I didn't immediately realize that my hyprland-git package from the AUR hadn't updated (due to a failure trying to build an entirely unrelated package while doing a system upate).

I'm trying to build hyprxprimary on nixOS, but can't seem to figure it out.

Here is my derivation:

{ lib
, stdenv
, fetchFromGitHub
, glibc
, hyprland
, libdrm
, pixman
, pkg-config
}:
stdenv.mkDerivation rec {
  name = "hyprXPrimary";
  src = fetchFromGitHub {
    owner = "zakk4223";
    repo = "hyprXPrimary";
    rev = "701f7d78324cd6e0e3e35ab1dce78bb6e2879d29";
    sha256 = "sha256-4ByHaXEO2Uw+jC23G70vTTZnObRGKFfTbvyoeEWY8JI=";
  };

  nativeBuildInputs = [
    glibc
    hyprland
    libdrm
    pixman
    pkg-config
  ];
}

The error I'm getting when trying to build my nixOS derivation:

@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/sps1yaa61rd47qjxhzk60mhb18mgghf4-source
source root is 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
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
build flags: SHELL=/nix/store/087167dfxal194pm54cmcbbxsfy3cjgn-bash-5.2p26/bin/bash
g++ -shared -Wall -fPIC --no-gnu-unique ./main.cpp -g  -DWLR_USE_UNSTABLE `pkg-config --cflags pixman-1 libdrm hyprland` -std=c++23 -o hyprXPrimary.so
In file included from /nix/store/3qyk28svjfkir0zlm1lpdg1yfhfknlay-hyprland-0.35.0-dev/include/hyprland/src/helpers/Vector2D.hpp:3,
                 from /nix/store/3qyk28svjfkir0zlm1lpdg1yfhfknlay-hyprland-0.35.0-dev/include/hyprland/src/SharedDefs.hpp:3,
                 from ./main.cpp:1:
/nix/store/cmr8qd8w64w8q0cbfc30p98z2pydc1k7-gcc-13.2.0/include/c++/13.2.0/cmath:47:15: fatal error: math.h: No such file or directory
   47 | #include_next <math.h>
      |               ^~~~~~~~
compilation terminated.
make: *** [Makefile:12: hyprXPrimary.so] Error 1

I will freely admit that my C++ skills are wildly out-of-date. I've tried googling around and asked for help in the nixOS community, but have not received a response. Are you able to offer any assistance?

EDIT: As an aside, with the latest version of hyprland:

╰─❯ hyprctl version
Hyprland, built from branch  at commit f590505daf90dfb4059289a906863b59663e70a6  ().
Date: 2024-02-29
Tag: 

flags: (if any)

the hyprxprimary plugin that I built on my arch box is not working (unsure if it's due to some weird build thing on the other box or what). I've been having to manually set the primary monitor on boot.

rykugur commented 7 months ago

Update: I switched from nvidia -> AMD a week or two ago and this plugin (the one that I was able to build a few months ago on my arch box) appears to be working. I.e., it may have been an nvidia issue.

I'm still unable to build on nixOS, however.