depot/pkgs/by-name/br/brainflow/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00: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;
};
})