2020-01-19 22:51:45 +00:00
|
|
|
{ stdenv, lib, buildPythonApplication, fetchFromGitHub, fetchpatch
|
|
|
|
, bottle, click, colorama, semantic-version
|
2017-09-29 14:05:31 +01:00
|
|
|
, lockfile, pyserial, requests
|
2020-01-19 22:51:45 +00:00
|
|
|
, tabulate, pyelftools, marshmallow
|
|
|
|
, pytest, tox, jsondiff
|
|
|
|
, git, spdx-license-list-data
|
2017-09-29 14:05:31 +01:00
|
|
|
}:
|
|
|
|
|
2018-10-30 13:38:57 +00:00
|
|
|
let
|
|
|
|
args = lib.concatStringsSep " " ((map (e: "--deselect tests/${e}") [
|
|
|
|
"commands/test_ci.py::test_ci_boards"
|
|
|
|
"commands/test_ci.py::test_ci_project_conf"
|
|
|
|
"commands/test_ci.py::test_ci_lib_and_board"
|
2019-04-05 09:15:13 +01:00
|
|
|
"commands/test_ci.py::test_ci_build_dir"
|
|
|
|
"commands/test_ci.py::test_ci_keep_build_dir"
|
2018-10-30 13:38:57 +00:00
|
|
|
"commands/test_init.py::test_init_enable_auto_uploading"
|
|
|
|
"commands/test_init.py::test_init_custom_framework"
|
|
|
|
"commands/test_init.py::test_init_incorrect_board"
|
|
|
|
"commands/test_init.py::test_init_ide_atom"
|
|
|
|
"commands/test_init.py::test_init_ide_eclipse"
|
|
|
|
"commands/test_init.py::test_init_duplicated_boards"
|
|
|
|
"commands/test_init.py::test_init_special_board"
|
|
|
|
"commands/test_lib.py::test_search"
|
|
|
|
"commands/test_lib.py::test_install_duplicates"
|
|
|
|
"commands/test_lib.py::test_global_lib_update_check"
|
|
|
|
"commands/test_lib.py::test_global_lib_update"
|
|
|
|
"commands/test_lib.py::test_global_lib_uninstall"
|
|
|
|
"commands/test_lib.py::test_lib_show"
|
|
|
|
"commands/test_lib.py::test_lib_stats"
|
|
|
|
"commands/test_lib.py::test_global_install_registry"
|
|
|
|
"commands/test_lib.py::test_global_install_archive"
|
|
|
|
"commands/test_lib.py::test_global_install_repository"
|
|
|
|
"commands/test_lib.py::test_global_lib_list"
|
|
|
|
"commands/test_test.py::test_local_env"
|
|
|
|
"test_builder.py::test_build_flags"
|
|
|
|
"test_builder.py::test_build_unflags"
|
2020-04-03 14:58:16 +01:00
|
|
|
"test_builder.py::test_debug_default_build_flags"
|
|
|
|
"test_builder.py::test_debug_custom_build_flags"
|
2018-10-30 13:38:57 +00:00
|
|
|
"test_misc.py::test_api_cache"
|
|
|
|
"test_misc.py::test_ping_internet_ips"
|
2019-09-04 06:59:22 +01:00
|
|
|
"test_misc.py::test_platformio_cli"
|
2018-10-30 13:38:57 +00:00
|
|
|
"test_pkgmanifest.py::test_packages"
|
|
|
|
]) ++ (map (e: "--ignore=tests/${e}") [
|
|
|
|
"commands/test_boards.py"
|
2020-01-19 22:51:45 +00:00
|
|
|
"commands/test_check.py"
|
2018-10-30 13:38:57 +00:00
|
|
|
"commands/test_platform.py"
|
|
|
|
"commands/test_update.py"
|
|
|
|
"test_maintenance.py"
|
|
|
|
"test_ino2cpp.py"
|
|
|
|
]));
|
|
|
|
|
|
|
|
in buildPythonApplication rec {
|
2017-09-29 14:05:31 +01:00
|
|
|
pname = "platformio";
|
2020-04-03 14:58:16 +01:00
|
|
|
version = "4.3.1";
|
2017-09-29 14:05:31 +01:00
|
|
|
|
2018-12-10 06:03:58 +00:00
|
|
|
# pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964
|
2018-10-30 13:38:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "platformio";
|
|
|
|
repo = "platformio-core";
|
|
|
|
rev = "v${version}";
|
2020-04-03 14:58:16 +01:00
|
|
|
sha256 = "1dxnjy60zpkgyrbvbf6b9qi6m37gm8gwjmxwfj30npr1y7rvxwrw";
|
2017-09-29 14:05:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2018-04-07 22:00:21 +01:00
|
|
|
bottle click colorama git lockfile
|
2018-01-18 15:02:44 +00:00
|
|
|
pyserial requests semantic-version
|
2020-01-19 22:51:45 +00:00
|
|
|
tabulate pyelftools marshmallow
|
2017-09-29 14:05:31 +01:00
|
|
|
];
|
|
|
|
|
2018-10-30 13:38:57 +00:00
|
|
|
HOME = "/tmp";
|
|
|
|
|
2020-01-19 22:51:45 +00:00
|
|
|
checkInputs = [ pytest tox jsondiff ];
|
2018-10-30 13:38:57 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
py.test -v tests ${args}
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2020-01-19 22:51:45 +00:00
|
|
|
patches = [
|
|
|
|
./fix-searchpath.patch
|
|
|
|
./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}'
|
|
|
|
'';
|
2017-09-29 14:05:31 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2018-10-30 13:38:57 +00:00
|
|
|
broken = stdenv.isAarch64;
|
2017-09-29 14:05:31 +01:00
|
|
|
description = "An open source ecosystem for IoT development";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://platformio.org";
|
2017-09-29 14:05:31 +01:00
|
|
|
license = licenses.asl20;
|
2018-10-30 13:38:57 +00:00
|
|
|
maintainers = with maintainers; [ mog makefu ];
|
2017-09-29 14:05:31 +01:00
|
|
|
};
|
|
|
|
}
|