depot/third_party/nixpkgs/pkgs/by-name/br/brainflow/package.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

67 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
bluez,
cmake,
dbus,
libftdi1,
nix-update-script,
pkg-config,
useLibFTDI ? true,
useOpenMP ? true,
buildBluetooth ? true,
buildBluetoothLowEnergy ? true,
buildONNX ? true,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "brainflow";
version = "5.14.0";
src = fetchFromGitHub {
owner = "brainflow-dev";
repo = "brainflow";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-cnItKuOu4ez54mAyRuk8PDC3oKKUIqdkAUuuaxNs5Z8=";
};
patches = [ ];
cmakeFlags = [
(lib.cmakeBool "USE_LIBFTDI" useLibFTDI)
(lib.cmakeBool "USE_OPENMP" useOpenMP)
(lib.cmakeBool "BUILD_OYMOTION_SDK" false) # Needs a "GFORCE_SDK"
(lib.cmakeBool "BUILD_BLUETOOTH" buildBluetooth)
(lib.cmakeBool "BUILD_BLE" buildBluetoothLowEnergy)
(lib.cmakeBool "BUILD_ONNX" buildONNX)
];
buildInputs =
[ dbus ]
++ lib.optional (buildBluetooth || buildBluetoothLowEnergy) bluez
++ lib.optional useLibFTDI libftdi1;
nativeBuildInputs = [
cmake
pkg-config
];
postPatch = ''
find . -type f -name 'build.cmake' -exec \
sed -i 's/DESTINATION inc/DESTINATION include/g' {} \;
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "A library to obtain, parse and analyze data (EEG, EMG, ECG) from biosensors";
homepage = "https://brainflow.org/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
pandapip1
ziguana
];
platforms = lib.platforms.all;
};
})