Debian Codegraph @

package.nix

raw symbols SCIP
1 {
2 asciidoctor,
3 dbus,
4 docbook_xml_dtd_45,
5 docbook_xsl,
6 llvmPackages,
7 lib,
8 libconfig,
9 libev,
10 libGL,
11 libepoxy,
12 libX11,
13 libxcb,
14 makeWrapper,
15 meson,
16 ninja,
17 pcre2,
18 pixman,
19 pkg-config,
20 python3,
21 stdenv,
22 uthash,
23 xcbutil,
24 xcbutilimage,
25 xcbutilrenderutil,
26 xorgproto,
27 xwininfo,
28 withDebug ? false,
29 withDocs ? false,
30 withTools ? false,
31 git-ignore-nix,
32 devShell ? false,
33 }:
34
35 let
36 versionFromMeson =
37 s: builtins.head (builtins.match "project\\('picom',.*version: *'([0-9.]*)'.*" s);
38 in
39 stdenv.mkDerivation (finalAttrs: {
40 pname = "picom";
41 version = versionFromMeson (builtins.readFile ./meson.build);
42
43 src = git-ignore-nix.lib.gitignoreSource ./.;
44
45 strictDeps = true;
46
47 nativeBuildInputs = [
48 makeWrapper
49 meson
50 ninja
51 pkg-config
52 ]
53 ++ (lib.optional devShell [
54 llvmPackages.clang-tools
55 llvmPackages.clang-unwrapped.python
56 llvmPackages.libllvm
57 (python3.withPackages (
58 ps: with ps; [
59 xcffib
60 pip
61 dbus-next
62 pygit2
63 ]
64 ))
65 ])
66 ++ (lib.optional withDocs [
67 asciidoctor
68 docbook_xml_dtd_45
69 docbook_xsl
70 ]);
71
72 buildInputs = [
73 dbus
74 libconfig
75 libev
76 libGL
77 libepoxy
78 libX11
79 libxcb
80 pcre2
81 pixman
82 uthash
83 xcbutil
84 xcbutilimage
85 xcbutilrenderutil
86 xorgproto
87 ];
88
89 # Use "debugoptimized" instead of "debug" so perhaps picom works better in
90 # normal usage too, not just temporary debugging.
91 mesonBuildType = if withDebug then "debugoptimized" else "release";
92 dontStrip = withDebug;
93
94 mesonFlags = [
95 (lib.mesonBool "with_docs" withDocs)
96 ];
97
98 installFlags = [ "PREFIX=$(out)" ];
99
100 # In debug mode, also copy src directory to store. If you then run `gdb picom`
101 # in the bin directory of picom store path, gdb finds the source files.
102 postInstall =
103 lib.optionalString withTools ''
104 wrapProgram $out/bin/picom-trans \
105 --prefix PATH : ${lib.makeBinPath [ xwininfo ]}
106 ''
107 + lib.optionalString withDebug ''
108 cp -r ../src $out/
109 '';
110 })