Skip to content

Commit

Permalink
Merge pull request #309 from flokli/cross-fixes
Browse files Browse the repository at this point in the history
fix cross-compilation
  • Loading branch information
Ericson2314 authored Oct 31, 2023
2 parents a77ecfd + 95e3997 commit dfbd52a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
12 changes: 7 additions & 5 deletions crate2nix/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@ rec {
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
Expand Down Expand Up @@ -2651,10 +2651,12 @@ rec {
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
}
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
echo tested by ${test}
'' + ''
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'');

/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
Expand Down
12 changes: 7 additions & 5 deletions crate2nix/templates/nix/crate2nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ rec {
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
Expand Down Expand Up @@ -165,10 +165,12 @@ rec {
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
}
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
echo tested by ${test}
'' + ''
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'');

/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
Expand Down
12 changes: 7 additions & 5 deletions sample_projects/bin_with_git_submodule_dep/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ rec {
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
Expand Down Expand Up @@ -1513,10 +1513,12 @@ rec {
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
}
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
echo tested by ${test}
'' + ''
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'');

/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
Expand Down
12 changes: 7 additions & 5 deletions sample_projects/codegen/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ rec {
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
Expand Down Expand Up @@ -645,10 +645,12 @@ rec {
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
}
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
echo tested by ${test}
'' + ''
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'');

/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
Expand Down
12 changes: 7 additions & 5 deletions sample_projects/sub_dir_crates/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ rec {
# recreate a file hierarchy as when running tests with cargo
# the source for test data
${pkgs.xorg.lndir}/bin/lndir ${crate.src}
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs
testRoot=target/debug
Expand Down Expand Up @@ -297,10 +297,12 @@ rec {
passthru = (crate.passthru or { }) // {
inherit test;
};
} ''
echo tested by ${test}
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'';
}
(lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
echo tested by ${test}
'' + ''
${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs}
'');

/* A restricted overridable version of builtRustCratesWithFeatures. */
buildRustCrateWithFeatures =
Expand Down

0 comments on commit dfbd52a

Please sign in to comment.