Build vendoredCrates in the overlay

This makes it build on non-x86_64-linux systems (needed in GitHub
actions).
This commit is contained in:
Eelco Dolstra 2020-03-13 18:31:16 +01:00
parent 3e1abf4f05
commit db34445c5e

View file

@ -131,7 +131,7 @@
patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.* patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
''} ''}
ln -sfn ${self.hydraJobs.vendoredCrates}/vendor/ nix-rust/vendor ln -sfn ${final.nixVendoredCrates}/vendor/ nix-rust/vendor
(cd perl; autoreconf --install --force --verbose) (cd perl; autoreconf --install --force --verbose)
''; '';
@ -188,16 +188,10 @@
}; };
};
hydraJobs = {
# Create a "vendor" directory that contains the crates listed in # Create a "vendor" directory that contains the crates listed in
# Cargo.lock, and include it in the Nix tarball. This allows Nix # Cargo.lock, and include it in the Nix tarball. This allows Nix
# to be built without network access. # to be built without network access.
vendoredCrates = nixVendoredCrates =
with nixpkgsFor.x86_64-linux;
let let
lockFile = builtins.fromTOML (builtins.readFile nix-rust/Cargo.lock); lockFile = builtins.fromTOML (builtins.readFile nix-rust/Cargo.lock);
@ -206,7 +200,7 @@
sha256 = lockFile.metadata."checksum ${pkg.name} ${pkg.version} (registry+https://github.com/rust-lang/crates.io-index)"; sha256 = lockFile.metadata."checksum ${pkg.name} ${pkg.version} (registry+https://github.com/rust-lang/crates.io-index)";
}) (builtins.filter (pkg: pkg.source or "" == "registry+https://github.com/rust-lang/crates.io-index") lockFile.package); }) (builtins.filter (pkg: pkg.source or "" == "registry+https://github.com/rust-lang/crates.io-index") lockFile.package);
in pkgs.runCommand "cargo-vendor-dir" {} in final.runCommand "cargo-vendor-dir" {}
'' ''
mkdir -p $out/vendor mkdir -p $out/vendor
@ -238,6 +232,10 @@
'') files)} '') files)}
''; '';
};
hydraJobs = {
# Binary package for various platforms. # Binary package for various platforms.
build = nixpkgs.lib.genAttrs systems (system: nixpkgsFor.${system}.nix); build = nixpkgs.lib.genAttrs systems (system: nixpkgsFor.${system}.nix);