diff options
author | Jaakko Luttinen <jaakko.luttinen@iki.fi> | 2020-04-17 19:16:19 +0300 |
---|---|---|
committer | Jaakko Luttinen <jaakko.luttinen@iki.fi> | 2021-01-24 18:18:57 +0200 |
commit | e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59 (patch) | |
tree | eafc8f1d5c852bd3ed5cc977f95ade8d84e417c8 /pkgs/applications/window-managers/picom | |
parent | 33532c4756b107438e7c6031ba695d3bacf11c69 (diff) |
picom: add withDebug option
Diffstat (limited to 'pkgs/applications/window-managers/picom')
-rw-r--r-- | pkgs/applications/window-managers/picom/default.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/applications/window-managers/picom/default.nix b/pkgs/applications/window-managers/picom/default.nix index ce0673aab7f7..32eee9df0d83 100644 --- a/pkgs/applications/window-managers/picom/default.nix +++ b/pkgs/applications/window-managers/picom/default.nix @@ -27,6 +27,7 @@ , xcbutilrenderutil , xorgproto , xwininfo +, withDebug ? false }: stdenv.mkDerivation rec { @@ -72,7 +73,10 @@ stdenv.mkDerivation rec { xorgproto ]; - mesonBuildType = "release"; + # Use "debugoptimized" instead of "debug" so perhaps picom works better in + # normal usage too, not just temporary debugging. + mesonBuildType = if withDebug then "debugoptimized" else "release"; + dontStrip = withDebug; mesonFlags = [ "-Dwith_docs=true" @@ -80,9 +84,13 @@ stdenv.mkDerivation rec { installFlags = [ "PREFIX=$(out)" ]; + # In debug mode, also copy src directory to store. If you then run `gdb picom` + # in the bin directory of picom store path, gdb finds the source files. postInstall = '' wrapProgram $out/bin/picom-trans \ --prefix PATH : ${lib.makeBinPath [ xwininfo ]} + '' + lib.optionalString withDebug '' + cp -r ../src $out/ ''; meta = with lib; { @@ -93,6 +101,13 @@ stdenv.mkDerivation rec { extensions. It enables basic eye-candy effects. This fork adds additional features, such as additional effects, and a fork at a well-defined and proper place. + + The package can be installed in debug mode as: + + picom.override { withDebug = true; } + + For gdb to find the source files, you need to run gdb in the bin directory + of picom package in the nix store. ''; license = licenses.mit; homepage = "https://github.com/yshui/picom"; |