Skip to content

Commit

Permalink
Merge pull request #17 from ttdennis/socat-ppc
Browse files Browse the repository at this point in the history
Socat powerpc and powerpc64 builds
  • Loading branch information
sven-ernw authored Jun 9, 2023
2 parents 56b6651 + b322d1b commit ab7a02f
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 2 deletions.
66 changes: 65 additions & 1 deletion .github/workflows/build-socat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,74 @@ jobs:
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}

build-ppc32:
name: Build socat powerpc32
runs-on: ubuntu-latest
container: muslcc/x86_64:powerpc-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh

- name: Install testing dependencies
run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl

- name: Install build compiler
run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross"
env:
ARCH: x86_64-linux-musl
HOST: http://musl.cc/
TEMP: /tmp
USER: 0

- name: Build socat
id: build_socat
run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc32

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}

build-ppc64:
name: Build socat powerpc64
runs-on: ubuntu-latest
container: muslcc/x86_64:powerpc64-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh

- name: Install testing dependencies
run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl

- name: Install build compiler
run: /bin/sh -c "apk update && apk upgrade && apk add --no-cache curl rsync sudo util-linux && cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross"
env:
ARCH: x86_64-linux-musl
HOST: http://musl.cc/
TEMP: /tmp
USER: 0

- name: Build socat
id: build_socat
run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc64

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}

create-release:
name: Create socat Release
runs-on: ubuntu-latest
needs: [build-x86, build-x86_64, build-armhf, build-aarch64]
needs: [build-x86, build-x86_64, build-armhf, build-aarch64, build-ppc32, build-ppc64]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions build/install_deps_alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ apk add \
libtool \
qemu-arm \
qemu-aarch64 \
qemu-ppc \
qemu-ppc64 \
file \
texinfo \
zip \
Expand Down
22 changes: 22 additions & 0 deletions build/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ get_host_triple(){
host="arm-linux-musleabihf"
elif [ "$CURRENT_ARCH" == "aarch64" ];then
host="aarch64-linux-musl"
elif [ "$CURRENT_ARCH" == "ppc32" ];then
host="powerpc-linux-musl"
elif [ "$CURRENT_ARCH" == "ppc64" ];then
host="powerpc64-linux-musl"
fi
echo $host
}
Expand Down Expand Up @@ -145,6 +149,20 @@ get_version(){
else
echo "qemu-aarch64 not found, skipping AARCH64 version checks." >&2
fi
elif [ "$CURRENT_ARCH" == "ppc32" ];then
if which qemu-ppc 1>&2 2>/dev/null;then
cmd="qemu-ppc ${cmd}"
version+=$(eval "$cmd")
else
echo "qemu-ppc not found, skipping ppc32 version checks." >&2
fi
elif [ "$CURRENT_ARCH" == "ppc64" ];then
if which qemu-ppc64 1>&2 2>/dev/null;then
cmd="qemu-ppc64 ${cmd}"
version+=$(eval "$cmd")
else
echo "qemu-ppc64 not found, skipping ppc64 version checks." >&2
fi
else
version+=$(eval "$cmd")
fi
Expand Down Expand Up @@ -214,6 +232,10 @@ lib_build_openssl(){
openssl_arch="linux-x86_64"
elif [ "${CURRENT_ARCH}" == "aarch64" ];then
openssl_arch="linux-generic64"
elif [ "${CURRENT_ARCH}" == "ppc32" ];then
openssl_arch="linux-ppc"
elif [ "${CURRENT_ARCH}" == "ppc64" ];then
openssl_arch="linux-ppc"
fi
CFLAGS="${GCC_OPTS}" \
./Configure \
Expand Down
2 changes: 1 addition & 1 deletion build/targets/build_socat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ -z "$GITHUB_WORKSPACE" ];then
exit 1
fi
if [ "$#" -ne 1 ];then
echo "Usage: ${0} [x86|x86_64|armhf|aarch64]"
echo "Usage: ${0} [x86|x86_64|armhf|aarch64|ppc32|ppc64]"
echo "Example: ${0} x86_64"
exit 1
fi
Expand Down

0 comments on commit ab7a02f

Please sign in to comment.