nixpkgs/pkgs/tools/bluetooth/blueberry/default.nix

97 lines
2.6 KiB
Nix
Raw Normal View History

2020-08-06 22:25:05 +02:00
{ stdenv
, lib
, fetchFromGitHub
, bluez-tools
, cinnamon
, gnome3
, gobject-introspection
, intltool
, pavucontrol
, python3Packages
2020-11-24 16:29:28 +01:00
, util-linux
2020-08-06 22:25:05 +02:00
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "blueberry";
2021-01-19 06:45:26 +01:00
version = "1.4.2";
2020-08-06 22:25:05 +02:00
src = fetchFromGitHub {
owner = "linuxmint";
repo = pname;
rev = version;
2021-01-19 06:45:26 +01:00
sha256 = "sha256-YwJQryIK92/Tc1s49jM3pCs7dmO3l+RbbFBtuXvhYbQ=";
2020-08-06 22:25:05 +02:00
};
nativeBuildInputs = [
gobject-introspection
python3Packages.wrapPython
wrapGAppsHook
];
buildInputs = [
bluez-tools
cinnamon.xapps
gnome3.gnome-bluetooth
python3Packages.python
2020-11-24 16:29:28 +01:00
util-linux
2020-08-06 22:25:05 +02:00
];
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 \
2020-11-24 16:29:28 +01:00
--replace /usr/bin/rfkill ${util-linux}/bin/rfkill \
--replace /usr/sbin/rfkill ${util-linux}/bin/rfkill \
2020-08-06 22:25:05 +02:00
--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 ];
};
}