zig: add fetcher
This commit is contained in:
parent
bac3beb820
commit
9a060b90c1
32
pkgs/development/compilers/zig/fetcher.nix
Normal file
32
pkgs/development/compilers/zig/fetcher.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
lib,
|
||||
zig,
|
||||
runCommand,
|
||||
}:
|
||||
{
|
||||
pname,
|
||||
version,
|
||||
name ? "${pname}-${version}",
|
||||
src,
|
||||
hash ? lib.fakeHash,
|
||||
}@args:
|
||||
runCommand "${name}-zig-deps"
|
||||
{
|
||||
inherit (args) src;
|
||||
|
||||
nativeBuildInputs = [ zig ];
|
||||
|
||||
outputHashAlgo = null;
|
||||
outputHashMode = "recursive";
|
||||
outputHash = hash;
|
||||
}
|
||||
''
|
||||
export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d)
|
||||
|
||||
runHook unpackPhase
|
||||
|
||||
cd $sourceRoot
|
||||
zig build --fetch
|
||||
|
||||
mv $ZIG_GLOBAL_CACHE_DIR/p $out
|
||||
''
|
@ -30,4 +30,6 @@
|
||||
};
|
||||
|
||||
stdenv = overrideCC stdenv zig.cc;
|
||||
|
||||
fetchDeps = callPackage ./fetcher.nix { inherit zig; };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user