From 19052d68b5a04d8059f329f8ce683b8d8ec07b02 Mon Sep 17 00:00:00 2001 From: Snehal Rajmane Date: Thu, 3 Sep 2020 02:26:58 -0700 Subject: [PATCH] Added s390x support --- .compile_binaries | 16 ++++++++++++++++ .github_deploy | 14 ++++++++++++++ .prepare_deploy | 8 ++++++++ .travis.yml | 6 ++++++ 4 files changed, 44 insertions(+) diff --git a/.compile_binaries b/.compile_binaries index 95939ae..f4148ef 100755 --- a/.compile_binaries +++ b/.compile_binaries @@ -40,6 +40,22 @@ build_armv6hf() { done } +build_s390x() { + # Linux s390x static executable + sudo apt-get update + sudo apt-get -y install ghc cabal-install + cabal update + cabal -j1 install --dependencies-only + cabal build shellcheck + + path="$(find . -name 'shellcheck' -type f)" + [[ -e "$path" ]] + for tag in $TAGS + do + cp "$path" "deploy/shellcheck-$tag.linux-s390x"; + done + } + build_windows() { # Windows .exe docker run -v "$PWD:/appdata" koalaman/winghc cuib diff --git a/.github_deploy b/.github_deploy index e5d6c3e..6a81ba7 100755 --- a/.github_deploy +++ b/.github_deploy @@ -12,9 +12,23 @@ install_deps() { version="2.7.0" # 2.14.1 fails to overwrite duplicates case "$(uname)" in Linux) + if [[ $(uname -m) == 's390x' ]]; then + sudo apt-get update ; + sudo apt-get install -y wget tar git make ruby2.3-dev gcc groff bsdmainutils bsdmainutils locales-all golang-1.10 tmux ; + sudo ln -s /usr/bin/tmux ~/bin/tmux + gem install bundler:1.16.0 + export GOPATH=$PWD ; + export LC_ALL="en_US.UTF-8" + export PATH=/usr/lib/go-1.10/bin:$PATH ; + mkdir -p $GOPATH/src/github.com/github ; + git clone --config transfer.fsckobjects=false --config receive.fsckobjects=false --config fetch.fsckobjects=false https://github.com/github/hub.git $GOPATH/src/github.com/github/hub ; + cd $GOPATH/src/github.com/github/hub && git checkout v2.7.0 ; + sudo env PATH=$PATH GOPATH=$GOPATH make install ; + else sudo apt-get update sudo apt-get install curl curl -L "https://github.com/github/hub/releases/download/v$version/hub-linux-amd64-$version.tgz" | tar xvz --strip-components=1 "hub-linux-amd64-$version/bin/hub" + fi ;; Darwin) curl -L "https://github.com/github/hub/releases/download/v$version/hub-darwin-amd64-$version.tgz" | tar xvz --strip-components=1 "hub-darwin-amd64-$version/bin/hub" diff --git a/.prepare_deploy b/.prepare_deploy index 226c16d..5785dfa 100755 --- a/.prepare_deploy +++ b/.prepare_deploy @@ -51,6 +51,14 @@ do rm "shellcheck" done +for file in *.linux-s390x +do + base="${file%.*}" + cp "$file" "shellcheck" + tar -cJf "$base.linux.s390x.tar.xz" --transform="s:^:$base/:" README.txt LICENSE.txt shellcheck + rm "shellcheck" +done + for file in *.darwin-x86_64 do base="${file%.*}" diff --git a/.travis.yml b/.travis.yml index d7d202b..4d96087 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,11 @@ jobs: create: name: ws-aarch64 paths: deploy + - env: BUILD=s390x + workspaces: + create: + name: ws-s390x + paths: deploy - env: BUILD=osx os: osx workspaces: @@ -42,6 +47,7 @@ jobs: - ws-linux - ws-armv6hf - ws-aarch64 + - ws-s390x - ws-windows script: - ls -la ${CASHER_DIR}/ || true