aquamarine/nix/default.nix

83 lines
1.4 KiB
Nix

{
lib,
stdenv,
stdenvAdapters,
cmake,
hwdata,
hyprutils,
hyprwayland-scanner,
libdisplay-info,
libdrm,
libffi,
libGL,
libinput,
mesa,
pixman,
pkg-config,
seatd,
udev,
wayland,
wayland-protocols,
wayland-scanner,
version ? "git",
doCheck ? false,
debug ? false,
}: let
inherit (builtins) foldl';
inherit (lib.lists) flatten;
adapters = flatten [
stdenvAdapters.useMoldLinker
(lib.optional debug stdenvAdapters.keepDebugInfo)
];
customStdenv = foldl' (acc: adapter: adapter acc) stdenv adapters;
in
customStdenv.mkDerivation {
pname = "aquamarine";
inherit version doCheck;
src = ../.;
strictDeps = true;
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
cmake
hyprwayland-scanner
pkg-config
];
buildInputs = [
hwdata
hyprutils
libdisplay-info
libdrm
libffi
libGL
libinput
mesa
pixman
seatd
udev
wayland
wayland-protocols
wayland-scanner
];
outputs = ["out" "dev"];
cmakeBuildType =
if debug
then "Debug"
else "RelWithDebInfo";
meta = {
homepage = "https://github.com/hyprwm/aquamarine";
description = "A very light linux rendering backend library";
license = lib.licenses.bsd3;
platforms = lib.platforms.linux;
};
}