forked from funera1/webassembly-language-runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwlr_package.sh
41 lines (36 loc) · 1.24 KB
/
wlr_package.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
#!/usr/bin/env bash
if [ "${BASH_SOURCE-}" = "$0" ]; then
echo "You must source this script: \$ source $0" >&2
return
fi
if [[ ! -v WLR_ENV ]]; then
echo "WLR build environment is not set"
exit 1
fi
function wlr_package_lib {
local _PACKAGE=${WLR_OUTPUT_BASE}/lib${WLR_PACKAGE_NAME}-${WLR_PACKAGE_VERSION}${WLR_BUILD_FLAVOR:+-$WLR_BUILD_FLAVOR}-${WASI_SDK_ASSET_NAME}.tar
logStatus "Packaging... ${_PACKAGE}"
tar -cvf ${_PACKAGE} \
-C ${WLR_OUTPUT}/ \
--exclude=*.la \
--exclude=lib/wasm32-wasi/cmake \
include \
lib ${WLR_PACKAGE_EXTRA_DIRS}
gzip -f ${_PACKAGE}
}
function wlr_package_bin {
local _PACKAGE=${WLR_OUTPUT_BASE}/${WLR_PACKAGE_NAME}-bin-${WLR_PACKAGE_VERSION}${WLR_BUILD_FLAVOR:+-$WLR_BUILD_FLAVOR}-${WASI_SDK_ASSET_NAME}.tar
logStatus "Packaging... ${_PACKAGE}"
tar -cvf ${_PACKAGE} \
-C ${WLR_OUTPUT}/ \
bin
gzip -f ${_PACKAGE}
}
function wlr_package {
local _PACKAGE=${WLR_OUTPUT_BASE}/${WLR_PACKAGE_NAME}-${WLR_PACKAGE_VERSION}${WLR_BUILD_FLAVOR:+-$WLR_BUILD_FLAVOR}-${WASI_SDK_ASSET_NAME}.tar
logStatus "Packaging... ${_PACKAGE}"
tar -cvf ${_PACKAGE} \
-C ${WLR_OUTPUT}/ \
${WLR_PACKAGE_LIST}
gzip -f ${_PACKAGE}
}