e57d1aec4c3730a7971fff3b8340f3a45e637cf4

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Update to hyprland pkg-config

This also allows hy3 to be built as an output

Diff

This diff is truncated to protect this page.

  1diff --git a/CMakeLists.txt b/CMakeLists.txt
  2index 1aa891436d1e7da060c94f3080dd8d05c0699c98..64e3c51fb5d7c87c832a8421f5c9e8679e4e523c 100644
  3--- a/CMakeLists.txt
  4+++ b/CMakeLists.txt
  5@@ -10,12 +10,8 @@ if(CMAKE_EXPORT_COMPILE_COMMANDS)
  6       ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
  7 endif()
  8 
  9-IF(NOT DEFINED ENV{HYPRLAND_HEADERS})
 10- message(FATAL_ERROR "$HYPRLAND_HEADERS is unset")
 11-ENDIF()
 12-
 13 find_package(PkgConfig REQUIRED)
 14-pkg_check_modules(DEPS REQUIRED pixman-1 libdrm)
 15+pkg_check_modules(DEPS REQUIRED hyprland pixman-1 libdrm)
 16 
 17 add_library(hy3 SHARED
 18 	src/main.cpp
 19@@ -23,7 +19,6 @@ add_library(hy3 SHARED
 20 	src/SelectionHook.cpp
 21 )
 22 
 23-target_include_directories(hy3 PRIVATE
 24-	${DEPS_INCLUDE_DIRS}
 25-	$ENV{HYPRLAND_HEADERS}
 26-)
 27+target_include_directories(hy3 PRIVATE ${DEPS_INCLUDE_DIRS})
 28+
 29+install(TARGETS hy3 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
 30diff --git a/flake.lock b/flake.lock
 31index eaf318df05f911cf35b3f049bc0532c1a3896666..d4b4b80666b02503ecf661cd19cf18ab3e2c68a7 100644
 32--- a/flake.lock
 33+++ b/flake.lock
 34@@ -1,12 +1,15 @@
 35 {
 36   "nodes": {
 37     "flake-utils": {
 38+      "inputs": {
 39+        "systems": "systems"
 40+      },
 41       "locked": {
 42-        "lastModified": 1678901627,
 43-        "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
 44+        "lastModified": 1681202837,
 45+        "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
 46         "owner": "numtide",
 47         "repo": "flake-utils",
 48-        "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
 49+        "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
 50         "type": "github"
 51       },
 52       "original": {
 53@@ -23,11 +26,11 @@
 54         "xdph": "xdph"
 55       },
 56       "locked": {
 57-        "lastModified": 1680645538,
 58-        "narHash": "sha256-H9gAx2U3XKVoI2WjwbOXULL4TYj9y7ctxBB4up0v9tI=",
 59+        "lastModified": 1682603803,
 60+        "narHash": "sha256-NY9nVAdB7UyInu2vPx/DIUVNZ83t4RdP16QY9DTIn4s=",
 61         "owner": "hyprwm",
 62         "repo": "Hyprland",
 63-        "rev": "a80ba54bbc6a423ab0e79730442e09aea832d9d6",
 64+        "rev": "f23455e592bca14e0abd9249de467cc71cd2850e",
 65         "type": "github"
 66       },
 67       "original": {
 68@@ -44,11 +47,11 @@
 69         ]
 70       },
 71       "locked": {
 72-        "lastModified": 1671839510,
 73-        "narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=",
 74+        "lastModified": 1681065697,
 75+        "narHash": "sha256-QPzwwlGKX95tl6ZEshboZbEwwAXww6lNLdVYd6T9Mrc=",
 76         "owner": "hyprwm",
 77         "repo": "hyprland-protocols",
 78-        "rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75",
 79+        "rev": "4d29e48433270a2af06b8bc711ca1fe5109746cd",
 80         "type": "github"
 81       },
 82       "original": {
 83@@ -59,11 +62,11 @@
 84     },
 85     "nixpkgs": {
 86       "locked": {
 87-        "lastModified": 1680487167,
 88-        "narHash": "sha256-9FNIqrxDZgSliGGN2XJJSvcDYmQbgOANaZA4UWnTdg4=",
 89+        "lastModified": 1682453498,
 90+        "narHash": "sha256-WoWiAd7KZt5Eh6n+qojcivaVpnXKqBsVgpixpV2L9CE=",
 91         "owner": "NixOS",
 92         "repo": "nixpkgs",
 93-        "rev": "53dad94e874c9586e71decf82d972dfb640ef044",
 94+        "rev": "c8018361fa1d1650ee8d4b96294783cf564e8a7f",
 95         "type": "github"
 96       },
 97       "original": {
 98@@ -83,15 +86,30 @@
 99         ]
100       }
101     },
102+    "systems": {
103+      "locked": {
104+        "lastModified": 1681028828,
105+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
106+        "owner": "nix-systems",
107+        "repo": "default",
108+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
109+        "type": "github"
110+      },
111+      "original": {
112+        "owner": "nix-systems",
113+        "repo": "default",
114+        "type": "github"
115+      }
116+    },
117     "wlroots": {
118       "flake": false,
119       "locked": {
120         "host": "gitlab.freedesktop.org",
121-        "lastModified": 1680629978,
122-        "narHash": "sha256-2iVx5zqU2CpMgmtVadsHSkhkAsoxAWKQp6RQqt2OgQY=",
123+        "lastModified": 1682436395,
124+        "narHash": "sha256-GGEjkQO9m7YLYIXIXM76HWdhjg4Ye+oafOtyaFAYKI4=",
125         "owner": "wlroots",
126         "repo": "wlroots",
127-        "rev": "835208db98a29431fa687c9506f4b43fe645ff65",
128+        "rev": "6830bfc17fd94709e2cdd4da0af989f102a26e59",
129         "type": "gitlab"
130       },
131       "original": {
132@@ -113,11 +131,11 @@
133         ]
134diff --git a/flake.nix b/flake.nix
135index 376bb8a629b9569fb084cc9a21cc75504cf3d6fe..2bff14396cc683816d5810b15f4eb905c3ac362f 100644
136--- a/flake.nix
137+++ b/flake.nix
138@@ -8,8 +8,8 @@
139   outputs = { nixpkgs, hyprland, flake-utils, ... }:
140     flake-utils.lib.eachDefaultSystem (system: let
141       pkgs = import nixpkgs { inherit system; };
142-      hyprpkgs = hyprland.packages.${system};
143-    in {
144+      hyprland_pkg = hyprland.packages.${system}.hyprland;
145+    in rec {
146       packages.default = pkgs.gcc12Stdenv.mkDerivation {
147         pname = "hy3";
148         version = "0.1";
149@@ -17,35 +17,21 @@
150         src = ./.;
151 
152         nativeBuildInputs = with pkgs; [
153+          hyprland_pkg.dev
154           cmake
155           pkg-config
156-        ];
157-
158-        #HYPRLAND_HEADERS = hyprpkgs.hyprland.src; - TODO
159+        ] ++ hyprland_pkg.buildInputs;
160       };
161 
162       devShells.default = pkgs.mkShell.override { stdenv = pkgs.gcc12Stdenv; } {
163         name = "hy3-shell";
164-        nativeBuildInputs = with pkgs; [
165-          cmake
166-          pkg-config
167 
168+        nativeBuildInputs = with pkgs; [
169           clang-tools_15
170           bear
171         ];
172 
173-        buildInputs = with pkgs; [
174-          hyprpkgs.wlroots-hyprland
175-          libdrm
176-          pixman
177-        ];
178-
179-        inputsFrom = [
180-          hyprpkgs.hyprland
181-          hyprpkgs.wlroots-hyprland
182-        ];
183-
184-        #HYPRLAND_HEADERS = hyprpkgs.hyprland.src; - TODO
185+        inputsFrom = [ packages.default ];
186       };
187     });
188 }
189diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
190index b5051d2eb3cc0a7c40e097dfa821fc04aaa66a82..eb7cdb85db1227155185b7a9959b1f45ad8f6f6d 100644
191--- a/src/Hy3Layout.cpp
192+++ b/src/Hy3Layout.cpp
193@@ -2,7 +2,7 @@
194 #include "Hy3Layout.hpp"
195 #include "SelectionHook.hpp"
196 
197-#include <src/Compositor.hpp>
198+#include <hyprland/src/Compositor.hpp>
199 
200 Hy3GroupData::Hy3GroupData(Hy3GroupLayout layout): layout(layout) {}
201 
202diff --git a/src/Hy3Layout.hpp b/src/Hy3Layout.hpp
203index fdeef7fb99d42598ea592921e43ab066bb13ceab..6e9dc3c8013016ab98ccde038e431b2e22126954 100644
204--- a/src/Hy3Layout.hpp
205+++ b/src/Hy3Layout.hpp
206@@ -1,7 +1,7 @@
207 #pragma once
208 
209 #include <list>
210-#include <src/layout/IHyprLayout.hpp>
211+#include <hyprland/src/layout/IHyprLayout.hpp>
212 
213 class Hy3Layout;
214 struct Hy3Node;
215diff --git a/src/SelectionHook.cpp b/src/SelectionHook.cpp
216index c1b93b8b6fa3ec113d574661d94ea8190c160fc0..19e131f8bec28a70b850e2f200cf7372e0e37491 100644
217--- a/src/SelectionHook.cpp
218+++ b/src/SelectionHook.cpp
219@@ -1,7 +1,6 @@
220 #include "globals.hpp"
221-#include "src/Window.hpp"
222-#include <src/plugins/PluginAPI.hpp>
223-#include <src/Compositor.hpp>
224+#include <hyprland/src/plugins/PluginAPI.hpp>
225+#include <hyprland/src/Compositor.hpp>
226 
227 inline CFunctionHook* g_LastSelectionHook = nullptr;
228 
229diff --git a/src/globals.hpp b/src/globals.hpp
230index 6d165865e12cf390c89d2bbbac4a0bae05721a13..c955ee3af80c17c85e695c13265d81186fed67c1 100644
231--- a/src/globals.hpp
232+++ b/src/globals.hpp
233@@ -1,4 +1,4 @@
234-#include <src/plugins/PluginAPI.hpp>
235+#include <hyprland/src/plugins/PluginAPI.hpp>
236 #include "Hy3Layout.hpp"
237 
238 inline HANDLE PHANDLE = nullptr;
239diff --git a/src/main.cpp b/src/main.cpp
240index 2126376742558e2a396570ab0c4b71bbf0ade96e..18cfb2b6e486c7534c9c454b4330cd5c44289fb2 100644
241--- a/src/main.cpp
242+++ b/src/main.cpp
243@@ -1,5 +1,5 @@
244-#include <src/plugins/PluginAPI.hpp>
245-#include <src/Compositor.hpp>
246+#include <hyprland/src/plugins/PluginAPI.hpp>
247+#include <hyprland/src/Compositor.hpp>
248 
249 #include "globals.hpp"
250