nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 bash,
6 cmake,
7 dockbarx,
8 gobject-introspection,
9 keybinder3,
10 pkg-config,
11 python3Packages,
12 wrapGAppsHook3,
13 xfce,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "xfce4-dockbarx-plugin";
18 version = "0.7.2";
19
20 src = fetchFromGitHub {
21 owner = "xuzhen";
22 repo = "xfce4-dockbarx-plugin";
23 rev = "v${version}";
24 sha256 = "sha256-ZxaWORqA8LiM4CzakxClg5C6AsyHrzCGydgboCrC45g=";
25 };
26
27 pythonPath = [
28 dockbarx
29 python3Packages.pygobject3
30 ];
31
32 nativeBuildInputs = [
33 cmake
34 gobject-introspection
35 pkg-config
36 python3Packages.wrapPython
37 wrapGAppsHook3
38 ];
39
40 buildInputs = [
41 keybinder3
42 python3Packages.python
43 xfce.xfce4-panel
44 xfce.xfconf
45 ]
46 ++ pythonPath;
47
48 postPatch = ''
49 # We execute the wrapped xfce4-panel-plug directly.
50 # Since argv is used for g_free() we also need to shift the indexes.
51 substituteInPlace src/xfce_panel_plugin.c \
52 --replace '"python3",' "" \
53 --replace "g_free(argv[3]);" "g_free(argv[2]);" \
54 --replace "g_free(argv[5]);" "g_free(argv[4]);"
55
56 patchShebangs src/xfce4-dockbarx-plug.py
57 '';
58
59 postFixup = ''
60 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
61 chmod +x $out/share/dockbarx/xfce4-panel-plug
62 wrapPythonProgramsIn "$out/share/dockbarx" "$out $pythonPath"
63 '';
64
65 meta = with lib; {
66 homepage = "https://github.com/xuzhen/xfce4-dockbarx-plugin";
67 description = "Plugins to embed DockbarX into xfce4-panel";
68 license = licenses.mit;
69 platforms = platforms.linux;
70 teams = [ teams.xfce ];
71 };
72}