A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

crane: Add overrides for cross compilation

+13 -2
+13 -2
crane.nix
··· 7 7 8 8 { stdenv 9 9 , lib 10 + , buildPackages 10 11 , craneLib 11 - , rustPlatform 12 + , rust 12 13 , runCommand 13 14 , writeReferencesToFile 14 15 , pkg-config ··· 45 46 libiconv 46 47 ]; 47 48 48 - extraArgs = extraPackageArgs; 49 + crossArgs = let 50 + rustTargetSpec = rust.toRustTargetSpec stdenv.hostPlatform; 51 + rustTargetSpecEnv = lib.toUpper (builtins.replaceStrings [ "-" ] [ "_" ] rustTargetSpec); 52 + in lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { 53 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 54 + 55 + CARGO_BUILD_TARGET = rustTargetSpec; 56 + "CARGO_TARGET_${rustTargetSpecEnv}_LINKER" = "${stdenv.cc.targetPrefix}cc"; 57 + }; 58 + 59 + extraArgs = crossArgs // extraPackageArgs; 49 60 50 61 cargoArtifacts = craneLib.buildDepsOnly ({ 51 62 pname = "attic";