platformio: 6.1.6 -> 6.1.11

https://github.com/platformio/platformio-core/releases/tag/v6.1.7
https://github.com/platformio/platformio-core/releases/tag/v6.1.8
https://github.com/platformio/platformio-core/releases/tag/v6.1.9
https://github.com/platformio/platformio-core/releases/tag/v6.1.10
https://github.com/platformio/platformio-core/releases/tag/v6.1.11

Fixes support for ESP-IDF among other plugins, by replacing the path
to the python interpreter with one that has all dependencies wrapped.

Closes: #227230
Co-Authored-By: Joerie de Gram <j.de.gram@gmail.com>

authored by Martin Weinelt Joerie de Gram and committed by Jörg Thalheim 6f2ef681 be1866d6

+67 -47
+34 -19
pkgs/development/embedded/platformio/core.nix
··· 1 - { stdenv, lib, python3 1 + { lib 2 + , python3Packages 2 3 , fetchFromGitHub 3 - , fetchPypi 4 + , fetchpatch 4 5 , git 5 6 , spdx-license-list-data 7 + , substituteAll 6 8 }: 7 9 8 - with python3.pkgs; buildPythonApplication rec { 10 + 11 + with python3Packages; buildPythonApplication rec { 9 12 pname = "platformio"; 10 - 11 - version = "6.1.6"; 13 + version = "6.1.11"; 14 + pyproject = true; 12 15 13 16 # pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964 14 17 src = fetchFromGitHub { 15 18 owner = "platformio"; 16 19 repo = "platformio-core"; 17 20 rev = "v${version}"; 18 - sha256 = "sha256-BEeMfdmAWqFbQUu8YKKrookQVgmhfZBqXnzeb2gfhms="; 21 + hash = "sha256-NR4UyAt8q5sUGtz1Sy6E8Of7y9WrH9xpcAWzLBeDQmo="; 19 22 }; 20 23 21 24 outputs = [ "out" "udev" ]; 22 25 23 26 patches = [ 24 - ./fix-searchpath.patch 25 - ./use-local-spdx-license-list.patch 27 + (substituteAll { 28 + src = ./interpreter.patch; 29 + interpreter = (python3Packages.python.withPackages (_: propagatedBuildInputs)).interpreter; 30 + }) 31 + (substituteAll { 32 + src = ./use-local-spdx-license-list.patch; 33 + spdx_license_list_data = spdx-license-list-data.json; 34 + }) 26 35 ./missing-udev-rules-nixos.patch 36 + (fetchpatch { 37 + # restore PYTHONPATH when calling scons 38 + # https://github.com/platformio/platformio-core/commit/097de2be98af533578671baa903a3ae825d90b94 39 + url = "https://github.com/platformio/platformio-core/commit/097de2be98af533578671baa903a3ae825d90b94.patch"; 40 + hash = "sha256-yq+/QHCkhAkFND11MbKFiiWT3oF1cHhgWj5JkYjwuY0="; 41 + revert = true; 42 + }) 27 43 ]; 28 44 29 - postPatch = '' 30 - substitute platformio/package/manifest/schema.py platformio/package/manifest/schema.py \ 31 - --subst-var-by SPDX_LICENSE_LIST_DATA '${spdx-license-list-data.json}' 45 + nativeBuildInputs = [ 46 + pythonRelaxDepsHook 47 + setuptools 48 + ]; 32 49 33 - substituteInPlace setup.py \ 34 - --replace 'aiofiles==%s" % ("0.8.0" if PY36 else "22.1.*")' 'aiofiles"' \ 35 - --replace 'starlette==%s" % ("0.19.1" if PY36 else "0.23.*")' 'starlette"' \ 36 - --replace 'uvicorn==%s" % ("0.16.0" if PY36 else "0.20.*")' 'uvicorn"' \ 37 - --replace 'tabulate==%s" % ("0.8.10" if PY36 else "0.9.*")' 'tabulate>=0.8.10,<=0.9"' \ 38 - --replace 'wsproto==%s" % ("1.0.0" if PY36 else "1.2.*")' 'wsproto"' 39 - ''; 50 + pythonRelaxDeps = true; 40 51 41 52 propagatedBuildInputs = [ 42 53 aiofiles ··· 52 63 pyserial 53 64 requests 54 65 semantic-version 66 + setuptools 55 67 spdx-license-list-data.json 56 68 starlette 57 69 tabulate 58 70 uvicorn 59 71 wsproto 60 72 zeroconf 73 + 61 74 ]; 62 75 63 76 preCheck = '' ··· 163 176 ]); 164 177 165 178 passthru = { 166 - python = python3; 179 + python = python3Packages.python; 167 180 }; 168 181 169 182 meta = with lib; { 183 + changelog = "https://github.com/platformio/platformio-core/releases/tag/v${version}"; 170 184 description = "An open source ecosystem for IoT development"; 185 + downloadPage = "https://github.com/platformio/platformio-core"; 171 186 homepage = "https://platformio.org"; 172 187 license = licenses.asl20; 173 188 maintainers = with maintainers; [ mog makefu ];
-13
pkgs/development/embedded/platformio/fix-searchpath.patch
··· 1 - diff --git a/platformio/proc.py b/platformio/proc.py 2 - index 80e50201..15cee5a5 100644 3 - --- a/platformio/proc.py 4 - +++ b/platformio/proc.py 5 - @@ -181,7 +181,7 @@ def copy_pythonpath_to_osenv(): 6 - conditions.append(isdir(join(p, "click")) or isdir(join(p, "platformio"))) 7 - if all(conditions): 8 - _PYTHONPATH.append(p) 9 - - os.environ["PYTHONPATH"] = os.pathsep.join(_PYTHONPATH) 10 - + os.environ["PYTHONPATH"] = os.pathsep.join(sys.path) 11 - 12 - 13 - def where_is_program(program, envpath=None):
+22
pkgs/development/embedded/platformio/interpreter.patch
··· 1 + diff --git a/platformio/proc.py b/platformio/proc.py 2 + index 707245a1..cae17a29 100644 3 + --- a/platformio/proc.py 4 + +++ b/platformio/proc.py 5 + @@ -165,7 +165,7 @@ def is_container(): 6 + 7 + 8 + def get_pythonexe_path(): 9 + - return os.environ.get("PYTHONEXEPATH", os.path.normpath(sys.executable)) 10 + + return "@interpreter@" 11 + 12 + 13 + def copy_pythonpath_to_osenv(): 14 + @@ -181,7 +181,7 @@ def copy_pythonpath_to_osenv(): 15 + ) 16 + if all(conditions): 17 + _PYTHONPATH.append(p) 18 + - os.environ["PYTHONPATH"] = os.pathsep.join(_PYTHONPATH) 19 + + os.environ["PYTHONPATH"] = os.pathsep.join(sys.path) 20 + 21 + 22 + def where_is_program(program, envpath=None):
+5 -3
pkgs/development/embedded/platformio/missing-udev-rules-nixos.patch
··· 1 1 diff --git a/platformio/exception.py b/platformio/exception.py 2 - index ef1d3bab..445174fc 100644 2 + index 80ffb496..ea064f97 100644 3 3 --- a/platformio/exception.py 4 4 +++ b/platformio/exception.py 5 - @@ -57,6 +57,7 @@ class MissedUdevRules(InvalidUdevRules): 5 + @@ -49,6 +49,7 @@ class MissedUdevRules(InvalidUdevRules): 6 6 MESSAGE = ( 7 7 "Warning! Please install `99-platformio-udev.rules`. \nMore details: " 8 8 "https://docs.platformio.org/en/latest/core/installation/udev-rules.html" 9 - + "On NixOS add the platformio-core.udev package to services.udev.packages" 9 + + "On NixOS set `services.udev.packages = with pkgs; [ platformio-core.udev ];`." 10 10 ) 11 + 12 +
+6 -12
pkgs/development/embedded/platformio/use-local-spdx-license-list.patch
··· 1 1 diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py 2 - index 1e5f935a..26d1ac6a 100644 2 + index 95e08108..6c2cfaed 100644 3 3 --- a/platformio/package/manifest/schema.py 4 4 +++ b/platformio/package/manifest/schema.py 5 - @@ -276,9 +276,12 @@ class ManifestSchema(BaseSchema): 5 + @@ -276,9 +276,6 @@ class ManifestSchema(BaseSchema): 6 6 @staticmethod 7 7 @memoized(expire="1h") 8 8 def load_spdx_licenses(): 9 - - version = "3.19" 9 + - version = "3.21" 10 10 - spdx_data_url = ( 11 11 - "https://raw.githubusercontent.com/spdx/license-list-data/" 12 - - "v%s/json/licenses.json" % version 12 + - f"v{version}/json/licenses.json" 13 13 - ) 14 14 - return json.loads(fetch_remote_content(spdx_data_url)) 15 - + # version = "3.19" 16 - + # spdx_data_url = ( 17 - + # "https://raw.githubusercontent.com/spdx/license-list-data/" 18 - + # "v%s/json/licenses.json" % version 19 - + # ) 20 - + # return json.loads(fetch_remote_content(spdx_data_url)) 21 - + with open("@SPDX_LICENSE_LIST_DATA@/json/licenses.json") as f: 22 - + spdx = json.load(f) 15 + + with open("@spdx_license_list_data@/json/licenses.json") as fd: 16 + + spdx = json.load(fd) 23 17 + return spdx