From e70b46afd7f7ccbfa59676decebe2eca0b4d01ba Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Wed, 3 Apr 2024 22:08:47 +0300 Subject: [PATCH] hyprexpo: add nix derivation & meson --- flake.nix | 3 ++- hyprexpo/default.nix | 19 +++++++++++++++++++ hyprexpo/meson.build | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 hyprexpo/default.nix create mode 100644 hyprexpo/meson.build diff --git a/flake.nix b/flake.nix index 725272a..a756875 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ }); in { packages = eachSystem (system: { - inherit (pkgsFor.${system}) borders-plus-plus csgo-vulkan-fix hyprbars hyprtrails hyprwinwrap; + inherit (pkgsFor.${system}) borders-plus-plus csgo-vulkan-fix hyprbars hyprexpo hyprtrails hyprwinwrap; }); overlays = { @@ -46,6 +46,7 @@ borders-plus-plus = callPackage ./borders-plus-plus {}; csgo-vulkan-fix = callPackage ./csgo-vulkan-fix {}; hyprbars = callPackage ./hyprbars {}; + hyprexpo = callPackage ./hyprexpo {}; hyprtrails = callPackage ./hyprtrails {}; hyprwinwrap = callPackage ./hyprwinwrap {}; }) diff --git a/hyprexpo/default.nix b/hyprexpo/default.nix new file mode 100644 index 0000000..7bf2d88 --- /dev/null +++ b/hyprexpo/default.nix @@ -0,0 +1,19 @@ +{ + lib, + hyprland, + hyprlandPlugins, +}: +hyprlandPlugins.mkHyprlandPlugin { + pluginName = "hyprexpo"; + version = "0.1"; + src = ./.; + + inherit (hyprland) nativeBuildInputs; + + meta = with lib; { + homepage = "https://github.com/hyprwm/hyprland-plugins"; + description = "Hyprland workspaces overview plugin"; + license = licenses.bsd3; + platforms = platforms.linux; + }; +} diff --git a/hyprexpo/meson.build b/hyprexpo/meson.build new file mode 100644 index 0000000..460c634 --- /dev/null +++ b/hyprexpo/meson.build @@ -0,0 +1,34 @@ +project('hyprexpo', 'cpp', + version: '0.1', + default_options: ['buildtype=release'], +) + +cpp_compiler = meson.get_compiler('cpp') +if cpp_compiler.has_argument('-std=c++23') + add_global_arguments('-std=c++23', language: 'cpp') +elif cpp_compiler.has_argument('-std=c++2b') + add_global_arguments('-std=c++2b', language: 'cpp') +else + error('Could not configure current C++ compiler (' + cpp_compiler.get_id() + ' ' + cpp_compiler.version() + ') with required C++ standard (C++23)') +endif + +add_project_arguments( + [ + '-Wno-narrowing', + ], + language: 'cpp') + +globber = run_command('find', '.', '-name', '*.cpp', check: true) +src = globber.stdout().strip().split('\n') + +hyprland = dependency('hyprland') + +shared_module(meson.project_name(), src, + dependencies: [ + dependency('hyprland'), + dependency('pixman-1'), + dependency('libdrm'), + dependency('pangocairo'), + ], + install: true, +)