nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 100 lines 2.7 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 bluez-tools, 6 gnome-bluetooth_1_0, 7 gobject-introspection, 8 libnotify, 9 pavucontrol, 10 python3Packages, 11 util-linux, 12 wrapGAppsHook3, 13 xapp, 14}: 15 16python3Packages.buildPythonApplication rec { 17 pname = "blueberry"; 18 version = "1.4.8"; 19 format = "other"; 20 21 src = fetchFromGitHub { 22 owner = "linuxmint"; 23 repo = "blueberry"; 24 rev = version; 25 sha256 = "sha256-MyIjcTyKn1aC2th6fCOw4cIqrRKatk2s4QD5R9cm83A="; 26 }; 27 28 nativeBuildInputs = [ 29 gobject-introspection 30 wrapGAppsHook3 31 ]; 32 33 buildInputs = [ 34 bluez-tools 35 gnome-bluetooth_1_0 36 libnotify 37 util-linux 38 xapp 39 ]; 40 41 pythonPath = with python3Packages; [ 42 dbus-python 43 pygobject3 44 setproctitle 45 ]; 46 47 installPhase = '' 48 runHook preInstall 49 50 mkdir -p $out 51 cp -a etc usr/* $out 52 53 # Fix paths 54 substituteInPlace $out/bin/blueberry \ 55 --replace-fail /usr/lib/blueberry $out/lib/blueberry 56 substituteInPlace $out/bin/blueberry-tray \ 57 --replace-fail /usr/lib/blueberry $out/lib/blueberry 58 substituteInPlace $out/etc/xdg/autostart/blueberry-obex-agent.desktop \ 59 --replace-fail /usr/lib/blueberry $out/lib/blueberry 60 substituteInPlace $out/etc/xdg/autostart/blueberry-tray.desktop \ 61 --replace-fail Exec=blueberry-tray Exec=$out/bin/blueberry-tray 62 substituteInPlace $out/lib/blueberry/blueberry-obex-agent.py \ 63 --replace-fail /usr/share $out/share 64 substituteInPlace $out/lib/blueberry/blueberry-tray.py \ 65 --replace-fail /usr/share $out/share 66 substituteInPlace $out/lib/blueberry/blueberry.py \ 67 --replace-fail '"bt-adapter"' '"${bluez-tools}/bin/bt-adapter"' \ 68 --replace-fail /usr/bin/pavucontrol ${pavucontrol}/bin/pavucontrol \ 69 --replace-fail /usr/lib/blueberry $out/lib/blueberry \ 70 --replace-fail /usr/share $out/share 71 substituteInPlace $out/lib/blueberry/rfkillMagic.py \ 72 --replace-fail /usr/bin/rfkill ${util-linux}/bin/rfkill \ 73 --replace-fail /usr/sbin/rfkill ${util-linux}/bin/rfkill \ 74 --replace-fail /usr/lib/blueberry $out/lib/blueberry 75 substituteInPlace $out/share/applications/blueberry.desktop \ 76 --replace-fail Exec=blueberry Exec=$out/bin/blueberry 77 78 glib-compile-schemas --strict $out/share/glib-2.0/schemas 79 80 runHook postInstall 81 ''; 82 83 dontWrapGApps = true; 84 85 postFixup = '' 86 makeWrapperArgs+=("''${gappsWrapperArgs[@]}") 87 wrapPythonProgramsIn $out/lib "$out $pythonPath" 88 ''; 89 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; [ 96 bobby285271 97 romildo 98 ]; 99 }; 100}