uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
48
pkgs/development/embedded/platformio/chrootenv.nix
Normal file
48
pkgs/development/embedded/platformio/chrootenv.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ lib, buildFHSUserEnv, version, src }:
|
||||
|
||||
let
|
||||
pio-pkgs = pkgs:
|
||||
let
|
||||
python = pkgs.python3.override {
|
||||
packageOverrides = self: super: {
|
||||
platformio = self.callPackage ./core.nix { inherit version src; };
|
||||
};
|
||||
};
|
||||
in
|
||||
(with pkgs; [
|
||||
zlib
|
||||
git
|
||||
xdg-user-dirs
|
||||
]) ++ (with python.pkgs; [
|
||||
python
|
||||
setuptools
|
||||
pip
|
||||
bottle
|
||||
platformio
|
||||
]);
|
||||
|
||||
in
|
||||
buildFHSUserEnv {
|
||||
name = "platformio";
|
||||
|
||||
targetPkgs = pio-pkgs;
|
||||
# disabled temporarily because fastdiff no longer support 32bit
|
||||
# multiPkgs = pio-pkgs;
|
||||
|
||||
meta = with lib; {
|
||||
description = "An open source ecosystem for IoT development";
|
||||
homepage = "https://platformio.org";
|
||||
maintainers = with maintainers; [ mog ];
|
||||
license = licenses.asl20;
|
||||
platforms = with platforms; linux;
|
||||
};
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p $out/lib/udev/rules.d
|
||||
|
||||
ln -s $out/bin/platformio $out/bin/pio
|
||||
ln -s ${src}/scripts/99-platformio-udev.rules $out/lib/udev/rules.d/99-platformio-udev.rules
|
||||
'';
|
||||
|
||||
runScript = "platformio";
|
||||
}
|
||||
157
pkgs/development/embedded/platformio/core.nix
Normal file
157
pkgs/development/embedded/platformio/core.nix
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
{ stdenv, lib, python3
|
||||
, fetchFromGitHub
|
||||
, fetchPypi
|
||||
, git
|
||||
, spdx-license-list-data
|
||||
, version, src
|
||||
}:
|
||||
|
||||
let
|
||||
python = python3.override {
|
||||
packageOverrides = self: super: {
|
||||
starlette = super.starlette.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "0.20.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "encode";
|
||||
repo = "starlette";
|
||||
rev = version;
|
||||
sha256 = "sha256-bSgPjKqM262PSufz1LHwrdM+uU8xO55Mifv66HRN02Y=";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
in
|
||||
with python.pkgs; buildPythonApplication rec {
|
||||
pname = "platformio";
|
||||
inherit version src;
|
||||
|
||||
propagatedBuildInputs = [
|
||||
aiofiles
|
||||
ajsonrpc
|
||||
bottle
|
||||
click
|
||||
click-completion
|
||||
colorama
|
||||
git
|
||||
lockfile
|
||||
marshmallow
|
||||
pyelftools
|
||||
pyserial
|
||||
requests
|
||||
semantic-version
|
||||
spdx-license-list-data.json
|
||||
starlette
|
||||
tabulate
|
||||
uvicorn
|
||||
wsproto
|
||||
zeroconf
|
||||
];
|
||||
|
||||
HOME = "/tmp";
|
||||
|
||||
checkInputs = [
|
||||
jsondiff
|
||||
pytestCheckHook
|
||||
tox
|
||||
];
|
||||
|
||||
pytestFlagsArray = (map (e: "--deselect tests/${e}") [
|
||||
"commands/pkg/test_exec.py::test_pkg_specified"
|
||||
"commands/pkg/test_exec.py::test_unrecognized_options"
|
||||
"commands/test_ci.py::test_ci_boards"
|
||||
"commands/test_ci.py::test_ci_build_dir"
|
||||
"commands/test_ci.py::test_ci_keep_build_dir"
|
||||
"commands/test_ci.py::test_ci_lib_and_board"
|
||||
"commands/test_ci.py::test_ci_project_conf"
|
||||
"commands/test_init.py::test_init_custom_framework"
|
||||
"commands/test_init.py::test_init_duplicated_boards"
|
||||
"commands/test_init.py::test_init_enable_auto_uploading"
|
||||
"commands/test_init.py::test_init_ide_atom"
|
||||
"commands/test_init.py::test_init_ide_clion"
|
||||
"commands/test_init.py::test_init_ide_eclipse"
|
||||
"commands/test_init.py::test_init_ide_vscode"
|
||||
"commands/test_init.py::test_init_incorrect_board"
|
||||
"commands/test_init.py::test_init_special_board"
|
||||
"commands/test_lib.py::test_global_install_archive"
|
||||
"commands/test_lib.py::test_global_install_registry"
|
||||
"commands/test_lib.py::test_global_install_repository"
|
||||
"commands/test_lib.py::test_global_lib_list"
|
||||
"commands/test_lib.py::test_global_lib_uninstall"
|
||||
"commands/test_lib.py::test_global_lib_update"
|
||||
"commands/test_lib.py::test_global_lib_update_check"
|
||||
"commands/test_lib.py::test_install_duplicates"
|
||||
"commands/test_lib.py::test_lib_show"
|
||||
"commands/test_lib.py::test_lib_stats"
|
||||
"commands/test_lib.py::test_saving_deps"
|
||||
"commands/test_lib.py::test_search"
|
||||
"commands/test_lib.py::test_update"
|
||||
"commands/test_lib_complex.py::test_global_install_archive"
|
||||
"commands/test_lib_complex.py::test_global_install_registry"
|
||||
"commands/test_lib_complex.py::test_global_install_repository"
|
||||
"commands/test_lib_complex.py::test_global_lib_list"
|
||||
"commands/test_lib_complex.py::test_global_lib_uninstall"
|
||||
"commands/test_lib_complex.py::test_global_lib_update"
|
||||
"commands/test_lib_complex.py::test_global_lib_update_check"
|
||||
"commands/test_lib_complex.py::test_install_duplicates"
|
||||
"commands/test_lib_complex.py::test_lib_show"
|
||||
"commands/test_lib_complex.py::test_lib_stats"
|
||||
"commands/test_lib_complex.py::test_search"
|
||||
"package/test_manager.py::test_download"
|
||||
"package/test_manager.py::test_install_force"
|
||||
"package/test_manager.py::test_install_from_registry"
|
||||
"package/test_manager.py::test_install_lib_depndencies"
|
||||
"package/test_manager.py::test_registry"
|
||||
"package/test_manager.py::test_uninstall"
|
||||
"package/test_manager.py::test_update_with_metadata"
|
||||
"package/test_manager.py::test_update_without_metadata"
|
||||
"test_builder.py::test_build_flags"
|
||||
"test_builder.py::test_build_unflags"
|
||||
"test_builder.py::test_debug_custom_build_flags"
|
||||
"test_builder.py::test_debug_default_build_flags"
|
||||
"test_misc.py::test_api_cache"
|
||||
"test_misc.py::test_ping_internet_ips"
|
||||
"test_misc.py::test_platformio_cli"
|
||||
"test_pkgmanifest.py::test_packages"
|
||||
]) ++ (map (e: "--ignore=tests/${e}") [
|
||||
"commands/pkg/test_install.py"
|
||||
"commands/pkg/test_list.py"
|
||||
"commands/pkg/test_outdated.py"
|
||||
"commands/pkg/test_search.py"
|
||||
"commands/pkg/test_show.py"
|
||||
"commands/pkg/test_uninstall.py"
|
||||
"commands/pkg/test_update.py"
|
||||
"commands/test_boards.py"
|
||||
"commands/test_check.py"
|
||||
"commands/test_platform.py"
|
||||
"commands/test_run.py"
|
||||
"commands/test_test.py"
|
||||
"commands/test_update.py"
|
||||
"test_ino2cpp.py"
|
||||
"test_maintenance.py"
|
||||
]) ++ [
|
||||
"tests"
|
||||
];
|
||||
|
||||
patches = [
|
||||
./fix-searchpath.patch
|
||||
./use-local-spdx-license-list.patch
|
||||
./missing-udev-rules-nixos.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substitute platformio/package/manifest/schema.py platformio/package/manifest/schema.py \
|
||||
--subst-var-by SPDX_LICENSE_LIST_DATA '${spdx-license-list-data.json}'
|
||||
|
||||
substituteInPlace setup.py \
|
||||
--replace "wsproto==1.0.*" "wsproto" \
|
||||
--replace "zeroconf==0.38.*" "zeroconf"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isAarch64;
|
||||
description = "An open source ecosystem for IoT development";
|
||||
homepage = "https://platformio.org";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ mog makefu ];
|
||||
};
|
||||
}
|
||||
21
pkgs/development/embedded/platformio/default.nix
Normal file
21
pkgs/development/embedded/platformio/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
{ newScope, fetchFromGitHub }:
|
||||
|
||||
let
|
||||
callPackage = newScope self;
|
||||
|
||||
version = "6.0.1";
|
||||
|
||||
# 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 = "sha256-noLdQctAaMNmfuxI3iybHFx3Q9aTr3gZaUZ+/uO+fnA=";
|
||||
};
|
||||
|
||||
self = {
|
||||
platformio-chrootenv = callPackage ./chrootenv.nix { inherit version src; };
|
||||
};
|
||||
|
||||
in self
|
||||
13
pkgs/development/embedded/platformio/fix-searchpath.patch
Normal file
13
pkgs/development/embedded/platformio/fix-searchpath.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/platformio/proc.py b/platformio/proc.py
|
||||
index 80e50201..15cee5a5 100644
|
||||
--- a/platformio/proc.py
|
||||
+++ b/platformio/proc.py
|
||||
@@ -181,7 +181,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)
|
||||
|
||||
|
||||
def where_is_program(program, envpath=None):
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
diff --git a/platformio/exception.py b/platformio/exception.py
|
||||
index ef1d3bab..445174fc 100644
|
||||
--- a/platformio/exception.py
|
||||
+++ b/platformio/exception.py
|
||||
@@ -57,6 +57,7 @@ class MissedUdevRules(InvalidUdevRules):
|
||||
MESSAGE = (
|
||||
"Warning! Please install `99-platformio-udev.rules`. \nMore details: "
|
||||
"https://docs.platformio.org/page/faq.html#platformio-udev-rules"
|
||||
+ "On NixOS add the platformio package to services.udev.packages"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py
|
||||
index 416dccfd..896c3649 100644
|
||||
--- a/platformio/package/manifest/schema.py
|
||||
+++ b/platformio/package/manifest/schema.py
|
||||
@@ -253,9 +253,6 @@ class ManifestSchema(BaseSchema):
|
||||
@staticmethod
|
||||
@memoized(expire="1h")
|
||||
def load_spdx_licenses():
|
||||
- version = "3.17"
|
||||
- spdx_data_url = (
|
||||
- "https://raw.githubusercontent.com/spdx/license-list-data/"
|
||||
- "v%s/json/licenses.json" % version
|
||||
- )
|
||||
- return json.loads(fetch_remote_content(spdx_data_url))
|
||||
+ with open("@SPDX_LICENSE_LIST_DATA@/json/licenses.json") as f:
|
||||
+ spdx = json.load(f)
|
||||
+ return spdx
|
||||
Loading…
Add table
Add a link
Reference in a new issue