-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.sh
executable file
·43 lines (33 loc) · 1.04 KB
/
pack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
. /etc/lsb-release
export DISTRIB="${DISTRIB_ID}-${DISTRIB_RELEASE}"
export SDKROOT=${SDKROOT:-/opt/python-wasm-sdk}
export CIVER=${CIVER:-$DISTRIB}
TAG=emsdk
pushd ${SDKROOT}
echo "Removing $(wc -l sdk.base) files belonging to SDK"
while IFS= read -r file ; do rm -- "$file" ; done < sdk.base
popd
echo "Making sdk-extra $TAG tarball"
pushd /
mkdir -p /tmp/sdk
cat > ${SDKROOT}/extra.installed << END
EXTRA_PYBUILD=${PYBUILD}
EXTRA_TAG=
EXTRA_CIVER=${CIVER}
END
tar -cpPR \
${SDKROOT}/extra.installed \
${SDKROOT}/python3-was? \
${SDKROOT}/wasm32-*-shell.sh \
${SDKROOT}/*sdk \
${SDKROOT}/scripts/*sdk-fetch.sh \
${SDKROOT}/devices/* \
${SDKROOT}/prebuilt/* \
> /tmp/sdk/python${PYBUILD}-${TAG}-sdk-extra-${CIVER}.tar
lz4 -c --favor-decSpeed --best /tmp/sdk/python${PYBUILD}-${TAG}-sdk-extra-${CIVER}.tar \
> /tmp/sdk/python${PYBUILD}-${TAG}-sdk-extra-${CIVER}.tar.lz4
du -hs /tmp/sdk/*
rm /tmp/sdk/python${PYBUILD}-${TAG}-sdk-extra-${CIVER}.tar
echo "done" 1>&2
popd