Plugin System (#1590)

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
This commit is contained in:
Vaxry
2023-02-27 12:32:38 +00:00
committed by GitHub
parent 74a10f26a4
commit 8b81f41e52
45 changed files with 1691 additions and 85 deletions

View File

@@ -18,6 +18,7 @@
mount,
pciutils,
systemd,
udis86,
wayland,
wayland-protocols,
wayland-scanner,
@@ -72,6 +73,7 @@ in
libinput
libxkbcommon
mesa
udis86
wayland
wayland-protocols
wayland-scanner

View File

@@ -1,34 +1,50 @@
diff --git a/meson.build b/meson.build
index 22ee4bf..5528613 100644
index f380255..abd7cd3 100644
--- a/meson.build
+++ b/meson.build
@@ -2,16 +2,10 @@ project('Hyprland', 'cpp', 'c',
version : '0.1',
default_options : ['warning_level=3', 'cpp_std=c++20', 'default_library=static'])
@@ -39,23 +39,8 @@ add_project_arguments(
],
language: 'cpp')
-wlroots = subproject('wlroots', default_options: ['examples=false'])
-have_xwlr = wlroots.get_variable('features').get('xwayland')
+wlroots = dependency('wlroots', version: '>=0.16.0')
xcb_dep = dependency('xcb', required: get_option('xwayland'))
-cmake = import('cmake')
-udis = cmake.subproject('udis86')
-udis86 = udis.dependency('libudis86')
-
-if get_option('xwayland').enabled() and not have_xwlr
- error('Cannot enable Xwayland in Hyprland: wlroots has been built without Xwayland support')
-endif
-have_xwayland = xcb_dep.found() and have_xwlr
-
-if not have_xwayland
+if not xcb_dep.found()
add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
endif
-add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
-endif
-
backtrace_dep = cpp_compiler.find_library('execinfo', required: false)
systemd_dep = dependency('libsystemd', required: get_option('systemd'))
diff --git a/src/meson.build b/src/meson.build
index 5d64188..a676333 100644
index 7b658d3..da8baa5 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -7,5 +7,5 @@ executable('Hyprland', src,
@@ -7,7 +7,7 @@ executable('Hyprland', src,
server_protos,
dependency('wayland-server'),
dependency('wayland-client'),
- wlroots.get_variable('wlroots'),
+ wlroots,
+ dependency('wlroots'),
dependency('cairo'),
dependency('libdrm'),
dependency('egl'),
@@ -16,7 +16,7 @@ executable('Hyprland', src,
xcb_dep,
backtrace_dep,
systemd_dep,
- udis86,
+ dependency('udis86'),
dependency('pixman-1'),
dependency('gl', 'opengl'),

32
nix/udis86.nix Normal file
View File

@@ -0,0 +1,32 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
python3,
}:
stdenv.mkDerivation {
pname = "udis86";
version = "unstable-2022-10-13";
src = fetchFromGitHub {
owner = "canihavesomecoffee";
repo = "udis86";
rev = "5336633af70f3917760a6d441ff02d93477b0c86";
hash = "sha256-HifdUQPGsKQKQprByeIznvRLONdOXeolOsU5nkwIv3g=";
};
nativeBuildInputs = [autoreconfHook python3];
configureFlags = ["--enable-shared"];
outputs = ["bin" "out" "dev" "lib"];
meta = with lib; {
homepage = "https://udis86.sourceforge.net";
license = licenses.bsd2;
mainProgram = "udcli";
description = "Easy-to-use, minimalistic x86 disassembler library (libudis86)";
platforms = platforms.all;
};
}