1 { lib, stdenvNoCC, buildPackages }:
4 rpath = lib.makeLibraryPath [
5 buildPackages.stdenv.cc.libc
8 bootstrapCrossRust = stdenvNoCC.mkDerivation {
9 name = "binary-redox-rust";
11 src = buildPackages.fetchzip {
12 name = "redox-rust-toolchain.tar.gz";
13 url = "https://www.dropbox.com/s/qt7as0j7cwnin8z/redox-rust-toolchain.tar.gz?dl=1";
14 sha256 = "1g17qp2q6b88p04yclkw6amm374pqlakrmw9kd86vw8z4g70jkxm";
24 find $out/ -executable -type f -exec patchelf \
25 --set-interpreter "${buildPackages.stdenv.cc.libc}/lib/ld-linux-x86-64.so.2" \
26 --set-rpath "${rpath}" \
28 find $out/ -name "*.so" -type f -exec patchelf \
29 --set-rpath "${rpath}" \
33 meta.platforms = with lib; platforms.redox ++ platforms.linux;
36 redoxRustPlatform = buildPackages.makeRustPlatform {
37 rustc = bootstrapCrossRust;
38 cargo = bootstrapCrossRust;
42 redoxRustPlatform.buildRustPackage rec {
46 LD_LIBRARY_PATH = "${buildPackages.zlib}/lib";
48 src = buildPackages.fetchgit {
49 url = "https://gitlab.redox-os.org/redox-os/relibc/";
50 rev = "5af8e3ca35ad401014a867ac1a0cc3b08dee682b";
51 sha256 = "1j4wsga9psl453031izkl3clkvm31d1wg4y8f3yqqvhml2aliws5";
52 fetchSubmodules = true;
63 DESTDIR=$out make install
66 TARGET = stdenvNoCC.hostPlatform.rust.rustcTargetSpec;
69 lockFile = ./Cargo.lock;
71 "redox_syscall-0.2.0" = "sha256-nwbJBrhuc01fPbBgd5ShboNu0Nauqp2UjkA+sm9oCeE=";
75 # error: Usage of `RUSTC_WORKSPACE_WRAPPER` requires `-Z unstable-options`
79 homepage = "https://gitlab.redox-os.org/redox-os/relibc";
80 description = "C Library in Rust for Redox and Linux";
81 license = licenses.mit;
82 maintainers = [ maintainers.aaronjanse ];
83 platforms = platforms.redox ++ [ "x86_64-linux" ];