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