2020-06-29 18:45:06 +01:00
|
|
|
{ lib, buildFHSUserEnv, fetchFromGitHub }:
|
2018-04-07 22:00:21 +01:00
|
|
|
|
2018-01-09 18:59:33 +00:00
|
|
|
let
|
2018-04-07 22:00:21 +01:00
|
|
|
pio-pkgs = pkgs:
|
|
|
|
let
|
2019-09-04 06:59:22 +01:00
|
|
|
python = pkgs.python3.override {
|
2018-04-07 22:00:21 +01:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
platformio = self.callPackage ./core.nix { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in (with pkgs; [
|
2018-01-03 16:12:17 +00:00
|
|
|
zlib
|
2018-05-05 07:32:09 +01:00
|
|
|
git
|
2018-04-07 22:00:21 +01:00
|
|
|
]) ++ (with python.pkgs; [
|
|
|
|
python
|
|
|
|
setuptools
|
|
|
|
pip
|
|
|
|
bottle
|
|
|
|
platformio
|
2016-01-06 09:05:19 +00:00
|
|
|
]);
|
2018-04-07 22:00:21 +01:00
|
|
|
|
2020-06-29 18:45:06 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "platformio";
|
|
|
|
repo = "platformio-core";
|
2020-09-12 16:27:02 +01:00
|
|
|
rev = "v5.0.1";
|
|
|
|
sha256 = "01xh61ldilg6fg95l1p870rld2xffhnl9f9ndvbi5jdn8q634pmw";
|
2020-06-29 18:45:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-04-07 22:00:21 +01:00
|
|
|
in buildFHSUserEnv {
|
2018-01-09 18:59:33 +00:00
|
|
|
name = "platformio";
|
|
|
|
|
|
|
|
targetPkgs = pio-pkgs;
|
|
|
|
multiPkgs = pio-pkgs;
|
2016-01-06 09:05:19 +00:00
|
|
|
|
2018-04-07 22:00:21 +01:00
|
|
|
meta = with lib; {
|
2016-08-02 18:50:55 +01:00
|
|
|
description = "An open source ecosystem for IoT development";
|
2019-09-04 06:59:22 +01:00
|
|
|
homepage = "https://platformio.org";
|
2016-08-02 18:50:55 +01:00
|
|
|
maintainers = with maintainers; [ mog ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = with platforms; linux;
|
2016-01-06 09:05:19 +00:00
|
|
|
};
|
|
|
|
|
2018-01-03 16:12:17 +00:00
|
|
|
extraInstallCommands = ''
|
2020-06-29 18:45:06 +01:00
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
|
2018-01-03 16:12:17 +00:00
|
|
|
ln -s $out/bin/platformio $out/bin/pio
|
2020-06-29 18:45:06 +01:00
|
|
|
ln -s ${src}/scripts/99-platformio-udev.rules $out/lib/udev/rules.d/99-platformio-udev.rules
|
2018-01-03 16:12:17 +00:00
|
|
|
'';
|
|
|
|
|
2016-01-06 09:05:19 +00:00
|
|
|
runScript = "platformio";
|
|
|
|
}
|