Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv
2, lib
3, fetchFromGitHub
4, bluez-tools
5, cinnamon
6, gnome
7, gobject-introspection
8, intltool
9, libnotify
10, pavucontrol
11, python3Packages
12, util-linux
13, wrapGAppsHook
14}:
15
16stdenv.mkDerivation rec {
17 pname = "blueberry";
18 version = "1.4.8";
19
20 src = fetchFromGitHub {
21 owner = "linuxmint";
22 repo = pname;
23 rev = version;
24 sha256 = "sha256-MyIjcTyKn1aC2th6fCOw4cIqrRKatk2s4QD5R9cm83A=";
25 };
26
27 nativeBuildInputs = [
28 gobject-introspection
29 python3Packages.wrapPython
30 wrapGAppsHook
31 ];
32
33 buildInputs = [
34 bluez-tools
35 cinnamon.xapp
36 gnome.gnome-bluetooth_1_0
37 libnotify
38 python3Packages.python
39 util-linux
40 ];
41
42 pythonPath = with python3Packages; [
43 dbus-python
44 pygobject3
45 setproctitle
46 ];
47
48 installPhase = ''
49 runHook preInstall
50
51 mkdir -p $out
52 cp -a etc usr/* $out
53
54 # Fix paths
55 substituteInPlace $out/bin/blueberry \
56 --replace /usr/lib/blueberry $out/lib/blueberry
57 substituteInPlace $out/bin/blueberry-tray \
58 --replace /usr/lib/blueberry $out/lib/blueberry
59 substituteInPlace $out/etc/xdg/autostart/blueberry-obex-agent.desktop \
60 --replace /usr/lib/blueberry $out/lib/blueberry
61 substituteInPlace $out/etc/xdg/autostart/blueberry-tray.desktop \
62 --replace Exec=blueberry-tray Exec=$out/bin/blueberry-tray
63 substituteInPlace $out/lib/blueberry/blueberry-obex-agent.py \
64 --replace /usr/share $out/share
65 substituteInPlace $out/lib/blueberry/blueberry-tray.py \
66 --replace /usr/share $out/share
67 substituteInPlace $out/lib/blueberry/blueberry.py \
68 --replace '"bt-adapter"' '"${bluez-tools}/bin/bt-adapter"' \
69 --replace /usr/bin/pavucontrol ${pavucontrol}/bin/pavucontrol \
70 --replace /usr/lib/blueberry $out/lib/blueberry \
71 --replace /usr/share $out/share
72 substituteInPlace $out/lib/blueberry/rfkillMagic.py \
73 --replace /usr/bin/rfkill ${util-linux}/bin/rfkill \
74 --replace /usr/sbin/rfkill ${util-linux}/bin/rfkill \
75 --replace /usr/lib/blueberry $out/lib/blueberry
76 substituteInPlace $out/share/applications/blueberry.desktop \
77 --replace Exec=blueberry Exec=$out/bin/blueberry
78
79 glib-compile-schemas --strict $out/share/glib-2.0/schemas
80
81 runHook postInstall
82 '';
83
84 dontWrapGApps = true;
85
86 postFixup = ''
87 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
88 wrapPythonProgramsIn $out/lib "$out $pythonPath"
89 '';
90
91 meta = with lib; {
92 description = "Bluetooth configuration tool";
93 homepage = "https://github.com/linuxmint/blueberry";
94 license = licenses.gpl3Plus;
95 platforms = platforms.linux;
96 maintainers = with maintainers; [ bobby285271 romildo ];
97 };
98}