From c664dc8d190b6edad82f587b2a6af71bde94f567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 7 Apr 2018 23:00:21 +0200 Subject: [PATCH] platformio: move out of pythonPackages --- .../arduino/platformio/chrootenv.nix | 41 +++++++++++++------ .../platformio/core.nix} | 9 ++-- .../platformio/fix-searchpath.patch | 0 pkgs/top-level/python-packages.nix | 1 - 4 files changed, 32 insertions(+), 19 deletions(-) rename pkgs/development/{python-modules/platformio/default.nix => arduino/platformio/core.nix} (80%) rename pkgs/development/{python-modules => arduino}/platformio/fix-searchpath.patch (100%) 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/python-modules/platformio/default.nix b/pkgs/development/arduino/platformio/core.nix similarity index 80% rename from pkgs/development/python-modules/platformio/default.nix rename to pkgs/development/arduino/platformio/core.nix index 01d47b45860..9e3005c595c 100644 --- a/pkgs/development/python-modules/platformio/default.nix +++ b/pkgs/development/arduino/platformio/core.nix @@ -1,16 +1,13 @@ { stdenv, buildPythonPackage, fetchPypi -, bottle, click_5, colorama +, bottle, click, colorama , lockfile, pyserial, requests , semantic-version -, isPy3k, isPyPy , git }: -buildPythonPackage rec { - disabled = isPy3k || isPyPy; +buildPythonPackage rec { pname = "platformio"; version="3.5.1"; - name = "${pname}-${version}"; src = fetchPypi { inherit pname version; @@ -18,7 +15,7 @@ buildPythonPackage rec { }; propagatedBuildInputs = [ - bottle click_5 colorama git lockfile + bottle click colorama git lockfile pyserial requests semantic-version ]; diff --git a/pkgs/development/python-modules/platformio/fix-searchpath.patch b/pkgs/development/arduino/platformio/fix-searchpath.patch similarity index 100% rename from pkgs/development/python-modules/platformio/fix-searchpath.patch rename to pkgs/development/arduino/platformio/fix-searchpath.patch diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3d391609d94..52769810e7b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10084,7 +10084,6 @@ in { }; pika-pool = callPackage ../development/python-modules/pika-pool { }; - platformio = callPackage ../development/python-modules/platformio { }; kmsxx = callPackage ../development/libraries/kmsxx { };