check in nix
This commit is contained in:
40
nix/libmcuupdate.nix
Normal file
40
nix/libmcuupdate.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, hidapi
|
||||
, libusb1
|
||||
, runtimeShell
|
||||
, mrs_toolchain_version ? "1.90"
|
||||
, mrs_toolchain_hash ? "sha256-PO7uddJg0L2Ugv7CYLpIyRKAiE+8oXU0nG3NAdYse6g="
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "libmcuupdate";
|
||||
version = mrs_toolchain_version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://file.mounriver.com/tools/MRS_Toolchain_Linux_x64_V${mrs_toolchain_version}.tar.xz";
|
||||
hash = mrs_toolchain_hash;
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
cp -r beforeinstall/libmcuupdate.so $out/lib/
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
find $out -type f | while read f; do
|
||||
patchelf "$f" > /dev/null 2>&1 || continue
|
||||
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
||||
patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc hidapi libusb1 ]} "$f" || true
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
};
|
||||
}
|
37
nix/mrs-toolchain.nix
Normal file
37
nix/mrs-toolchain.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, runtimeShell
|
||||
, mrs_toolchain_version ? "1.90"
|
||||
, mrs_toolchain_hash ? "sha256-PO7uddJg0L2Ugv7CYLpIyRKAiE+8oXU0nG3NAdYse6g="
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-risc-v-embedded";
|
||||
version = mrs_toolchain_version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://file.mounriver.com/tools/MRS_Toolchain_Linux_x64_V${mrs_toolchain_version}.tar.xz";
|
||||
hash = mrs_toolchain_hash;
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
cp -r RISC-V_Embedded_GCC/. $out
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
find $out -type f | while read f; do
|
||||
patchelf "$f" > /dev/null 2>&1 || continue
|
||||
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
};
|
||||
}
|
13
nix/wchisp.nix
Normal file
13
nix/wchisp.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ lib, fetchFromGitHub, rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "wchisp";
|
||||
version = "0.3-git";
|
||||
src = fetchFromGitHub {
|
||||
owner = "ch32-rs";
|
||||
repo = pname;
|
||||
rev = "4b4787243ef9bc87cbbb0d95c7482b4f7c9838f1";
|
||||
hash = "sha256-Ju2DBv3R4O48o8Fk/AFXOBIsvGMK9hJ8Ogxk47f7gcU=";
|
||||
};
|
||||
cargoHash = "sha256-MbCLQBk7aJXcUOalsNbSxozvI2Tx3kerLXgi4l7BKoc=";
|
||||
}
|
37
nix/xpack-riscv-none-elf-gcc.nix
Normal file
37
nix/xpack-riscv-none-elf-gcc.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, runtimeShell
|
||||
, xpack_toolchain_version ? "13.2.0-1"
|
||||
, xpack_toolchain_hash ? "sha256-1+/1xdd4hzw9SG5dLIBbglgucwgfk+2zdaHvXYR2S0M="
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-risc-v-elf";
|
||||
version = xpack_toolchain_version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v${version}/xpack-riscv-none-elf-gcc-${version}-linux-x64.tar.gz";
|
||||
hash = xpack_toolchain_hash;
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
cp -r * $out
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
find $out -type f | while read f; do
|
||||
patchelf "$f" > /dev/null 2>&1 || continue
|
||||
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
};
|
||||
}
|
41
nix/xpack-riscv-none-embed-gcc-8.2.nix
Normal file
41
nix/xpack-riscv-none-embed-gcc-8.2.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, runtimeShell
|
||||
# , xpack_toolchain_version ? "8.3.0-2.3"
|
||||
# , xpack_toolchain_hash ? "sha256-cI0Mtf8S61rQcBU1lMT3dxzYbUtnIad7I/j+aVyPlAI="
|
||||
# , ext ? "tar.gz"
|
||||
, xpack_toolchain_version ? "8.2.0-3.1"
|
||||
, xpack_toolchain_hash ? "sha256-PUD6tQ662EJP+FdI8l0uruUPhqXVIiq9ekWi5JDx5PU="
|
||||
, ext ? "tgz"
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-risc-v-elf";
|
||||
version = xpack_toolchain_version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v${version}/xpack-riscv-none-embed-gcc-${version}-linux-x64.${ext}";
|
||||
hash = xpack_toolchain_hash;
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
cp -r riscv-none-embed-gcc/8.2.0-3.1/* $out
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
find $out -type f | while read f; do
|
||||
patchelf "$f" > /dev/null 2>&1 || continue
|
||||
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
};
|
||||
}
|
38
nix/xpack-riscv-none-embed-gcc.nix
Normal file
38
nix/xpack-riscv-none-embed-gcc.nix
Normal file
@ -0,0 +1,38 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, runtimeShell
|
||||
, xpack_toolchain_version ? "8.3.0-2.3"
|
||||
, xpack_toolchain_hash ? "sha256-cI0Mtf8S61rQcBU1lMT3dxzYbUtnIad7I/j+aVyPlAI="
|
||||
, ext ? "tar.gz"
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-risc-v-elf";
|
||||
version = xpack_toolchain_version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v${version}/xpack-riscv-none-embed-gcc-${version}-linux-x64.${ext}";
|
||||
hash = xpack_toolchain_hash;
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/
|
||||
cp -r * $out
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
find $out -type f | while read f; do
|
||||
patchelf "$f" > /dev/null 2>&1 || continue
|
||||
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user