-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Backport release-24.05] brainflow: init at 5.12.1 #328019
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
fetchpatch, | ||
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.12.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "brainflow-dev"; | ||
repo = "brainflow"; | ||
rev = "refs/tags/${finalAttrs.version}"; | ||
hash = "sha256-haQO03nkvLoXtFVe+C+yi+MwM0CFh6rLcLvU8fQ4k/w="; | ||
}; | ||
|
||
patches = [ | ||
# All of these are PRs that were merged into the upstream repository and will be included in the next release | ||
# These should be removed once the next version is released | ||
(fetchpatch { | ||
# Fixes a major issue that prevented the build from working at all (why was this not backported???) | ||
url = "https://github.com/brainflow-dev/brainflow/commit/883b0cd08acb99d7b6e241e92fba2e9a363d17b1.patch"; | ||
hash = "sha256-QQd+BI3I65gfaNS/SKLjCoqbCwPCiTh+nh0tJAZM6hQ="; | ||
}) | ||
(fetchpatch { | ||
# Bumps the version of a python dependency that had a backwards-incompatible change | ||
url = "https://github.com/brainflow-dev/brainflow/commit/ea23a6f0483ce4d6fdd7a82bace865356ee78d7f.patch"; | ||
hash = "sha256-dvMpxxRrnJQ9ADGagB1JhuoB9SNwn755wbHzW/3ECeo="; | ||
}) | ||
(fetchpatch { | ||
# Fixes an incorrect use of an environment variable during the build | ||
url = "https://github.com/brainflow-dev/brainflow/commit/053b8c1253b686cbec49ab4adb47c9ee02d3f99a.patch"; | ||
hash = "sha256-Pfhe1ZvMagfVAGZqeWn1uHXgwlTtkOm+gyWuvC5/Sro="; | ||
}) | ||
]; | ||
|
||
cmakeFlags = with lib; [ | ||
(cmakeBool "USE_LIBFTDI" useLibFTDI) | ||
(cmakeBool "USE_OPENMP" useOpenMP) | ||
(cmakeBool "BUILD_OYMOTION_SDK" false) # Needs a "GFORCE_SDK" | ||
(cmakeBool "BUILD_BLUETOOTH" buildBluetooth) | ||
(cmakeBool "BUILD_BLE" buildBluetoothLowEnergy) | ||
(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; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
buildPythonPackage, | ||
brainflow, | ||
nptyping, | ||
numpy, | ||
python, | ||
setuptools, | ||
}: | ||
|
||
buildPythonPackage { | ||
inherit (brainflow) | ||
pname | ||
version | ||
src | ||
patches | ||
meta | ||
; | ||
|
||
pyproject = true; | ||
build-system = [ setuptools ]; | ||
|
||
dependencies = [ | ||
numpy | ||
nptyping | ||
]; | ||
|
||
buildInputs = [ brainflow ]; | ||
|
||
postPatch = '' | ||
cd python_package | ||
''; | ||
|
||
postInstall = '' | ||
mkdir -p "$out/${python.sitePackages}/brainflow/lib/" | ||
cp -Tr "${brainflow}/lib" "$out/${python.sitePackages}/brainflow/lib/" | ||
''; | ||
|
||
pythonImportsCheck = [ "brainflow" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AndersonTorres, it seems like you're frustrated from seeing this pattern too often, but I don't think it's appropriate to use a smiley face as feedback regardless. Especially when seen by newer contributors, this just makes for an uninviting atmosphere, so I'd appreciate it if you could improve on that 🙂
In this case I'd recommend something like
If you don't want to type this all the time, you could also (in increasing order of difficulty):
with
in Nixpkgs, which both solidifies it as a convention for others to propagate, but also allows you to link to it