From 8a434b625dc07e0f1e4f39ef6bb1219ab9c58953 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 30 Dec 2017 21:57:32 -0500 Subject: [PATCH] doc: Add cross cookbook An excellent suggestion from @bgamari --- doc/cross-compilation.xml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/cross-compilation.xml b/doc/cross-compilation.xml index f1194720cfd..118a82bf0b0 100644 --- a/doc/cross-compilation.xml +++ b/doc/cross-compilation.xml @@ -200,6 +200,45 @@ +
+ Cross packagaing cookbook + + Some frequently problems when packaging for cross compilation are good to just spell and answer. + Ideally the information above is exhaustive, so this section cannot provide any new information, + but its ludicrous and cruel to expect everyone to spend effort working through the interaction of many features just to figure out the same answer to the same common problem. + Feel free to add to this list! + + + + + What if my package's build system needs to build a C program to be run under the build environment? + + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + Add it to your mkDerivation invocation. + + + + + My package fails to find ar. + + + Many packages assume that an unprefixed ar is available, but Nix doesn't provide one. + It only provides a prefixed one, just as it only does for all the other binutils programs. + It may be necessary to patch the package to fix the build system to use a prefixed `ar`. + + + + + My package's testsuite needs to run host platform code. + + + doCheck = stdenv.hostPlatform != stdenv.buildPlatfrom; + Add it to your mkDerivation invocation. + + + +