Merge pull request #12960 from abbradar/bluetooth-fixes

Use BlueZ 5 by default, update blueman
This commit is contained in:
Nikolay Amiantov 2016-02-14 10:45:03 +03:00
commit 75a83eff8d
6 changed files with 71 additions and 51 deletions

View File

@ -73,6 +73,8 @@ stdenv.mkDerivation rec {
ln -s ../libexec/bluetooth/obexd $out/sbin/obexd ln -s ../libexec/bluetooth/obexd $out/sbin/obexd
''; '';
enableParallelBuilding = true;
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://www.bluez.org/; homepage = http://www.bluez.org/;
repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git; repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;

View File

@ -1,43 +1,49 @@
{ stdenv, fetchurl, pkgconfig, intltool, python, pyrex, pygobject, pygtk { stdenv, lib, fetchurl, intltool, pkgconfig, pythonPackages, bluez, polkit, gtk3
, notify, pythonDBus, bluez, glib, gtk, libstartup_notification , obex_data_server, xdg_utils, libnotify, dconf
, makeWrapper, xdg_utils, obex_data_server , withPulseAudio ? true, libpulseaudio }:
, libpulseaudio
}:
stdenv.mkDerivation rec { let
name = "blueman-1.23"; binPath = lib.makeBinPath [ xdg_utils ];
in stdenv.mkDerivation rec {
name = "blueman-${version}";
version = "2.0.3";
src = fetchurl { src = fetchurl {
url = "http://download.tuxfamily.org/blueman/${name}.tar.gz"; url = "https://github.com/blueman-project/blueman/releases/download/${version}/${name}.tar.xz";
sha256 = "04ghlh4h5bwp9mqr5jxcmjm01595l5fq5561qxvf369fvjy63cjh"; sha256 = "09aqlk4c2qzqpmyf7b40sic7d45c1l8fyrb9f3s22b8w83j0adi4";
}; };
configureFlags = "--disable-polkit"; nativeBuildInputs = [ intltool pkgconfig pythonPackages.wrapPython pythonPackages.cython ];
buildInputs = buildInputs = [ bluez gtk3 pythonPackages.python libnotify dconf ]
[ pkgconfig intltool python pyrex pygobject pygtk notify pythonDBus ++ pythonPath
bluez glib gtk libstartup_notification makeWrapper ++ lib.optional withPulseAudio libpulseaudio;
];
# !!! Ugly. postPatch = lib.optionalString withPulseAudio ''
PYTHONPATH = "${pygobject}/lib/${python.libPrefix}/site-packages/gtk-2.0:${pygtk}/lib/${python.libPrefix}/site-packages/gtk-2.0:${notify}/lib/${python.libPrefix}/site-packages/gtk-2.0"; sed -i 's,CDLL(",CDLL("${libpulseaudio}/lib/,g' blueman/main/PulseAudioUtils.py
'';
postInstall = pythonPath = with pythonPackages; [ dbus pygobject3 ];
''
# Create wrappers that set the environment correctly.
for i in $out/bin/* $out/libexec/*; do
wrapProgram $i \
--set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH" \
--set LD_LIBRARY_PATH "${libpulseaudio}/lib:" \
--prefix PATH : ${xdg_utils}/bin
done
mkdir -p $out/nix-support propagatedUserEnvPkgs = [ obex_data_server ];
echo ${obex_data_server} > $out/nix-support/propagated-user-env-packages
''; # */
meta = { configureFlags = [ (lib.enableFeature withPulseAudio "pulseaudio") ];
homepage = http://blueman-project.org/;
postFixup = ''
makeWrapperArgs="\
--prefix PATH ':' ${binPath} \
--prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH \
--prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \
--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
wrapPythonPrograms
'';
meta = with lib; {
homepage = https://github.com/blueman-project;
description = "GTK+-based Bluetooth Manager"; description = "GTK+-based Bluetooth Manager";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ abbradar ];
}; };
} }

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, pkgconfig, fuse, obexftp}: { stdenv, fetchurl, pkgconfig, fuse, obexftp }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "obexfs-0.12"; name = "obexfs-0.12";
@ -8,12 +8,13 @@ stdenv.mkDerivation rec {
sha256 = "1g3krpygk6swa47vbmp9j9s8ahqqcl9ra8r25ybgzv2d9pmjm9kj"; sha256 = "1g3krpygk6swa47vbmp9j9s8ahqqcl9ra8r25ybgzv2d9pmjm9kj";
}; };
buildInputs = [pkgconfig fuse obexftp]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ fuse obexftp ];
NIX_LDFLAGS = "-lobexftp"; meta = with stdenv.lib; {
meta = {
homepage = http://dev.zuckschwerdt.org/openobex/wiki/ObexFs; homepage = http://dev.zuckschwerdt.org/openobex/wiki/ObexFs;
description = "A tool to mount OBEX-based devices (such as Bluetooth phones)"; description = "A tool to mount OBEX-based devices (such as Bluetooth phones)";
platforms = platforms.linux;
license = licenses.lgpl2Plus;
}; };
} }

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, pkgconfig, openobex, bluez, cmake}: { stdenv, fetchurl, pkgconfig, openobex, bluez, cmake }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "obexftp-0.24"; name = "obexftp-0.24";
@ -8,13 +8,21 @@ stdenv.mkDerivation rec {
sha256 = "0szy7p3y75bd5h4af0j5kf0fpzx2w560fpy4kg3603mz11b9c1xr"; sha256 = "0szy7p3y75bd5h4af0j5kf0fpzx2w560fpy4kg3603mz11b9c1xr";
}; };
buildInputs = [pkgconfig bluez cmake]; nativeBuildInputs = [ pkgconfig cmake ];
propagatedBuildInputs = [openobex]; buildInputs = [ bluez ];
meta = { propagatedBuildInputs = [ openobex ];
# There's no such thing like "bluetooth" library; possibly they meant "bluez" but it links correctly without this.
postFixup = ''
sed -i 's,^Requires: bluetooth,Requires:,' $out/lib/pkgconfig/obexftp.pc
'';
meta = with stdenv.lib; {
homepage = http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp; homepage = http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp;
description = "A library and tool to access files on OBEX-based devices (such as Bluetooth phones)"; description = "A library and tool to access files on OBEX-based devices (such as Bluetooth phones)";
platforms = stdenv.lib.platforms.linux; platforms = platforms.linux;
license = licenses.lgpl2Plus;
}; };
} }

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, pkgconfig, bluez, libusb, cmake}: { stdenv, fetchurl, pkgconfig, bluez, libusb, cmake }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "openobex-1.7.1"; name = "openobex-1.7.1";
@ -8,18 +8,20 @@ stdenv.mkDerivation rec {
sha256 = "0mza0mrdrbcw4yix6qvl31kqy7bdkgxjycr0yx7yl089v5jlc9iv"; sha256 = "0mza0mrdrbcw4yix6qvl31kqy7bdkgxjycr0yx7yl089v5jlc9iv";
}; };
buildInputs = [pkgconfig bluez libusb cmake]; nativeBuildInputs = [ pkgconfig cmake ];
buildInputs = [ bluez libusb ];
configureFlags = "--enable-apps"; configureFlags = [ "--enable-apps" ];
patchPhase = '' patchPhase = ''
sed -i "s!/lib/udev!$out/lib/udev!" udev/CMakeLists.txt sed -i "s!/lib/udev!$out/lib/udev!" udev/CMakeLists.txt
sed -i "/if ( PKGCONFIG_UDEV_FOUND )/,/endif ( PKGCONFIG_UDEV_FOUND )/d" udev/CMakeLists.txt sed -i "/if ( PKGCONFIG_UDEV_FOUND )/,/endif ( PKGCONFIG_UDEV_FOUND )/d" udev/CMakeLists.txt
''; '';
meta = { meta = with stdenv.lib; {
homepage = http://dev.zuckschwerdt.org/openobex/; homepage = http://dev.zuckschwerdt.org/openobex/;
description = "An open source implementation of the Object Exchange (OBEX) protocol"; description = "An open source implementation of the Object Exchange (OBEX) protocol";
platforms = stdenv.lib.platforms.linux; platforms = platforms.linux;
license = licenses.lgpl2Plus;
}; };
} }

View File

@ -1012,7 +1012,8 @@ let
bittornado = callPackage ../tools/networking/p2p/bit-tornado { }; bittornado = callPackage ../tools/networking/p2p/bit-tornado { };
blueman = callPackage ../tools/bluetooth/blueman { blueman = callPackage ../tools/bluetooth/blueman {
inherit (pythonPackages) notify; inherit (gnome3) dconf;
withPulseAudio = config.pulseaudio or true;
}; };
bmrsa = callPackage ../tools/security/bmrsa/11.nix { }; bmrsa = callPackage ../tools/security/bmrsa/11.nix { };
@ -9861,16 +9862,16 @@ let
batctl = callPackage ../os-specific/linux/batman-adv/batctl.nix { }; batctl = callPackage ../os-specific/linux/batman-adv/batctl.nix { };
bluez4 = callPackage ../os-specific/linux/bluez { bluez4 = lowPrio (callPackage ../os-specific/linux/bluez {
pygobject = pygobject3; pygobject = pygobject3;
}; });
bluez5 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5.nix { }); bluez5 = callPackage ../os-specific/linux/bluez/bluez5.nix { };
# Needed for LibreOffice # Needed for LibreOffice
bluez5_28 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5_28.nix { }); bluez5_28 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5_28.nix { });
bluez = bluez4; bluez = bluez5;
inherit (pythonPackages) bedup; inherit (pythonPackages) bedup;