From a4ea6d60a45f0a729288ba2c82e773c8ec331751 Mon Sep 17 00:00:00 2001 From: JL2210 Date: Sun, 4 Nov 2018 16:05:53 -0500 Subject: [PATCH 1/3] Fix arm64 build --- .travis.yml | 6 +++--- build.sh | 4 ++++ install_deps.sh | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 445d374..89e489d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,9 @@ matrix: - os: linux sudo: required env: BUILDARCH=ia32 -# - os: linux -# sudo: required -# env: BUILDARCH=arm64 + - os: linux + sudo: required + env: BUILDARCH=arm64 - os: osx language: node_js diff --git a/build.sh b/build.sh index ddef3d2..09c2d5a 100755 --- a/build.sh +++ b/build.sh @@ -8,6 +8,10 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then export npm_config_arch=ia32 fi + if [[ "$BUILDARCH" == "arm64" ]]; then + export npm_config_arch=arm64 + fi + ../update_settings.sh yarn diff --git a/install_deps.sh b/install_deps.sh index 63839cb..c3ce7ce 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -12,10 +12,18 @@ else sudo apt-get update sudo apt-get install libc6-dev-i386 gcc-multilib g++-multilib sudo apt-get install libx11-dev:i386 libxkbfile-dev:i386 + export CC="/usr/bin/gcc -m32" + export CXX="/usr/bin/g++ -m32" + export CC_host=/usr/bin/gcc + export CXX_host=/usr/bin/g++ elif [[ $BUILDARCH == "arm64" ]]; then - # Use the default C / C++ compilers, - # because some makefiles default to CC:=gcc: - export CC=/usr/bin/cc - export CXX=/usr/bin/c++ + sudo dpkg --add-architecture arm64 + sudo apt-get update + sudo apt-get install libc6-dev:arm64 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + sudo apt-get install libx11-dev:arm64 libxkbfile-dev:arm64 + export CC=/usr/bin/aarch64-linux-gnu-gcc + export CXX=/usr/bin/aarch64-linux-gnu-g++ + export CC_host=/usr/bin/gcc + export CXX_host=/usr/bin/g++ fi fi From 31ad1426648c0ad9d21c843d42d468d122ba9452 Mon Sep 17 00:00:00 2001 From: JL2210 Date: Sun, 4 Nov 2018 16:26:54 -0500 Subject: [PATCH 2/3] Fix broken package name --- install_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_deps.sh b/install_deps.sh index c3ce7ce..fb9ac08 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -19,7 +19,7 @@ else elif [[ $BUILDARCH == "arm64" ]]; then sudo dpkg --add-architecture arm64 sudo apt-get update - sudo apt-get install libc6-dev:arm64 gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + sudo apt-get install libc6-dev-arm64-cross gcc-aarch64-linux-gnu g++-aarch64-linux-gnu sudo apt-get install libx11-dev:arm64 libxkbfile-dev:arm64 export CC=/usr/bin/aarch64-linux-gnu-gcc export CXX=/usr/bin/aarch64-linux-gnu-g++ From 7b764d5c5ba901da03bad0887b6992281043f70b Mon Sep 17 00:00:00 2001 From: JL2210 Date: Mon, 5 Nov 2018 10:32:51 -0500 Subject: [PATCH 3/3] export npm_config_target_arch instead of npm_config_arch on arm64 --- build.sh | 2 ++ install_deps.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/build.sh b/build.sh index 09c2d5a..bedb1b5 100755 --- a/build.sh +++ b/build.sh @@ -6,10 +6,12 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$BUILDARCH" == "ia32" ]]; then export npm_config_arch=ia32 + export npm_config_target_arch=ia32 fi if [[ "$BUILDARCH" == "arm64" ]]; then export npm_config_arch=arm64 + export npm_config_target_arch=arm64 fi ../update_settings.sh diff --git a/install_deps.sh b/install_deps.sh index fb9ac08..6fcac54 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -17,6 +17,7 @@ else export CC_host=/usr/bin/gcc export CXX_host=/usr/bin/g++ elif [[ $BUILDARCH == "arm64" ]]; then + echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main" | sudo tee -a /etc/apt/sources.list.d/arm64.list >/dev/null sudo dpkg --add-architecture arm64 sudo apt-get update sudo apt-get install libc6-dev-arm64-cross gcc-aarch64-linux-gnu g++-aarch64-linux-gnu