nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 bluez,
6 cmake,
7 dbus,
8 libftdi1,
9 nix-update-script,
10 pkg-config,
11 useLibFTDI ? true,
12 useOpenMP ? true,
13 buildBluetooth ? true,
14 buildBluetoothLowEnergy ? true,
15 buildONNX ? true,
16}:
17
18stdenv.mkDerivation (finalAttrs: {
19 pname = "brainflow";
20 version = "5.20.1";
21
22 src = fetchFromGitHub {
23 owner = "brainflow-dev";
24 repo = "brainflow";
25 tag = finalAttrs.version;
26 hash = "sha256-eQgjEFYEuJXLNB+qeWLeN3ZRmq1lR5qpcFcPgHn8Az8=";
27 };
28
29 patches = [ ];
30
31 cmakeFlags = [
32 (lib.cmakeBool "USE_LIBFTDI" useLibFTDI)
33 (lib.cmakeBool "USE_OPENMP" useOpenMP)
34 (lib.cmakeBool "BUILD_OYMOTION_SDK" false) # Needs a "GFORCE_SDK"
35 (lib.cmakeBool "BUILD_BLUETOOTH" buildBluetooth)
36 (lib.cmakeBool "BUILD_BLE" buildBluetoothLowEnergy)
37 (lib.cmakeBool "BUILD_ONNX" buildONNX)
38 ];
39
40 buildInputs = [
41 dbus
42 ]
43 ++ lib.optional (buildBluetooth || buildBluetoothLowEnergy) bluez
44 ++ lib.optional useLibFTDI libftdi1;
45
46 nativeBuildInputs = [
47 cmake
48 pkg-config
49 ];
50
51 postPatch = ''
52 find . -type f -name 'build.cmake' -exec \
53 sed -i 's/DESTINATION inc/DESTINATION include/g' {} \;
54 '';
55
56 passthru.updateScript = nix-update-script { };
57
58 meta = {
59 description = "Library to obtain, parse and analyze data (EEG, EMG, ECG) from biosensors";
60 homepage = "https://brainflow.org/";
61 license = lib.licenses.mit;
62 maintainers = with lib.maintainers; [
63 pandapip1
64 ziguana
65 ];
66 platforms = lib.platforms.all;
67 };
68})