Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 fetchFromGitHub,
3 glib,
4 gobject-introspection,
5 gtk3,
6 libgnomekbd,
7 gdk-pixbuf,
8 cairo,
9 xorg,
10 meson,
11 ninja,
12 pkg-config,
13 python3,
14 lib,
15 stdenv,
16 vala,
17 wrapGAppsHook3,
18 file,
19 inxi,
20 mate,
21 dbus,
22 libdbusmenu-gtk3,
23}:
24
25stdenv.mkDerivation rec {
26 pname = "xapp";
27 version = "2.8.11";
28
29 outputs = [
30 "out"
31 "dev"
32 ];
33
34 src = fetchFromGitHub {
35 owner = "linuxmint";
36 repo = "xapp";
37 rev = version;
38 hash = "sha256-dmMjGWjq0s4MkobeqssbG5G3+gHRqA6lmu95uJX3RJY=";
39 };
40
41 # Recommended by upstream, which enables the build of xapp-debug.
42 # https://github.com/linuxmint/xapp/issues/169#issuecomment-1574962071
43 mesonBuildType = "debugoptimized";
44
45 nativeBuildInputs = [
46 meson
47 ninja
48 pkg-config
49 python3
50 vala
51 wrapGAppsHook3
52 gobject-introspection
53 ];
54
55 buildInputs = [
56 (python3.withPackages (
57 ps: with ps; [
58 pygobject3
59 setproctitle # mate applet
60 ]
61 ))
62 libgnomekbd
63 gdk-pixbuf
64 xorg.libxkbfile
65 python3.pkgs.pygobject3 # for .pc file
66 mate.mate-panel # for gobject-introspection
67 dbus
68 libdbusmenu-gtk3
69 ];
70
71 # Requires in xapp.pc
72 propagatedBuildInputs = [
73 gtk3
74 cairo
75 glib
76 ];
77
78 mesonFlags = [
79 "-Dpy-overrides-dir=${placeholder "out"}/${python3.sitePackages}/gi/overrides"
80 ];
81
82 postPatch = ''
83 chmod +x schemas/meson_install_schemas.py # patchShebangs requires executable file
84 patchShebangs schemas/meson_install_schemas.py
85
86 # Used in cinnamon-settings
87 substituteInPlace scripts/upload-system-info \
88 --replace-fail "'/usr/bin/pastebin'" "'$out/bin/pastebin'" \
89 --replace-fail "'inxi'" "'${inxi}/bin/inxi'"
90
91 # Used in x-d-p-xapp
92 substituteInPlace scripts/xfce4-set-wallpaper \
93 --replace-fail "file --mime-type" "${file}/bin/file --mime-type"
94 '';
95
96 # Fix gtk3 module target dir. Proper upstream solution should be using define_variable.
97 env.PKG_CONFIG_GTK__3_0_LIBDIR = "${placeholder "out"}/lib";
98
99 meta = with lib; {
100 homepage = "https://github.com/linuxmint/xapp";
101 description = "Cross-desktop libraries and common resources";
102 license = licenses.lgpl3;
103 platforms = platforms.linux;
104 teams = [ teams.cinnamon ];
105 };
106}