2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, fetchpatch, fetchFromGitHub
|
2021-05-28 09:39:13 +00:00
|
|
|
, cmake, git
|
|
|
|
, asio, catch2, spdlog
|
|
|
|
, IOKit, udev
|
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pc-ble-driver";
|
2021-05-28 09:39:13 +00:00
|
|
|
version = "4.1.4";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NordicSemiconductor";
|
|
|
|
repo = "pc-ble-driver";
|
|
|
|
rev = "v${version}";
|
2021-05-28 09:39:13 +00:00
|
|
|
sha256 = "1609x17sbfi668jfwyvnfk9z29w6cgzvgv67xcpvpx5jv0czpcdj";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
patches = [
|
|
|
|
# Fix build with GCC 11
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/NordicSemiconductor/pc-ble-driver/commit/37258e65bdbcd0b4369ae448faf650dd181816ec.patch";
|
|
|
|
sha256 = "sha256-gOdzIW8YJQC+PE4FJd644I1+I7CMcBY8wpF6g02eI5g=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DNRF_BLE_DRIVER_VERSION=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake git ];
|
2021-05-28 09:39:13 +00:00
|
|
|
buildInputs = [ asio catch2 spdlog ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-08-20 17:08:02 +00:00
|
|
|
IOKit
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-08-20 17:08:02 +00:00
|
|
|
udev
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Desktop library for Bluetooth low energy development";
|
|
|
|
homepage = "https://github.com/NordicSemiconductor/pc-ble-driver";
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|