mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
Merge pull request #92000 from f4814/platformio-udev
platformio: Add udev rules to package output
This commit is contained in:
commit
0057be6ebc
@ -1,4 +1,4 @@
|
||||
{ lib, buildFHSUserEnv }:
|
||||
{ lib, buildFHSUserEnv, fetchFromGitHub }:
|
||||
|
||||
let
|
||||
pio-pkgs = pkgs:
|
||||
@ -19,6 +19,14 @@ let
|
||||
platformio
|
||||
]);
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "platformio";
|
||||
repo = "platformio-core";
|
||||
rev = "v4.3.4";
|
||||
sha256 = "0vf2j79319ypr4yrdmx84853igkb188sjfvlxgw06rlsvsm3kacq";
|
||||
};
|
||||
|
||||
|
||||
in buildFHSUserEnv {
|
||||
name = "platformio";
|
||||
|
||||
@ -34,7 +42,10 @@ in buildFHSUserEnv {
|
||||
};
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p $out/lib/udev/rules.d
|
||||
|
||||
ln -s $out/bin/platformio $out/bin/pio
|
||||
ln -s ${src}/scripts/99-platformio-udev.rules $out/lib/udev/rules.d/99-platformio-udev.rules
|
||||
'';
|
||||
|
||||
runScript = "platformio";
|
||||
|
@ -82,6 +82,7 @@ in buildPythonApplication rec {
|
||||
patches = [
|
||||
./fix-searchpath.patch
|
||||
./use-local-spdx-license-list.patch
|
||||
./missing-udev-rules-nixos.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
@ -0,0 +1,14 @@
|
||||
diff --git a/platformio/exception.py b/platformio/exception.py
|
||||
index d291ad7f..4761a35b 100644
|
||||
--- a/platformio/exception.py
|
||||
+++ b/platformio/exception.py
|
||||
@@ -195,7 +195,8 @@ class MissedUdevRules(InvalidUdevRules):
|
||||
|
||||
MESSAGE = (
|
||||
"Warning! Please install `99-platformio-udev.rules`. \nMode details: "
|
||||
- "https://docs.platformio.org/en/latest/faq.html#platformio-udev-rules"
|
||||
+ "https://docs.platformio.org/en/latest/faq.html#platformio-udev-rules\n"
|
||||
+ "On NixOS add the platformio package to services.udev.packages"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user