mirror of
https://github.com/hyprwm/hyprutils.git
synced 2024-11-17 06:05:59 +01:00
nix: add debug flag
enable keepDebugInfo adapter on debug build with mold linker
This commit is contained in:
parent
fd4be8b9ca
commit
3ce0cde870
1 changed files with 34 additions and 21 deletions
|
@ -1,13 +1,25 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
|
stdenvAdapters,
|
||||||
cmake,
|
cmake,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
pixman,
|
pixman,
|
||||||
version ? "git",
|
version ? "git",
|
||||||
doCheck ? false,
|
doCheck ? false,
|
||||||
}:
|
debug ? false,
|
||||||
stdenv.mkDerivation {
|
}: 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 = "hyprutils";
|
pname = "hyprutils";
|
||||||
inherit version doCheck;
|
inherit version doCheck;
|
||||||
src = ../.;
|
src = ../.;
|
||||||
|
@ -23,9 +35,10 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
outputs = ["out" "dev"];
|
outputs = ["out" "dev"];
|
||||||
|
|
||||||
cmakeBuildType = "RelWithDebInfo";
|
cmakeBuildType =
|
||||||
|
if debug
|
||||||
dontStrip = true;
|
then "Debug"
|
||||||
|
else "RelWithDebInfo";
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/hyprwm/hyprutils";
|
homepage = "https://github.com/hyprwm/hyprutils";
|
||||||
|
@ -33,4 +46,4 @@ stdenv.mkDerivation {
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue