summaryrefslogtreecommitdiffstats
path: root/packaging/bundle-lws.sh
blob: c4ffc7780ed41ed25375625eb97f74f2c978914d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

startdir="${PWD}"

LWS_TARBALL="v$(cat "${1}/packaging/libwebsockets.version").tar.gz"
LWS_BUILD_PATH="${1}/externaldeps/libwebsockets/libwebsockets-$(cat "${1}/packaging/libwebsockets.version")"

mkdir -p "${1}/externaldeps/libwebsockets" || exit 1
curl -sSL --connect-timeout 10 --retry 3 "https://github.com/warmcat/libwebsockets/archive/${LWS_TARBALL}" > "${LWS_TARBALL}" || exit 1
sha256sum -c "${1}/packaging/libwebsockets.checksums" || exit 1
tar -xzf "${LWS_TARBALL}" -C "${1}/externaldeps/libwebsockets" || exit 1
cd "${LWS_BUILD_PATH}" || exit 1
cmake -Wno-dev -Wno-deprecated -D LWS_WITH_SOCKS5:boolean=YES -D WITHOUT_LWS_TESTAPPS:boolean=YES . || exit 1
make || exit 1
cd "${startdir}" || exit 1
cp -a "${LWS_BUILD_PATH}/lib/libwebsockets.a" "${1}/externaldeps/libwebsockets" || exit 1
cp -a "${LWS_BUILD_PATH}/include" "${1}/externaldeps/libwebsockets" || exit 1