hyprbars: add meson.build

This commit is contained in:
Mihai Fufezan 2023-04-18 21:00:31 +03:00
parent 42b9a56256
commit 50d3fbe28f
No known key found for this signature in database
GPG key ID: 5899325F2F120900
8 changed files with 61 additions and 55 deletions

View file

@ -8,15 +8,16 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1680031067, "lastModified": 1681840534,
"narHash": "sha256-kwywAAnHTx3IohvHDbhgsQjrHdN6ewE/vX+E/9oWmFc=", "narHash": "sha256-ONdSYWg+J+XonOPTj8Nc8zcrbyTWolEY0vzqc95H6ZQ=",
"owner": "hyprwm", "owner": "horriblename",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "d6241a3086c4abfd21e91e23c83c97c3f80123d4", "rev": "67fd467920535024fa59b39ce965f42537e89b90",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "hyprwm", "owner": "horriblename",
"ref": "nix-pluginenv",
"repo": "Hyprland", "repo": "Hyprland",
"type": "github" "type": "github"
} }
@ -29,11 +30,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1671839510, "lastModified": 1681065697,
"narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=", "narHash": "sha256-QPzwwlGKX95tl6ZEshboZbEwwAXww6lNLdVYd6T9Mrc=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75", "rev": "4d29e48433270a2af06b8bc711ca1fe5109746cd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -44,11 +45,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1679172431, "lastModified": 1681557730,
"narHash": "sha256-XEh5gIt5otaUbEAPUY5DILUTyWe1goAyeqQtmwaFPyI=", "narHash": "sha256-j2E3639kS3Qop2jQPyqWCdenZNaqIdxfoTvAHnGuAGI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1603d11595a232205f03d46e635d919d1e1ec5b9", "rev": "85b081528b937df4bfcaee80c3541b58f397df8b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -67,11 +68,11 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1679340088, "lastModified": 1680810405,
"narHash": "sha256-/1KiYoBivDj8HC/eVK2Tr2WYkVdKJxq2Lb0tQs0qqJo=", "narHash": "sha256-LmI/4Yp/pOOoI4RxLRx9I90NBsiqdRLVOfbATKlgpkg=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "1d64e12391a638201c679e71d4e22bb45e5faa8e", "rev": "7abda952d0000b72d240fe1d41457b9288f0b6e5",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -93,11 +94,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1673116118, "lastModified": 1681127512,
"narHash": "sha256-eR0yDSkR2XYMesfdRWJs25kAdXET2mbNNHu5t+KUcKA=", "narHash": "sha256-vklOOhBj5W8fii6yN4L2WY5ZeifBmsq3+mJ2wC1Pk9U=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "d479c846531fd0e1d2357c9588b8310a2b859ef2", "rev": "04f579377a32781ce57c9cf4ba2a5bcb7f53fa97",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,5 +1,5 @@
{ {
inputs.hyprland.url = "github:hyprwm/Hyprland"; inputs.hyprland.url = "github:horriblename/Hyprland/nix-pluginenv";
outputs = { outputs = {
self, self,
@ -11,7 +11,6 @@
packages = withPkgsFor (system: pkgs: { packages = withPkgsFor (system: pkgs: {
hyprbars = pkgs.callPackage ./hyprbars { hyprbars = pkgs.callPackage ./hyprbars {
inherit (hyprland.packages.${system}) hyprland; inherit (hyprland.packages.${system}) hyprland;
wlroots = hyprland.packages.${system}.wlroots-hyprland;
}; };
}); });
}; };

View file

@ -1,7 +1,7 @@
#include "barDeco.hpp" #include "barDeco.hpp"
#include <src/Compositor.hpp> #include <hyprland/src/Compositor.hpp>
#include <src/Window.hpp> #include <hyprland/src/Window.hpp>
#include "globals.hpp" #include "globals.hpp"

View file

@ -2,8 +2,8 @@
#define WLR_USE_UNSTABLE #define WLR_USE_UNSTABLE
#include <src/render/decorations/IHyprWindowDecoration.hpp> #include <hyprland/src/render/decorations/IHyprWindowDecoration.hpp>
#include <src/render/OpenGL.hpp> #include <hyprland/src/render/OpenGL.hpp>
#include "globals.hpp" #include "globals.hpp"
class CHyprBar : public IHyprWindowDecoration { class CHyprBar : public IHyprWindowDecoration {

View file

@ -1,39 +1,21 @@
{ {
lib,
stdenv, stdenv,
hyprland, hyprland,
pkg-config,
pixman,
libdrm,
wlroots,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "hyprbars"; name = "hyprbars";
version = "0.1";
src = ./.; src = ./.;
preConfigure = "rm Makefile";
nativeBuildInputs = [ inherit (hyprland) nativeBuildInputs;
pkg-config
];
buildInputs = [ buildInputs = [hyprland] ++ hyprland.buildInputs;
pixman
libdrm
wlroots
];
buildPhase = '' meta = with lib; {
trap "set +x" err homepage = "https://github.com/hyprwm/hyprland-plugins";
set -xeu description = "Hyprland window bar plugin";
license = licenses.bsd3;
$CXX --no-gnu-unique -shared \ platforms = platforms.linux;
-std=c++23 \ };
$(pkg-config --cflags pixman-1) \
$(pkg-config --cflags libdrm) \
$(pkg-config --cflags wlroots) \
-I${hyprland.src}/ \
main.cpp barDeco.cpp \
-o $out
set +x
'';
} }

View file

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <src/plugins/PluginAPI.hpp> #include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr; inline HANDLE PHANDLE = nullptr;

View file

@ -3,9 +3,9 @@
#include <unistd.h> #include <unistd.h>
#include <any> #include <any>
#include <src/Compositor.hpp> #include <hyprland/src/Compositor.hpp>
#include <src/Window.hpp> #include <hyprland/src/Window.hpp>
#include <src/config/ConfigManager.hpp> #include <hyprland/src/config/ConfigManager.hpp>
#include "barDeco.hpp" #include "barDeco.hpp"
#include "globals.hpp" #include "globals.hpp"

24
hyprbars/meson.build Normal file
View file

@ -0,0 +1,24 @@
project('hyprbars', '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
globber = run_command('find', '.', '-name', '*.cpp', check: true)
src = globber.stdout().strip().split('\n')
shared_module('hyprbars', src,
dependencies: [
dependency('pixman-1'),
dependency('libdrm')
],
install: true,
)