diff options
author | Robert Schütz <robert.schuetz@stud.uni-heidelberg.de> | 2018-04-07 23:00:21 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2018-04-08 11:36:07 +0200 |
commit | c664dc8d190b6edad82f587b2a6af71bde94f567 (patch) | |
tree | 112089e510ca2b20bd27d99049e0243e0f76c8a6 /pkgs/development/arduino | |
parent | a7bcc079fa0dc63ba04d2f1c9540d2709bb0cd9e (diff) |
platformio: move out of pythonPackages
Diffstat (limited to 'pkgs/development/arduino')
-rw-r--r-- | pkgs/development/arduino/platformio/chrootenv.nix | 41 | ||||
-rw-r--r-- | pkgs/development/arduino/platformio/core.nix | 30 | ||||
-rw-r--r-- | pkgs/development/arduino/platformio/fix-searchpath.patch | 11 |
3 files changed, 70 insertions, 12 deletions
diff --git a/pkgs/development/arduino/platformio/chrootenv.nix b/pkgs/development/arduino/platformio/chrootenv.nix index 69182c3aa0d..f46e705fb90 100644 --- a/pkgs/development/arduino/platformio/chrootenv.nix +++ b/pkgs/development/arduino/platformio/chrootenv.nix @@ -1,23 +1,40 @@ -{ stdenv, lib, buildFHSUserEnv -}: +{ lib, buildFHSUserEnv }: + let - pio-pkgs = pkgs: (with pkgs; - [ - python27Packages.python - python27Packages.setuptools - python27Packages.pip - python27Packages.bottle - python27Packages.platformio + pio-pkgs = pkgs: + let + python = pkgs.python.override { + packageOverrides = self: super: { + + # https://github.com/platformio/platformio-core/issues/349 + click = super.click.overridePythonAttrs (oldAttrs: rec { + version = "5.1"; + src = oldAttrs.src.override { + inherit version; + sha256 = "678c98275431fad324275dec63791e4a17558b40e5a110e20a82866139a85a5a"; + }; + }); + + platformio = self.callPackage ./core.nix { }; + }; + }; + in (with pkgs; [ zlib + ]) ++ (with python.pkgs; [ + python + setuptools + pip + bottle + platformio ]); -in -buildFHSUserEnv { + +in buildFHSUserEnv { name = "platformio"; targetPkgs = pio-pkgs; multiPkgs = pio-pkgs; - meta = with stdenv.lib; { + meta = with lib; { description = "An open source ecosystem for IoT development"; homepage = http://platformio.org; maintainers = with maintainers; [ mog ]; diff --git a/pkgs/development/arduino/platformio/core.nix b/pkgs/development/arduino/platformio/core.nix new file mode 100644 index 00000000000..9e3005c595c --- /dev/null +++ b/pkgs/development/arduino/platformio/core.nix @@ -0,0 +1,30 @@ +{ stdenv, buildPythonPackage, fetchPypi +, bottle, click, colorama +, lockfile, pyserial, requests +, semantic-version +, git +}: + +buildPythonPackage rec { + pname = "platformio"; + version="3.5.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0cc15mzh7p1iykip0jpxldz81yz946vrgvhwmfl8w3z5kgjjgx3n"; + }; + + propagatedBuildInputs = [ + bottle click colorama git lockfile + pyserial requests semantic-version + ]; + + patches = [ ./fix-searchpath.patch ]; + + meta = with stdenv.lib; { + description = "An open source ecosystem for IoT development"; + homepage = http://platformio.org; + maintainers = with maintainers; [ mog makefu ]; + license = licenses.asl20; + }; +} diff --git a/pkgs/development/arduino/platformio/fix-searchpath.patch b/pkgs/development/arduino/platformio/fix-searchpath.patch new file mode 100644 index 00000000000..a215ffc7d61 --- /dev/null +++ b/pkgs/development/arduino/platformio/fix-searchpath.patch @@ -0,0 +1,11 @@ +--- ./platformio/util.py-old 2017-09-29 01:20:08.174548250 +0200 ++++ ./platformio/util.py 2017-09-29 01:19:48.410485308 +0200 +@@ -395,7 +395,7 @@ + isdir(join(p, "click")) or isdir(join(p, "platformio"))) + if all(conditions): + _PYTHONPATH.append(p) +- os.environ['PYTHONPATH'] = os.pathsep.join(_PYTHONPATH) ++ os.environ['PYTHONPATH'] = os.pathsep.join(sys.path) + + + def get_serialports(filter_hwid=False): |