diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-30 21:57:32 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-30 22:42:15 -0500 |
commit | 8a434b625dc07e0f1e4f39ef6bb1219ab9c58953 (patch) | |
tree | 0be19d88bfcceb2b2681e4a156d3e863c0c35c30 /doc/cross-compilation.xml | |
parent | edfe42f3bab5f75baf4a7b11a6458c17725ab432 (diff) |
doc: Add cross cookbook
An excellent suggestion from @bgamari
Diffstat (limited to 'doc/cross-compilation.xml')
-rw-r--r-- | doc/cross-compilation.xml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/cross-compilation.xml b/doc/cross-compilation.xml index f1194720cfd5f..118a82bf0b06c 100644 --- a/doc/cross-compilation.xml +++ b/doc/cross-compilation.xml @@ -200,6 +200,45 @@ </para></note> </section> + <section> + <title>Cross packagaing cookbook</title> + <para> + 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! + </para> + <qandaset> + <qandaentry> + <question><para> + What if my package's build system needs to build a C program to be run under the build environment? + </para></question> + <answer><para> + <programlisting>depsBuildBuild = [ buildPackages.stdenv.cc ];</programlisting> + Add it to your <function>mkDerivation</function> invocation. + </para></answer> + </qandaentry> + <qandaentry> + <question><para> + My package fails to find <command>ar</command>. + </para></question> + <answer><para> + Many packages assume that an unprefixed <command>ar</command> 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`. + </para></answer> + </qandaentry> + <qandaentry> + <question><para> + My package's testsuite needs to run host platform code. + </para></question> + <answer><para> + <programlisting>doCheck = stdenv.hostPlatform != stdenv.buildPlatfrom;</programlisting> + Add it to your <function>mkDerivation</function> invocation. + </para></answer> + </qandaentry> + </qandaset> + </section> </section> <!--============================================================--> |