From 83e63e03908c54ed6cf8b1e0f0460ca6cc20159e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Thu, 6 Aug 2020 17:25:05 -0300 Subject: [PATCH] blueberry: init at 1.3.9 --- pkgs/tools/bluetooth/blueberry/default.nix | 96 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 98 insertions(+) create mode 100644 pkgs/tools/bluetooth/blueberry/default.nix diff --git a/pkgs/tools/bluetooth/blueberry/default.nix b/pkgs/tools/bluetooth/blueberry/default.nix new file mode 100644 index 000000000000..4b7692d49d6a --- /dev/null +++ b/pkgs/tools/bluetooth/blueberry/default.nix @@ -0,0 +1,96 @@ +{ stdenv +, lib +, fetchFromGitHub +, bluez-tools +, cinnamon +, gnome3 +, gobject-introspection +, intltool +, pavucontrol +, python3Packages +, rfkill +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "blueberry"; + version = "1.3.9"; + + src = fetchFromGitHub { + owner = "linuxmint"; + repo = pname; + rev = version; + sha256 = "0llvz1h2dmvhvwkkvl0q4ggi1nmdbllw34ppnravs5lybqkicyw9"; + }; + + nativeBuildInputs = [ + gobject-introspection + python3Packages.wrapPython + wrapGAppsHook + ]; + + buildInputs = [ + bluez-tools + cinnamon.xapps + gnome3.gnome-bluetooth + python3Packages.python + rfkill + ]; + + pythonPath = with python3Packages; [ + dbus-python + pygobject3 + setproctitle + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -a etc usr/* $out + + # Fix paths + substituteInPlace $out/bin/blueberry \ + --replace /usr/lib/blueberry $out/lib/blueberry + substituteInPlace $out/bin/blueberry-tray \ + --replace /usr/lib/blueberry $out/lib/blueberry + substituteInPlace $out/etc/xdg/autostart/blueberry-obex-agent.desktop \ + --replace /usr/lib/blueberry $out/lib/blueberry + substituteInPlace $out/etc/xdg/autostart/blueberry-tray.desktop \ + --replace Exec=blueberry-tray Exec=$out/bin/blueberry-tray + substituteInPlace $out/lib/blueberry/blueberry-obex-agent.py \ + --replace /usr/share $out/share + substituteInPlace $out/lib/blueberry/blueberry-tray.py \ + --replace /usr/share $out/share + substituteInPlace $out/lib/blueberry/blueberry.py \ + --replace '"bt-adapter"' '"${bluez-tools}/bin/bt-adapter"' \ + --replace /usr/bin/pavucontrol ${pavucontrol}/bin/pavucontrol \ + --replace /usr/lib/blueberry $out/lib/blueberry \ + --replace /usr/share $out/share + substituteInPlace $out/lib/blueberry/rfkillMagic.py \ + --replace /usr/bin/rfkill ${rfkill}/bin/rfkill \ + --replace /usr/sbin/rfkill ${rfkill}/bin/rfkill \ + --replace /usr/lib/blueberry $out/lib/blueberry + substituteInPlace $out/share/applications/blueberry.desktop \ + --replace Exec=blueberry Exec=$out/bin/blueberry + + glib-compile-schemas --strict $out/share/glib-2.0/schemas + + runHook postInstall + ''; + + dontWrapGApps = true; + + postFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + wrapPythonProgramsIn $out/lib "$out $pythonPath" + ''; + + meta = with lib; { + description = "Bluetooth configuration tool"; + homepage = "https://github.com/linuxmint/blueberry"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9fb087e8b6ad..e7c4312f09a5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2458,6 +2458,8 @@ in inherit (python27Packages) pillow; }; + blueberry = callPackage ../tools/bluetooth/blueberry { }; + blueman = callPackage ../tools/bluetooth/blueman { }; bmrsa = callPackage ../tools/security/bmrsa/11.nix { };