tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
bluez4: remove, unused and probably vulnerable
Franz Pletz
8 years ago
94bbe7db
dadb16a5
+63
-118
3 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
bluez
bluez5.nix
default.nix
top-level
all-packages.nix
-91
pkgs/os-specific/linux/bluez/bluez5.nix
···
1
-
{ stdenv, fetchurl, pkgconfig, dbus, glib, alsaLib,
2
-
pythonPackages, readline, libsndfile, udev, libical,
3
-
systemd, enableWiimote ? false }:
4
-
5
-
assert stdenv.isLinux;
6
-
7
-
stdenv.mkDerivation rec {
8
-
name = "bluez-5.47";
9
-
10
-
src = fetchurl {
11
-
url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
12
-
sha256 = "1j22hfjz0fp4pgclgz9mfcwjbr4wqgah3gd2qhfg4r6msmybyxfg";
13
-
};
14
-
15
-
pythonPath = with pythonPackages;
16
-
[ dbus pygobject2 pygobject3 recursivePthLoader ];
17
-
18
-
buildInputs =
19
-
[ pkgconfig dbus glib alsaLib pythonPackages.python pythonPackages.wrapPython
20
-
readline libsndfile udev libical
21
-
# Disables GStreamer; not clear what it gains us other than a
22
-
# zillion extra dependencies.
23
-
# gstreamer gst-plugins-base
24
-
];
25
-
26
-
outputs = [ "out" "dev" "test" ];
27
-
28
-
patches = [ ./bluez-5.37-obexd_without_systemd-1.patch ];
29
-
30
-
preConfigure = ''
31
-
substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
32
-
substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
33
-
'';
34
-
35
-
configureFlags = [
36
-
"--localstatedir=/var"
37
-
"--enable-library"
38
-
"--enable-cups"
39
-
"--enable-pie"
40
-
"--with-dbusconfdir=$(out)/etc"
41
-
"--with-dbussystembusdir=$(out)/share/dbus-1/system-services"
42
-
"--with-dbussessionbusdir=$(out)/share/dbus-1/services"
43
-
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
44
-
"--with-systemduserunitdir=$(out)/etc/systemd/user"
45
-
"--with-udevdir=$(out)/lib/udev"
46
-
] ++
47
-
stdenv.lib.optional enableWiimote [ "--enable-wiimote" ];
48
-
49
-
# Work around `make install' trying to create /var/lib/bluetooth.
50
-
installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
51
-
52
-
makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
53
-
54
-
# FIXME: Move these into a separate package to prevent Bluez from
55
-
# depending on Python etc.
56
-
postInstall = ''
57
-
mkdir -p $test/test
58
-
cp -a test $test
59
-
pushd $test/test
60
-
for a in \
61
-
simple-agent \
62
-
test-adapter \
63
-
test-device \
64
-
test-thermometer \
65
-
list-devices \
66
-
monitor-bluetooth \
67
-
; do
68
-
ln -s ../test/$a $out/bin/bluez-$a
69
-
done
70
-
popd
71
-
wrapPythonProgramsIn $test/test "$test/test $pythonPath"
72
-
73
-
# for bluez4 compatibility for NixOS
74
-
mkdir $out/sbin
75
-
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
76
-
ln -s ../libexec/bluetooth/obexd $out/sbin/obexd
77
-
78
-
# Add extra configuration
79
-
mkdir $out/etc/bluetooth
80
-
ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf
81
-
'';
82
-
83
-
enableParallelBuilding = true;
84
-
85
-
meta = with stdenv.lib; {
86
-
homepage = http://www.bluez.org/;
87
-
repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
88
-
description = "Bluetooth support for Linux";
89
-
platforms = platforms.linux;
90
-
};
91
-
}
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
+62
-24
pkgs/os-specific/linux/bluez/default.nix
···
1
-
{ stdenv, fetchurl, pkgconfig, dbus, glib, libusb, alsaLib, pythonPackages, makeWrapper
2
-
, readline, libsndfile }:
0
3
4
assert stdenv.isLinux;
5
6
-
let
7
-
inherit (pythonPackages) python;
8
-
pythonpath = "${pythonPackages.dbus-python}/lib/${python.libPrefix}/site-packages:"
9
-
+ "${pythonPackages.pygobject2}/lib/${python.libPrefix}/site-packages";
10
-
in stdenv.mkDerivation rec {
11
-
name = "bluez-4.101";
12
-
13
src = fetchurl {
14
-
url = "mirror://kernel/linux/bluetooth/${name}.tar.gz";
15
-
sha256 = "11vldy255zkmmpj0g0a1m6dy9bzsmyd7vxy02cdfdw79ml888wsr";
16
};
0
0
0
17
18
buildInputs =
19
-
[ pkgconfig dbus glib libusb alsaLib python makeWrapper
20
-
readline libsndfile
21
# Disables GStreamer; not clear what it gains us other than a
22
# zillion extra dependencies.
23
-
# gstreamer gst-plugins-base
24
];
25
0
0
0
0
0
0
0
0
0
26
configureFlags = [
27
"--localstatedir=/var"
0
28
"--enable-cups"
29
-
"--with-systemdunitdir=$(out)/etc/systemd/system"
30
-
];
0
0
0
0
0
0
0
31
32
# Work around `make install' trying to create /var/lib/bluetooth.
33
installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
34
35
makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
36
37
-
/* !!! Move these into a separate package to prevent Bluez from
38
-
depending on Python etc. */
39
postInstall = ''
40
-
pushd test
41
-
for a in simple-agent test-adapter test-device test-input; do
42
-
cp $a $out/bin/bluez-$a
43
-
wrapProgram $out/bin/bluez-$a --prefix PYTHONPATH : ${pythonpath}
0
0
0
0
0
0
0
0
44
done
45
popd
0
0
0
0
0
0
0
0
0
0
46
'';
47
48
-
meta = {
0
0
49
homepage = http://www.bluez.org/;
0
50
description = "Bluetooth support for Linux";
51
-
platforms = stdenv.lib.platforms.linux;
52
};
53
}
···
1
+
{ stdenv, fetchurl, pkgconfig, dbus, glib, alsaLib,
2
+
pythonPackages, readline, libsndfile, udev, libical,
3
+
systemd, enableWiimote ? false }:
4
5
assert stdenv.isLinux;
6
7
+
stdenv.mkDerivation rec {
8
+
name = "bluez-5.47";
9
+
0
0
0
0
10
src = fetchurl {
11
+
url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
12
+
sha256 = "1j22hfjz0fp4pgclgz9mfcwjbr4wqgah3gd2qhfg4r6msmybyxfg";
13
};
14
+
15
+
pythonPath = with pythonPackages;
16
+
[ dbus pygobject2 pygobject3 recursivePthLoader ];
17
18
buildInputs =
19
+
[ pkgconfig dbus glib alsaLib pythonPackages.python pythonPackages.wrapPython
20
+
readline libsndfile udev libical
21
# Disables GStreamer; not clear what it gains us other than a
22
# zillion extra dependencies.
23
+
# gstreamer gst-plugins-base
24
];
25
26
+
outputs = [ "out" "dev" "test" ];
27
+
28
+
patches = [ ./bluez-5.37-obexd_without_systemd-1.patch ];
29
+
30
+
preConfigure = ''
31
+
substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
32
+
substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
33
+
'';
34
+
35
configureFlags = [
36
"--localstatedir=/var"
37
+
"--enable-library"
38
"--enable-cups"
39
+
"--enable-pie"
40
+
"--with-dbusconfdir=$(out)/etc"
41
+
"--with-dbussystembusdir=$(out)/share/dbus-1/system-services"
42
+
"--with-dbussessionbusdir=$(out)/share/dbus-1/services"
43
+
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
44
+
"--with-systemduserunitdir=$(out)/etc/systemd/user"
45
+
"--with-udevdir=$(out)/lib/udev"
46
+
] ++
47
+
stdenv.lib.optional enableWiimote [ "--enable-wiimote" ];
48
49
# Work around `make install' trying to create /var/lib/bluetooth.
50
installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
51
52
makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
53
54
+
# FIXME: Move these into a separate package to prevent Bluez from
55
+
# depending on Python etc.
56
postInstall = ''
57
+
mkdir -p $test/test
58
+
cp -a test $test
59
+
pushd $test/test
60
+
for a in \
61
+
simple-agent \
62
+
test-adapter \
63
+
test-device \
64
+
test-thermometer \
65
+
list-devices \
66
+
monitor-bluetooth \
67
+
; do
68
+
ln -s ../test/$a $out/bin/bluez-$a
69
done
70
popd
71
+
wrapPythonProgramsIn $test/test "$test/test $pythonPath"
72
+
73
+
# for bluez4 compatibility for NixOS
74
+
mkdir $out/sbin
75
+
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
76
+
ln -s ../libexec/bluetooth/obexd $out/sbin/obexd
77
+
78
+
# Add extra configuration
79
+
mkdir $out/etc/bluetooth
80
+
ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf
81
'';
82
83
+
enableParallelBuilding = true;
84
+
85
+
meta = with stdenv.lib; {
86
homepage = http://www.bluez.org/;
87
+
repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
88
description = "Bluetooth support for Linux";
89
+
platforms = platforms.linux;
90
};
91
}
+1
-3
pkgs/top-level/all-packages.nix
···
11924
11925
blktrace = callPackage ../os-specific/linux/blktrace { };
11926
11927
-
bluez5 = callPackage ../os-specific/linux/bluez/bluez5.nix { };
11928
-
11929
-
bluez4 = callPackage ../os-specific/linux/bluez { };
11930
11931
# Needed for LibreOffice
11932
bluez5_28 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5_28.nix { });
···
11924
11925
blktrace = callPackage ../os-specific/linux/blktrace { };
11926
11927
+
bluez5 = callPackage ../os-specific/linux/bluez { };
0
0
11928
11929
# Needed for LibreOffice
11930
bluez5_28 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5_28.nix { });