default.nix: fix use of rustManifest

part of Gitea issue #4
This commit is contained in:
Astro 2019-09-26 23:34:06 +02:00
parent 20249cf2da
commit d5334cc083
1 changed files with 12 additions and 15 deletions

View File

@ -5,35 +5,32 @@
let let
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; }; pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
in rustcSrc = pkgs.fetchgit {
with pkgs;
let
rustcSrc = fetchgit {
url = https://github.com/rust-lang/rust.git; url = https://github.com/rust-lang/rust.git;
# master of 2019-09-25 # master of 2019-09-25
rev = "37538aa1365d1f8a10770a7d15c95b3167c8db57"; rev = "37538aa1365d1f8a10770a7d15c95b3167c8db57";
sha256 = "1nvddkxwvrsvyx187s5mwj4fwsf26xd4vr6ba1kfy7m2fj7w79hq"; sha256 = "1nvddkxwvrsvyx187s5mwj4fwsf26xd4vr6ba1kfy7m2fj7w79hq";
fetchSubmodules = true; fetchSubmodules = true;
}; };
manifestOverlay = self: super: {
rustChannelOfTargets = _channel: _date: targets:
(super.lib.rustLib.fromManifestFile rustManifest {
inherit (super) stdenv fetchurl patchelf;
}).rust.override { inherit targets; };
};
targets = []; targets = [];
rustChannelOfTargets = _channel: _date: targets:
(pkgs.lib.rustLib.fromManifestFile rustManifest {
inherit (pkgs) stdenv fetchurl patchelf;
}).rust.override { inherit targets; };
rust = rust =
rustChannelOfTargets "nightly" null targets; rustChannelOfTargets "nightly" null targets;
rustPlatform = recurseIntoAttrs (makeRustPlatform { rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
rustc = rust // { src = rustcSrc; }; rustc = rust // { src = rustcSrc; };
cargo = rust; cargo = rust;
}); });
gcc = pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc; gcc = pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc;
xbuildRustPackage = attrs: xbuildRustPackage = attrs:
(rustPlatform.buildRustPackage attrs) let
.overrideAttrs (oldAttrs: with oldAttrs; { buildPkg = rustPlatform.buildRustPackage attrs;
in
buildPkg.overrideAttrs ({ name, nativeBuildInputs, ... }: {
nativeBuildInputs = nativeBuildInputs =
oldAttrs.nativeBuildInputs ++ [ cargo-xbuild ]; nativeBuildInputs ++ [ pkgs.cargo-xbuild ];
buildPhase = '' buildPhase = ''
cargo xbuild --release --frozen cargo xbuild --release --frozen
''; '';