diff options
author | Artturin <Artturin@artturin.com> | 2022-06-07 21:47:38 +0300 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2022-06-11 04:51:04 +0300 |
commit | 6e6292279e89ff6240c77159fec15970b0d5db7a (patch) | |
tree | 395634997b3dcc29383c479c43424239cc5bbe0e /doc/stdenv | |
parent | ef75dae045ab5777bf6ac3b7e3e6080ea85a865a (diff) |
meson: add mesonEmulatorHook
fixes building documentation while cross-compiling and other issues Exec format error: './gdk3-scan' added some simple documentation
Diffstat (limited to 'doc/stdenv')
-rw-r--r-- | doc/stdenv/cross-compilation.chapter.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/stdenv/cross-compilation.chapter.md b/doc/stdenv/cross-compilation.chapter.md index 3b6e5c34d54da..7b8f2b4ce6cdb 100644 --- a/doc/stdenv/cross-compilation.chapter.md +++ b/doc/stdenv/cross-compilation.chapter.md @@ -153,6 +153,24 @@ Add the following to your `mkDerivation` invocation. doCheck = stdenv.hostPlatform == stdenv.buildPlatform; ``` +#### Package using Meson needs to run binaries for the host platform during build. {#cross-meson-runs-host-code} + +Add `mesonEmulatorHook` cross conditionally to `nativeBuildInputs`. + +e.g. + +``` +nativeBuildInputs = [ + meson +] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + mesonEmulatorHook +]; +``` + +Example of an error which this fixes. + +`[Errno 8] Exec format error: './gdk3-scan'` + ## Cross-building packages {#sec-cross-usage} Nixpkgs can be instantiated with `localSystem` alone, in which case there is no cross-compiling and everything is built by and for that system, or also with `crossSystem`, in which case packages run on the latter, but all building happens on the former. Both parameters take the same schema as the 3 (build, host, and target) platforms defined in the previous section. As mentioned above, `lib.systems.examples` has some platforms which are used as arguments for these parameters in practice. You can use them programmatically, or on the command line: |