platformio-core: expose unwrapped platformio as platformio-core

PlatformIO is a pure python package that is in turn a package
manager. In a pure NixOS environment, this means that any downloaded
binary packages will not run. To make PlatformIO usable, there's a
chrootenv wrapper. However, in a mixed environment like other linux or
darwin, the pure python version will work, and in the case of darwin
only the pure version will work, since the chrootenv wrapper is not
supported.

To handle the above use cases we have:

 * platformio -- unwrapped on darwin, wrapped on linux. Should always
                 provide a functional platformio.

 * platformio-core -- always unwrapped (like "bintools-unwrapped") for
                      when the wrapper is explicitly not required. For
                      example, on other linux where the chrootenv is
                      not supported.
This commit is contained in:
Andrew Childs 2022-03-30 00:29:08 +09:00
parent dd3dfc468f
commit 119a521977
3 changed files with 6 additions and 4 deletions

View file

@ -4,9 +4,9 @@ let
pio-pkgs = pkgs: pio-pkgs = pkgs:
let let
python = pkgs.python3; python = pkgs.python3;
platformio = python.pkgs.callPackage ./core.nix { inherit version src; };
in in
(with pkgs; [ (with pkgs; [
platformio-core
zlib zlib
git git
xdg-user-dirs xdg-user-dirs
@ -15,7 +15,6 @@ let
setuptools setuptools
pip pip
bottle bottle
platformio
]); ]);
in in

View file

@ -1,4 +1,4 @@
{ newScope, fetchFromGitHub }: { newScope, fetchFromGitHub, python3Packages }:
let let
callPackage = newScope self; callPackage = newScope self;
@ -14,6 +14,8 @@ let
}; };
self = { self = {
platformio-core = python3Packages.callPackage ./core.nix { inherit version src; };
platformio-chrootenv = callPackage ./chrootenv.nix { inherit version src; }; platformio-chrootenv = callPackage ./chrootenv.nix { inherit version src; };
}; };

View file

@ -11105,7 +11105,8 @@ with pkgs;
}; };
platformioPackages = dontRecurseIntoAttrs (callPackage ../development/embedded/platformio { }); platformioPackages = dontRecurseIntoAttrs (callPackage ../development/embedded/platformio { });
platformio = platformioPackages.platformio-chrootenv; platformio = if stdenv.isLinux then platformioPackages.platformio-chrootenv else platformioPackages.platformio-core;
platformio-core = platformioPackages.platformio-core;
platinum-searcher = callPackage ../tools/text/platinum-searcher { }; platinum-searcher = callPackage ../tools/text/platinum-searcher { };