picom: add withDebug option

This commit is contained in:
Jaakko Luttinen 2020-04-17 19:16:19 +03:00
parent 33532c4756
commit e788a4a22c
No known key found for this signature in database
GPG Key ID: 7B1CE13152E6B964

View File

@ -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";