Hydra settings and non-flakes packaging code. See https://git.m-labs.hk/m-labs/artiq-extrapkg for new NDSPs and contrib libraries.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
832 B

{ stdenv, lib, cacert, git, cargo, cargo-vendor }:
{ name, src, sha256 }:
stdenv.mkDerivation {
name = "${name}-vendor";
strictDeps = true;
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
inherit src;
phases = "unpackPhase patchPhase installPhase";
installPhase = ''
if [[ ! -f Cargo.lock ]]; then
echo "ERROR: The Cargo.lock file doesn't exist"
echo "Cargo.lock is needed to make sure that cargoSha256 doesn't change"
echo "when the registry is updated."
exit 1
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo vendor
cp -ar vendor $out
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
preferLocalBuild = true;