@@ -0,0 +1,34 @@
1+{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, libbtbb, libpcap , libusb1, bluez
2+, udevGroup ? "ubertooth"
3+}:
4+
5+stdenv.mkDerivation rec {
6+ pname = "ubertooth";
7+ version = "2020-12-R1";
8+
9+ src = fetchFromGitHub {
10+ owner = "greatscottgadgets";
11+ repo = pname;
12+ rev = version;
13+ sha256 = "11r5ag2l5xn4pr7ycicm30w9c3ldn9yiqj1sqnjc79csxl2vrcfw";
14+ };
15+
16+ sourceRoot = "source/host";
17+
18+ nativeBuildInputs = [ cmake pkgconfig ];
19+ buildInputs = [ libbtbb libpcap libusb1 bluez ];
20+
21+ cmakeFlags = lib.optionals stdenv.isLinux [
22+ "-DINSTALL_UDEV_RULES=TRUE"
23+ "-DUDEV_RULES_PATH=etc/udev/rules.d"
24+ "-DUDEV_RULES_GROUP=${udevGroup}"
25+ ];
26+
27+ meta = with stdenv.lib; {
28+ description = "Open source wireless development platform suitable for Bluetooth experimentation";
29+ homepage = "https://github.com/greatscottgadgets/ubertooth";
30+ license = licenses.gpl2;
31+ maintainers = with maintainers; [ oxzi ];
32+ platforms = platforms.linux;
33+ };
34+}