picom: add withDebug option

+16 -1
+16 -1
pkgs/applications/window-managers/picom/default.nix
··· 27 , xcbutilrenderutil 28 , xorgproto 29 , xwininfo 30 }: 31 32 stdenv.mkDerivation rec { ··· 72 xorgproto 73 ]; 74 75 - mesonBuildType = "release"; 76 77 mesonFlags = [ 78 "-Dwith_docs=true" ··· 80 81 installFlags = [ "PREFIX=$(out)" ]; 82 83 postInstall = '' 84 wrapProgram $out/bin/picom-trans \ 85 --prefix PATH : ${lib.makeBinPath [ xwininfo ]} 86 ''; 87 88 meta = with lib; { ··· 93 extensions. It enables basic eye-candy effects. This fork adds 94 additional features, such as additional effects, and a fork at a 95 well-defined and proper place. 96 ''; 97 license = licenses.mit; 98 homepage = "https://github.com/yshui/picom";
··· 27 , xcbutilrenderutil 28 , xorgproto 29 , xwininfo 30 + , withDebug ? false 31 }: 32 33 stdenv.mkDerivation rec { ··· 73 xorgproto 74 ]; 75 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; 80 81 mesonFlags = [ 82 "-Dwith_docs=true" ··· 84 85 installFlags = [ "PREFIX=$(out)" ]; 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. 89 postInstall = '' 90 wrapProgram $out/bin/picom-trans \ 91 --prefix PATH : ${lib.makeBinPath [ xwininfo ]} 92 + '' + lib.optionalString withDebug '' 93 + cp -r ../src $out/ 94 ''; 95 96 meta = with lib; { ··· 101 extensions. It enables basic eye-candy effects. This fork adds 102 additional features, such as additional effects, and a fork at a 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. 111 ''; 112 license = licenses.mit; 113 homepage = "https://github.com/yshui/picom";