expose patched cargo-xbuild

This commit is contained in:
Sebastien Bourdeauducq 2020-10-13 18:43:37 +08:00
parent 1796d4e236
commit 6266d28095
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
let let
pkgs = import <nixpkgs> { overlays = [ (import ./nix/mozilla-overlay.nix) ]; }; pkgs = import <nixpkgs> { overlays = [ (import ./nix/mozilla-overlay.nix) ]; };
rustPlatform = (import ./nix/rust-platform.nix { inherit pkgs; }); rustPlatform = (import ./nix/rust-platform.nix { inherit pkgs; });
cargo-xbuild = (pkgs.cargo-xbuild.overrideAttrs(oa: { patches = oa.patches ++ [ ./xbuild_writable_lockfile.diff ]; } ));
cargoSha256Experiments = "0ijb3ma7mip48ayc3hilma42rwlz3krb755klmnwwwvxhdhw29w2"; cargoSha256Experiments = "0ijb3ma7mip48ayc3hilma42rwlz3krb755klmnwwwvxhdhw29w2";
cargoSha256SZL = "0shz0kzjnmqvwy68km71awn7krn1109nanyckhzvrxy1l1jxg2rd"; cargoSha256SZL = "0shz0kzjnmqvwy68km71awn7krn1109nanyckhzvrxy1l1jxg2rd";
build-crate = name: crate: features: cargoSha256: build-crate = name: crate: features: cargoSha256:
@ -10,9 +11,7 @@ let
src = ./.; src = ./.;
inherit cargoSha256; inherit cargoSha256;
nativeBuildInputs = [ nativeBuildInputs = [ cargo-xbuild ];
(pkgs.cargo-xbuild.overrideAttrs(oa: { patches = oa.patches ++ [ ./xbuild_writable_lockfile.diff ]; } ))
];
buildPhase = '' buildPhase = ''
export XARGO_RUST_SRC="${rustPlatform.rust.rustc.src}/library" export XARGO_RUST_SRC="${rustPlatform.rust.rustc.src}/library"
export CARGO_HOME=$(mktemp -d cargo-home.XXX) export CARGO_HOME=$(mktemp -d cargo-home.XXX)
@ -34,6 +33,7 @@ let
}; };
in in
{ {
inherit cargo-xbuild;
zc706-experiments = build-crate "zc706-experiments" "experiments" "target_zc706" cargoSha256Experiments; zc706-experiments = build-crate "zc706-experiments" "experiments" "target_zc706" cargoSha256Experiments;
cora-experiments = build-crate "cora-experiments" "experiments" "target_cora_z7_10" cargoSha256Experiments; cora-experiments = build-crate "cora-experiments" "experiments" "target_cora_z7_10" cargoSha256Experiments;
redpitaya-experiments = build-crate "redpitaya-experiments" "experiments" "target_redpitaya" cargoSha256Experiments; redpitaya-experiments = build-crate "redpitaya-experiments" "experiments" "target_redpitaya" cargoSha256Experiments;

View File

@ -1,6 +1,7 @@
let let
pkgs = import <nixpkgs> { overlays = [ (import ./nix/mozilla-overlay.nix) ]; }; pkgs = import <nixpkgs> { overlays = [ (import ./nix/mozilla-overlay.nix) ]; };
rustPlatform = (import ./nix/rust-platform.nix { inherit pkgs; }); rustPlatform = (import ./nix/rust-platform.nix { inherit pkgs; });
cargo-xbuild = (import ./default.nix).cargo-xbuild;
in in
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = "zynq-env"; name = "zynq-env";
@ -8,7 +9,7 @@ in
rustPlatform.rust.rustc rustPlatform.rust.rustc
rustPlatform.rust.cargo rustPlatform.rust.cargo
pkgs.cacert pkgs.cacert
(pkgs.cargo-xbuild.overrideAttrs(oa: { patches = oa.patches ++ [ ./xbuild_writable_lockfile.diff ]; } )) cargo-xbuild
pkgs.openocd pkgs.gdb pkgs.openocd pkgs.gdb
pkgs.openssh pkgs.rsync pkgs.openssh pkgs.rsync