diff options
author | Michael Eden <themichaeleden@gmail.com> | 2019-03-16 11:43:20 -0400 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-11-03 14:45:13 +0100 |
commit | 5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb (patch) | |
tree | 229cd7ec24bf5fba7c431832face8c857395efd2 /pkgs/development | |
parent | 66611546f0a57a4d8c7a36af07ad0105f8942d5d (diff) | |
download | nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.tar nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.tar.gz nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.tar.bz2 nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.tar.lz nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.tar.xz nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.tar.zst nixpkgs-5b96d9cf21904ccea0c590fa6adc17ee76d1ecdb.zip |
nodejs: cross compile runtime for ARM
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/web/nodejs/nodejs.nix | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 6dc68750075..ea23ad06cd2 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -53,12 +53,30 @@ in }; buildInputs = optionals stdenv.isDarwin [ CoreServices ApplicationServices ] - ++ [ python2 zlib libuv openssl http-parser icu ]; + ++ [ zlib libuv openssl http-parser icu ]; - nativeBuildInputs = [ which utillinux pkgconfig ] + nativeBuildInputs = [ which utillinux pkgconfig python2 ] ++ optionals stdenv.isDarwin [ xcbuild ]; - configureFlags = sharedConfigureFlags ++ [ "--without-dtrace" ] ++ extraConfigFlags; + configureFlags = let + isCross = stdenv.hostPlatform != stdenv.buildPlatform; + host = stdenv.hostPlatform.platform; + isArm = stdenv.hostPlatform.isArm; + in sharedConfigureFlags ++ [ + "--without-dtrace" + ] ++ (optionals isCross [ + "--cross-compiling" + "--without-intl" + "--without-snapshot" + ]) ++ (optionals (isCross && isArm && hasAttr "fpu" host.gcc) [ + "--with-arm-fpu=${host.gcc.fpu}" + ]) ++ (optionals (isCross && isArm && hasAttr "float-abi" host.gcc) [ + "--with-arm-float-abi=${host.gcc.float-abi}" + ]) ++ (optionals (isCross && isArm) [ + "--dest-cpu=arm" + ]) ++ extraConfigFlags; + + configurePlatforms = []; dontDisableStatic = true; @@ -96,7 +114,7 @@ in postInstall = '' PATH=$out/bin:$PATH patchShebangs $out - ${optionalString enableNpm '' + ${optionalString (enableNpm && stdenv.hostPlatform == stdenv.buildPlatform) '' mkdir -p $out/share/bash-completion/completions/ $out/bin/npm completion > $out/share/bash-completion/completions/npm for dir in "$out/lib/node_modules/npm/man/"*; do |