From 5683e188a51c460312be66fa02c5a2ad13e4fc57 Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 5 Aug 2019 19:49:02 +0200 Subject: [PATCH] nodejs: ppc build fixes + generalize cross for all architectures [ci skip] --- srcpkgs/nodejs/template | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template index a4f7cce36e1..b278d9de0db 100644 --- a/srcpkgs/nodejs/template +++ b/srcpkgs/nodejs/template @@ -32,12 +32,20 @@ replaces="iojs>=0" conflicts="nodejs-lts" provides="nodejs-runtime-0_1" +if [ "$XBPS_WORDSIZE" -ne "$XBPS_TARGET_WORDSIZE" ]; then + nocross="host and target must have the same pointer size" +fi + +# v8 requires libatomic on ppc*/s390x/mips* case "$XBPS_TARGET_MACHINE" in - arm*) - case "$XBPS_MACHINE" in - x86_64*|aarch64*) - nocross="Can't cross-compile to 32bit-host from 64bit-host";; - esac ;; + mips*|ppc*) makedepends+=" libatomic-devel" ;; + *) ;; +esac + +# also need it on host when it's one of those archs +case "$XBPS_MACHINE" in + mips*|ppc*) hostmakedepends+=" libatomic-devel" ;; + *) ;; esac do_configure() { @@ -46,10 +54,23 @@ do_configure() { export LD="$CXX" if [ "$CROSS_BUILD" ]; then case "$XBPS_TARGET_MACHINE" in + arm*) _args="--dest-cpu=arm" ;; aarch64*) _args="--dest-cpu=arm64" ;; ppc64*) _args="--dest-cpu=ppc64" ;; + ppc*) _args="--dest-cpu=ppc" ;; + mipsel*) _args="--dest-cpu=mipsel" ;; + mips*) _args="--dest-cpu=mips" ;; + i686*) _args="--dest-cpu=x86" ;; + x86_64*) _args="--dest-cpu=x86_64" ;; *) msg_error "$pkgver: cannot be cross compiled for ${XBPS_TARGET_MACHINE}.\n" ;; esac + # this is necessary - for example, normally compiling from ppc64le + # to ppc64 or from glibc to musl is considered non-cross-compiling + # by the build system, because it's technically the same architecture + # + # that results in the toolset built for target only, and attempting + # to execute it within the build system fails + _args+=" --cross-compiling" fi ./configure --prefix=/usr --shared-zlib \ $(vopt_if icu --with-intl=system-icu) \