summary refs log tree commit diff
path: root/pkgs/applications/window-managers/hyprwm/hypr/default.nix
blob: 2485552fce6eab90e9cecea11f4f3a9e3b974707 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cairo
, cmake
, glib
, gtkmm3
, harfbuzz
, libX11
, libXdmcp
, libxcb
, makeWrapper
, pcre2
, pkg-config
, xcbutilcursor
, xcbutilkeysyms
, xcbutilwm
, xcbutil
, xmodmap
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "hypr";
  version = "unstable-2022-05-25";

  src = fetchFromGitHub {
    owner = "hyprwm";
    repo = "Hypr";
    rev = "3e3d943c446ae77c289611a1a875c8dff8883c1e";
    hash = "sha256-lyaGGm53qxg7WVoFxZ7kerLe12P1N3JbN8nut6oZS50=";
  };

  patches = [
    ./000-dont-set-compiler.diff
    # TODO: remove on next release
    (fetchpatch {
      url = "https://github.com/hyprwm/Hypr/commit/08d6af2caf882247943f0e8518ad782f35d1aba4.patch";
      sha256 = "sha256-WjR12ZH8CE+l9xSeQUAPYW5r5HzoPpod5YqDPJTdTY8=";
    })
    (fetchpatch {
      url = "https://github.com/hyprwm/Hypr/commit/7512a3ab91865b1e11b8c4a9dfdffb25c2b153de.patch";
      sha256 = "sha256-0Hq5n115z0U44op7A1FO9tUOeMEPV0QgD5E5zcmend0=";
    })
  ];

  nativeBuildInputs = [
    cmake
    makeWrapper
    pkg-config
  ];

  buildInputs = [
    cairo
    glib
    gtkmm3
    harfbuzz
    libX11
    libXdmcp
    libxcb
    pcre2
    xcbutilcursor
    xcbutilkeysyms
    xcbutilwm
    xcbutil
  ];

  # src/ewmh/ewmh.cpp:67:28: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list
  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-c++11-narrowing";

  installPhase = ''
    runHook preInstall

    install -Dm755 Hypr -t $out/bin

    runHook postInstall
  '';

  postFixup = ''
    wrapProgram $out/bin/Hypr --prefix PATH : ${lib.makeBinPath [ xmodmap ]}
  '';

  meta = with lib; {
    inherit (finalAttrs.src.meta) homepage;
    description = "A tiling X11 window manager written in modern C++";
    license = licenses.bsd3;
    maintainers = with maintainers; [ AndersonTorres ];
    inherit (libX11.meta) platforms;
    mainProgram = "Hypr";
  };
})