picom: add withDebug option

+16 -1
+16 -1
pkgs/applications/window-managers/picom/default.nix
··· 27 27 , xcbutilrenderutil 28 28 , xorgproto 29 29 , xwininfo 30 + , withDebug ? false 30 31 }: 31 32 32 33 stdenv.mkDerivation rec { ··· 72 73 xorgproto 73 74 ]; 74 75 75 - mesonBuildType = "release"; 76 + # Use "debugoptimized" instead of "debug" so perhaps picom works better in 77 + # normal usage too, not just temporary debugging. 78 + mesonBuildType = if withDebug then "debugoptimized" else "release"; 79 + dontStrip = withDebug; 76 80 77 81 mesonFlags = [ 78 82 "-Dwith_docs=true" ··· 80 84 81 85 installFlags = [ "PREFIX=$(out)" ]; 82 86 87 + # In debug mode, also copy src directory to store. If you then run `gdb picom` 88 + # in the bin directory of picom store path, gdb finds the source files. 83 89 postInstall = '' 84 90 wrapProgram $out/bin/picom-trans \ 85 91 --prefix PATH : ${lib.makeBinPath [ xwininfo ]} 92 + '' + lib.optionalString withDebug '' 93 + cp -r ../src $out/ 86 94 ''; 87 95 88 96 meta = with lib; { ··· 93 101 extensions. It enables basic eye-candy effects. This fork adds 94 102 additional features, such as additional effects, and a fork at a 95 103 well-defined and proper place. 104 + 105 + The package can be installed in debug mode as: 106 + 107 + picom.override { withDebug = true; } 108 + 109 + For gdb to find the source files, you need to run gdb in the bin directory 110 + of picom package in the nix store. 96 111 ''; 97 112 license = licenses.mit; 98 113 homepage = "https://github.com/yshui/picom";