add support for more systems
This commit is contained in:
parent
cccea58966
commit
1ee35d233f
5 changed files with 164 additions and 73 deletions
87
rust.nix
87
rust.nix
|
|
@ -1,36 +1,59 @@
|
|||
{pkgs ? import <nixpkgs> {}}:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "esp-rust";
|
||||
version = "1.81.0";
|
||||
srcs = [
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/esp-rs/rust-build/releases/download/v${version}.0/rust-${version}.0-x86_64-unknown-linux-gnu.tar.xz";
|
||||
sha256 = "1pilzw6lqygysdrklzs64vb07a3ni0pw24qklkwc5gjqwgzc4ka4";
|
||||
})
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/esp-rs/rust-build/releases/download/v${version}.0/rust-src-${version}.0.tar.xz";
|
||||
sha256 = "0w7fy0biml8ddvwpmrn9js4x6vkqjhm118gxy2431fnxl97v947f";
|
||||
})
|
||||
];
|
||||
sourceRoot = ".";
|
||||
{
|
||||
pkgs ? import <nixpkgs> {},
|
||||
system ? builtins.currentSystem,
|
||||
}: let
|
||||
systems_table = {
|
||||
"x86_64-linux" = {
|
||||
system = "x86_64-unknown-linux-gnu";
|
||||
hash = "1pilzw6lqygysdrklzs64vb07a3ni0pw24qklkwc5gjqwgzc4ka4";
|
||||
};
|
||||
"x86_64-darwin" = {
|
||||
system = "x86_64-apple-darwin";
|
||||
hash = "09j72xspg1bq82hk9w9ij9h17yk4lr0wfv20ybm1pah4bfxw6mha";
|
||||
};
|
||||
"aarch64-linux" = {
|
||||
system = "aarch64-unknown-linux-gnu";
|
||||
hash = "170013pw7rllqzc03i39xrwy486jllxjjh53sgnywqz0ylycx7j8";
|
||||
};
|
||||
"aarch64-darwin" = {
|
||||
system = "aarch64-apple-darwin";
|
||||
hash = "143kb7vawssg6b5h8c7k4szm43qqif3sjniwzc60avhn60zrc00j";
|
||||
};
|
||||
};
|
||||
download_system = systems_table.${system};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "esp-rust";
|
||||
version = "1.81.0.0";
|
||||
srcs = [
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/esp-rs/rust-build/releases/download/v${version}/rust-${version}-${download_system.system}.tar.xz";
|
||||
sha256 = download_system.hash;
|
||||
})
|
||||
(builtins.fetchurl
|
||||
{
|
||||
url = "https://github.com/esp-rs/rust-build/releases/download/v${version}.0/rust-src-${version}.tar.xz";
|
||||
sha256 = "0w7fy0biml8ddvwpmrn9js4x6vkqjhm118gxy2431fnxl97v947f";
|
||||
})
|
||||
];
|
||||
sourceRoot = ".";
|
||||
|
||||
preferLocalBuild = true;
|
||||
preferLocalBuild = true;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
autoPatchelfHook
|
||||
];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
autoPatchelfHook
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
libz
|
||||
];
|
||||
buildInputs = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
libz
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p "$out"
|
||||
cp -R ./*/*/{bin,share,lib} "$out"
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p "$out"
|
||||
cp -R ./*/*/{bin,share,lib} "$out"
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue