gnu: node: Enable cross-compilation.
authorPierre Langlois <pierre.langlois@gmx.com>
Wed, 11 Aug 2021 15:43:45 +0000 (16:43 +0100)
committerPierre Langlois <pierre.langlois@gmx.com>
Thu, 2 Sep 2021 19:47:12 +0000 (20:47 +0100)
commit5ee38c467298091e98fa12be45facdcc63a59a87
tree04f46b5496de0e088c28356717015da2df9089d2
parent9f7c4f380fdd86d81c805b72e4d05e9e658d3dc2
gnu: node: Enable cross-compilation.

Node runs parts of itself on the host for bootstraping therefore for
cross-compiling support we need to fidle with the rpath in the build system,
as well as duplicating some of the dependencies as native-inputs and inputs.

* gnu/pakcages/node.scm (node)[arguments]: Refer to /bin/sh and /bin/env
directly instead of using (which).  Add new 'set-bootstrap-host-rpath phase
to correctly set the rpath for binaries that are meant to run on the host.
Pass --cross-compiling and --dest-cpu to configure script if needed.  Set the
CC_host, CXX_host, CC, CCX and PKG_CONFIG variable for cross-compilation.
Refer to the host python.  Do not return #t from any phases.
[native-inputs]: Add c-ares, http-parser, icu4c, libuv, nghttp2, openssl and
zlib.  Remove which.
[inputs]: Add bash and coreutils.
(llhttp-bootstrap)[arguments]: Refer to esbuild via (or native-inputs inputs).
(node-lts)[arguments]: Add new 'set-bootstrap-host-rpath phase to correctly
set the rpath for host binaries.  Pass --cross-compiling and --dest-cpu to
configure script if needed.  Set the CC_host, CXX_host, CCX and PKG_CONFIG
variable for cross-compilation.  Refer to the host python.  Do not return #t
from any phases.  Refer to /bin/sh and /bin/env directly instead of
using (which).  Do not return #t from any phases.
[native-inputs]: Hardcode native inputs instead of inheriting them from node.
[inputs]: Add bash and coreutils.
gnu/packages/node.scm