代码拉取完成,页面将自动刷新
# Shell expression for the Nix package manager
#
# This nix expression creates an environment with necessary packages installed:
#
# * `tockloader`
# * arm-none-eabi toolchain
# * elf2tab
# * (optionally) riscv32-embedded toolchain
#
# To use:
#
# $ nix-shell
#
# The RISC-V toolchain can be disabled optionally. This will further
# prevent RISC-V specific environment variables from being set in the
# Nix shell environment:
#
# $ nix-shell shell.nix --arg disableRiscvToolchain true
{ pkgs ? import <nixpkgs> {}, disableRiscvToolchain ? false }:
with builtins;
let
inherit (pkgs) stdenv lib;
pythonPackages = lib.fix' (self: with self; pkgs.python3Packages //
{
tockloader = buildPythonPackage rec {
pname = "tockloader";
version = "1.7.0";
name = "${pname}-${version}";
propagatedBuildInputs = [ argcomplete colorama crcmod pyserial pytoml tqdm ];
src = fetchPypi {
inherit pname version;
sha256 = "05ygljkpdympkq13rbnpz3i1h8xdsrxz0cj2i1bkbs0aswq4sc8b";
};
};
});
elf2tab = pkgs.rustPlatform.buildRustPackage rec {
name = "elf2tab-${version}";
version = "0.7.0";
src = pkgs.fetchFromGitHub {
owner = "tock";
repo = "elf2tab";
rev = "v${version}";
sha256 = "16k8i03p3hbmrgz9xvv5wm3azrqbq2j7858f75b8yrm3w93dwlrv";
};
cargoSha256 = "14z6564jmxd2627m5zjsnc3qjsxy5fymnxlmz0fjhi4gkwyiygjk";
};
in
pkgs.mkShell {
name = "tock-dev";
buildInputs = with pkgs; [
elf2tab
gcc-arm-embedded
python3Full
pythonPackages.tockloader
] ++ (lib.optional (!disableRiscvToolchain) pkgsCross.riscv32-embedded.buildPackages.gcc);
shellHook = ''
${if (!disableRiscvToolchain) then ''
export RISCV=1
'' else ""}
'';
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。