about summary refs log tree commit diff
path: root/pkgs/development/arduino
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2020-01-19 23:51:45 +0100
committerFranz Pletz <fpletz@fnordicwalking.de>2020-01-27 11:50:09 +0100
commit8c6f35a60713a7831f2729fb974eb1f65a4d79ec (patch)
tree636bfb847f2edf379fbd144ef35c5b1a60d9ad44 /pkgs/development/arduino
parentc5d06b022b22d0e542ce2ffd0fe092317758fb03 (diff)
platformio: 4.0.3 -> 4.1.0
Diffstat (limited to 'pkgs/development/arduino')
-rw-r--r--pkgs/development/arduino/platformio/core.nix33
-rw-r--r--pkgs/development/arduino/platformio/fix-searchpath.patch16
-rw-r--r--pkgs/development/arduino/platformio/use-local-spdx-license-list.patch16
3 files changed, 49 insertions, 16 deletions
diff --git a/pkgs/development/arduino/platformio/core.nix b/pkgs/development/arduino/platformio/core.nix
index bfe216c6ad397..7beb2cba9c50e 100644
--- a/pkgs/development/arduino/platformio/core.nix
+++ b/pkgs/development/arduino/platformio/core.nix
@@ -1,8 +1,9 @@
-{ stdenv, lib, buildPythonApplication, fetchFromGitHub
-, bottle, click, colorama
+{ stdenv, lib, buildPythonApplication, fetchFromGitHub, fetchpatch
+, bottle, click, colorama, semantic-version
 , lockfile, pyserial, requests
-, pytest, semantic-version, tox, tabulate
-, git
+, tabulate, pyelftools, marshmallow
+, pytest, tox, jsondiff
+, git, spdx-license-list-data
 }:
 
 let
@@ -39,6 +40,7 @@ let
     "test_pkgmanifest.py::test_packages"
   ]) ++ (map (e: "--ignore=tests/${e}") [
     "commands/test_boards.py"
+    "commands/test_check.py"
     "commands/test_platform.py"
     "commands/test_update.py"
     "test_maintenance.py"
@@ -47,25 +49,25 @@ let
 
 in buildPythonApplication rec {
   pname = "platformio";
-  version = "4.0.3";
+  version = "4.1.0";
 
   # pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964
   src = fetchFromGitHub {
     owner = "platformio";
     repo = "platformio-core";
     rev = "v${version}";
-    sha256 = "1naaa53cc7n7zyqggqjvvgkcq8cyzngdf904y9ag0x1vvb70f8j9";
+    sha256 = "10v9jw1zjfqr3wl6kills3cfp0ky7xbm1gc3z0n57wrqbc6cmz95";
   };
 
   propagatedBuildInputs =  [
     bottle click colorama git lockfile
     pyserial requests semantic-version
-    tabulate
+    tabulate pyelftools marshmallow
   ];
 
   HOME = "/tmp";
 
-  checkInputs = [ pytest tox ];
+  checkInputs = [ pytest tox jsondiff ];
 
   checkPhase = ''
     runHook preCheck
@@ -75,7 +77,20 @@ in buildPythonApplication rec {
     runHook postCheck
   '';
 
-  patches = [ ./fix-searchpath.patch ];
+  patches = [
+    ./fix-searchpath.patch
+    (fetchpatch {
+      url = "https://github.com/platformio/platformio-core/commit/442a7e357636522e844d95375c246644b21a7802.patch";
+      sha256 = "0a3kj3k02237gr2yk30gpwc6vm04dsd1wxldj4dsbzs4a9yyi70m";
+      excludes = ["HISTORY.rst"];
+    })
+    ./use-local-spdx-license-list.patch
+  ];
+
+  postPatch = ''
+    substitute platformio/package/manifest/schema.py platformio/package/manifest/schema.py \
+      --subst-var-by SPDX_LICENSE_LIST_DATA '${spdx-license-list-data}'
+  '';
 
   meta = with stdenv.lib; {
     broken = stdenv.isAarch64;
diff --git a/pkgs/development/arduino/platformio/fix-searchpath.patch b/pkgs/development/arduino/platformio/fix-searchpath.patch
index 1570cae1b193a..46e84d15a82f7 100644
--- a/pkgs/development/arduino/platformio/fix-searchpath.patch
+++ b/pkgs/development/arduino/platformio/fix-searchpath.patch
@@ -1,11 +1,13 @@
---- ./platformio/proc.py-old	2017-09-29 01:20:08.174548250 +0200
-+++ ./platformio/proc.py	2017-09-29 01:19:48.410485308 +0200
-@@ -164,7 +164,7 @@
-                 isdir(join(p, "click")) or isdir(join(p, "platformio")))
+diff --git a/platformio/proc.py b/platformio/proc.py
+index 80e50201..15cee5a5 100644
+--- a/platformio/proc.py
++++ b/platformio/proc.py
+@@ -167,7 +167,7 @@ def copy_pythonpath_to_osenv():
+             conditions.append(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)
+-    os.environ["PYTHONPATH"] = os.pathsep.join(_PYTHONPATH)
++    os.environ["PYTHONPATH"] = os.pathsep.join(sys.path)
  
  
- def get_serialports(filter_hwid=False):
+ def where_is_program(program, envpath=None):
diff --git a/pkgs/development/arduino/platformio/use-local-spdx-license-list.patch b/pkgs/development/arduino/platformio/use-local-spdx-license-list.patch
new file mode 100644
index 0000000000000..90251d668bc74
--- /dev/null
+++ b/pkgs/development/arduino/platformio/use-local-spdx-license-list.patch
@@ -0,0 +1,16 @@
+diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py
+index f1d68e08..9b7b1da8 100644
+--- a/platformio/package/manifest/schema.py
++++ b/platformio/package/manifest/schema.py
+@@ -174,9 +174,5 @@ class ManifestSchema(Schema):
+     @staticmethod
+     @memoized(expire="1h")
+     def load_spdx_licenses():
+-        r = requests.get(
+-            "https://raw.githubusercontent.com/spdx/license-list-data"
+-            "/v3.7/json/licenses.json"
+-        )
+-        r.raise_for_status()
+-        return r.json()
++        import json
++        return json.load(open("@SPDX_LICENSE_LIST_DATA@/json/licenses.json"))