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