depot/third_party/nixpkgs/pkgs/development/arduino/platformio/chrootenv.nix
Default email a4fd2de975 Project import generated by Copybara.
GitOrigin-RevId: 34ad166a830d3ac1541dcce571c52231f2f0865a
2020-11-02 21:18:15 -05:00

52 lines
1.1 KiB
Nix

{ lib, buildFHSUserEnv, fetchFromGitHub }:
let
pio-pkgs = pkgs:
let
python = pkgs.python3.override {
packageOverrides = self: super: {
platformio = self.callPackage ./core.nix { };
};
};
in (with pkgs; [
zlib
git
]) ++ (with python.pkgs; [
python
setuptools
pip
bottle
platformio
]);
src = fetchFromGitHub {
owner = "platformio";
repo = "platformio-core";
rev = "v5.0.2";
sha256 = "1hbw8nbllyj0xyx1rz2chx9vyqf9949dcdx4v9hnfbsjwwpcfi0a";
};
in buildFHSUserEnv {
name = "platformio";
targetPkgs = pio-pkgs;
multiPkgs = pio-pkgs;
meta = with lib; {
description = "An open source ecosystem for IoT development";
homepage = "https://platformio.org";
maintainers = with maintainers; [ mog ];
license = licenses.asl20;
platforms = with platforms; linux;
};
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";
}