summary refs log tree commit diff
path: root/pkgs/applications/window-managers/picom
diff options
context:
space:
mode:
authorJaakko Luttinen <jaakko.luttinen@iki.fi>2020-04-17 19:16:19 +0300
committerJaakko Luttinen <jaakko.luttinen@iki.fi>2021-01-24 18:18:57 +0200
commite788a4a22ce6c7d29c4c9bf3d5595287cdab7e59 (patch)
treeeafc8f1d5c852bd3ed5cc977f95ade8d84e417c8 /pkgs/applications/window-managers/picom
parent33532c4756b107438e7c6031ba695d3bacf11c69 (diff)
downloadnixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.tar
nixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.tar.gz
nixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.tar.bz2
nixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.tar.lz
nixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.tar.xz
nixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.tar.zst
nixpkgs-e788a4a22ce6c7d29c4c9bf3d5595287cdab7e59.zip
picom: add withDebug option
Diffstat (limited to 'pkgs/applications/window-managers/picom')
-rw-r--r--pkgs/applications/window-managers/picom/default.nix17
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 ce0673aab7f..32eee9df0d8 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";