20 lines
429 B
Nix
20 lines
429 B
Nix
{
|
|
stdenv,
|
|
rustc,
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "hare-cc";
|
|
version = "1.0";
|
|
buildInputs = [ rustc ];
|
|
unpackPhase = ":";
|
|
buildPhase = ''
|
|
sed \
|
|
-e 's/"ld"/"cc"/g' \
|
|
-e 's/let mut args/let mut _args/' \
|
|
-e '11 a let mut args = vec![];' \
|
|
${./ld.rs} > ld.rs
|
|
rustc -o hare-cc.bin ld.rs
|
|
'';
|
|
installPhase = "install -m755 -D hare-cc.bin $out/bin/hare-cc";
|
|
})
|