core/pkgs/by-name/ru/rust/cargo_cross.nix

25 lines
529 B
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{
runCommand,
stdenv,
lib,
pkgsBuildBuild,
makeShellWrapper,
rustc,
...
}:
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
runCommand "${stdenv.targetPlatform.config}-cargo-${lib.getVersion pkgsBuildBuild.cargo}"
{
# Use depsBuildBuild or it tries to use target-runtimeShell
depsBuildBuild = [ makeShellWrapper ];
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
inherit (pkgsBuildBuild.cargo) meta;
}
''
mkdir -p $out/bin
ln -s ${pkgsBuildBuild.cargo}/share $out/share
2024-05-02 00:46:19 +00:00
2024-06-30 08:16:52 +00:00
makeWrapper "${pkgsBuildBuild.cargo}/bin/cargo" "$out/bin/cargo" \
--prefix PATH : "${rustc}/bin"
''