Skip to content

Commit ab7a02f

Browse files
authored
Merge pull request #17 from ttdennis/socat-ppc
Socat powerpc and powerpc64 builds
2 parents 56b6651 + b322d1b commit ab7a02f

File tree

4 files changed

+90
-2
lines changed

4 files changed

+90
-2
lines changed

.github/workflows/build-socat.yml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,74 @@ jobs:
116116
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
117117
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}
118118

119+
build-ppc32:
120+
name: Build socat powerpc32
121+
runs-on: ubuntu-latest
122+
container: muslcc/x86_64:powerpc-linux-musl
123+
steps:
124+
- name: Checkout
125+
uses: actions/checkout@v2
126+
127+
- name: Install dependencies
128+
run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh
129+
130+
- name: Install testing dependencies
131+
run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl
132+
133+
- name: Install build compiler
134+
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"
135+
env:
136+
ARCH: x86_64-linux-musl
137+
HOST: http://musl.cc/
138+
TEMP: /tmp
139+
USER: 0
140+
141+
- name: Build socat
142+
id: build_socat
143+
run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc32
144+
145+
- name: Upload artifacts
146+
uses: actions/upload-artifact@v2
147+
with:
148+
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
149+
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}
150+
151+
build-ppc64:
152+
name: Build socat powerpc64
153+
runs-on: ubuntu-latest
154+
container: muslcc/x86_64:powerpc64-linux-musl
155+
steps:
156+
- name: Checkout
157+
uses: actions/checkout@v2
158+
159+
- name: Install dependencies
160+
run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh
161+
162+
- name: Install testing dependencies
163+
run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl
164+
165+
- name: Install build compiler
166+
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"
167+
env:
168+
ARCH: x86_64-linux-musl
169+
HOST: http://musl.cc/
170+
TEMP: /tmp
171+
USER: 0
172+
173+
- name: Build socat
174+
id: build_socat
175+
run: $GITHUB_WORKSPACE/build/targets/build_socat.sh ppc64
176+
177+
- name: Upload artifacts
178+
uses: actions/upload-artifact@v2
179+
with:
180+
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
181+
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}
182+
119183
create-release:
120184
name: Create socat Release
121185
runs-on: ubuntu-latest
122-
needs: [build-x86, build-x86_64, build-armhf, build-aarch64]
186+
needs: [build-x86, build-x86_64, build-armhf, build-aarch64, build-ppc32, build-ppc64]
123187
steps:
124188
- name: Checkout
125189
uses: actions/checkout@v2

build/install_deps_alpine.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ apk add \
1313
libtool \
1414
qemu-arm \
1515
qemu-aarch64 \
16+
qemu-ppc \
17+
qemu-ppc64 \
1618
file \
1719
texinfo \
1820
zip \

build/lib.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ get_host_triple(){
4747
host="arm-linux-musleabihf"
4848
elif [ "$CURRENT_ARCH" == "aarch64" ];then
4949
host="aarch64-linux-musl"
50+
elif [ "$CURRENT_ARCH" == "ppc32" ];then
51+
host="powerpc-linux-musl"
52+
elif [ "$CURRENT_ARCH" == "ppc64" ];then
53+
host="powerpc64-linux-musl"
5054
fi
5155
echo $host
5256
}
@@ -145,6 +149,20 @@ get_version(){
145149
else
146150
echo "qemu-aarch64 not found, skipping AARCH64 version checks." >&2
147151
fi
152+
elif [ "$CURRENT_ARCH" == "ppc32" ];then
153+
if which qemu-ppc 1>&2 2>/dev/null;then
154+
cmd="qemu-ppc ${cmd}"
155+
version+=$(eval "$cmd")
156+
else
157+
echo "qemu-ppc not found, skipping ppc32 version checks." >&2
158+
fi
159+
elif [ "$CURRENT_ARCH" == "ppc64" ];then
160+
if which qemu-ppc64 1>&2 2>/dev/null;then
161+
cmd="qemu-ppc64 ${cmd}"
162+
version+=$(eval "$cmd")
163+
else
164+
echo "qemu-ppc64 not found, skipping ppc64 version checks." >&2
165+
fi
148166
else
149167
version+=$(eval "$cmd")
150168
fi
@@ -214,6 +232,10 @@ lib_build_openssl(){
214232
openssl_arch="linux-x86_64"
215233
elif [ "${CURRENT_ARCH}" == "aarch64" ];then
216234
openssl_arch="linux-generic64"
235+
elif [ "${CURRENT_ARCH}" == "ppc32" ];then
236+
openssl_arch="linux-ppc"
237+
elif [ "${CURRENT_ARCH}" == "ppc64" ];then
238+
openssl_arch="linux-ppc"
217239
fi
218240
CFLAGS="${GCC_OPTS}" \
219241
./Configure \

build/targets/build_socat.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if [ -z "$GITHUB_WORKSPACE" ];then
44
exit 1
55
fi
66
if [ "$#" -ne 1 ];then
7-
echo "Usage: ${0} [x86|x86_64|armhf|aarch64]"
7+
echo "Usage: ${0} [x86|x86_64|armhf|aarch64|ppc32|ppc64]"
88
echo "Example: ${0} x86_64"
99
exit 1
1010
fi

0 commit comments

Comments
 (0)