mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-03 20:33:21 +00:00
68 lines
1.5 KiB
Nix
68 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.13.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "brainflow-dev";
|
|
repo = "brainflow";
|
|
rev = "refs/tags/${finalAttrs.version}";
|
|
hash = "sha256-LFiDyNuWbEAKU0Rl+n7ozxr5CM4NLphR2o9bYHw6xJY=";
|
|
};
|
|
|
|
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;
|
|
};
|
|
})
|