Merge pull request #224175 from adisbladis/platformio-udev-multi

platformio: make multi-output
This commit is contained in:
adisbladis
2023-04-12 21:40:36 +12:00
committed by GitHub
4 changed files with 29 additions and 22 deletions
@@ -1,9 +1,9 @@
{ lib, buildFHSUserEnv, version, src }:
{ lib, buildFHSUserEnv, platformio-core }:
let
pio-pkgs = pkgs:
let
python = pkgs.python3;
inherit (platformio-core) python;
in
(with pkgs; [
platformio-core
@@ -35,10 +35,8 @@ buildFHSUserEnv {
};
extraInstallCommands = ''
mkdir -p $out/lib/udev/rules.d
ln -s $out/bin/platformio $out/bin/pio
ln -s ${src}/platformio/assets/system/99-platformio-udev.rules $out/lib/udev/rules.d/99-platformio-udev.rules
ln -s ${platformio-core.udev}/lib $out/lib
'';
runScript = "platformio";
+23 -2
View File
@@ -3,12 +3,22 @@
, fetchPypi
, git
, spdx-license-list-data
, version, src
}:
with python3.pkgs; buildPythonApplication rec {
pname = "platformio";
inherit version src;
version = "6.1.6";
# pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964
src = fetchFromGitHub {
owner = "platformio";
repo = "platformio-core";
rev = "v${version}";
sha256 = "sha256-BEeMfdmAWqFbQUu8YKKrookQVgmhfZBqXnzeb2gfhms=";
};
outputs = [ "out" "udev" ];
patches = [
./fix-searchpath.patch
@@ -60,6 +70,13 @@ with python3.pkgs; buildPythonApplication rec {
pytestCheckHook
];
# Install udev rules into a separate output so all of platformio-core is not a dependency if
# you want to use the udev rules on NixOS but not install platformio in your system packages.
postInstall = ''
mkdir -p $udev/lib/udev/rules.d/99-platformio-udev.rules
cp platformio/assets/system/99-platformio-udev.rules $udev/lib/udev/rules.d/99-platformio-udev.rules
'';
disabledTestPaths = [
"tests/commands/pkg/test_install.py"
"tests/commands/pkg/test_list.py"
@@ -145,6 +162,10 @@ with python3.pkgs; buildPythonApplication rec {
"test_pkgmanifest.py::test_packages"
]);
passthru = {
python = python3;
};
meta = with lib; {
description = "An open source ecosystem for IoT development";
homepage = "https://platformio.org";
@@ -3,20 +3,10 @@
let
callPackage = newScope self;
version = "6.1.6";
# pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964
src = fetchFromGitHub {
owner = "platformio";
repo = "platformio-core";
rev = "v${version}";
sha256 = "sha256-BEeMfdmAWqFbQUu8YKKrookQVgmhfZBqXnzeb2gfhms=";
};
self = {
platformio-core = python3Packages.callPackage ./core.nix { inherit version src; };
platformio-core = python3Packages.callPackage ./core.nix { };
platformio-chrootenv = callPackage ./chrootenv.nix { inherit version src; };
platformio-chrootenv = callPackage ./chrootenv.nix { };
};
in
@@ -6,7 +6,5 @@ index ef1d3bab..445174fc 100644
MESSAGE = (
"Warning! Please install `99-platformio-udev.rules`. \nMore details: "
"https://docs.platformio.org/en/latest/core/installation/udev-rules.html"
+ "On NixOS add the platformio package to services.udev.packages"
+ "On NixOS add the platformio-core.udev package to services.udev.packages"
)