mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-07 00:02:14 +08:00
60 lines
1.7 KiB
Bash
Executable File
60 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# set -e
|
|
|
|
notice() {
|
|
echo -e "\033[36m $1 \033[0m "
|
|
}
|
|
|
|
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
|
|
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2
|
|
# gcc -v
|
|
# g++ -v
|
|
# cc -v
|
|
# node --version
|
|
# python --version
|
|
# python3 --version
|
|
|
|
echo "=============="
|
|
cd /workspace
|
|
# mkdir -p tmp/test/node_modules
|
|
# cd tmp/test
|
|
# npm install nodegit
|
|
# tail -f /etc/issue
|
|
./tools/setup-wechat-devtools-bash
|
|
|
|
############ 构建deb包 ################
|
|
root_dir=$(cd `dirname $0`/../../.. && pwd -P)
|
|
echo "root_dir: $root_dir"
|
|
tmp_dir="$root_dir/tmp"
|
|
app_dir="$root_dir/tmp/deb"
|
|
|
|
# Remove any previous build
|
|
rm -rf $app_dir
|
|
# Make usr and icons dirs
|
|
notice "Make Dirs"
|
|
mkdir -p $app_dir/opt/wechat-devtools/bin
|
|
mkdir -p $app_dir/usr/{src,bin}
|
|
mkdir -p $app_dir/usr/share/{metainfo,icons,applications}
|
|
|
|
notice "COPY Files"
|
|
cp -r "$root_dir/res/deb/data"/* $app_dir
|
|
cp "$root_dir/bin/wechat-devtools" "$app_dir/opt/wechat-devtools/bin"
|
|
cp "$root_dir/res/deb.desktop" "$app_dir/usr/share/applications/wechat-devtools.desktop"
|
|
if [[ ! $BUILD_VERSION -eq 'continuous' ]];then
|
|
sed -i "s/BUILD_VERSION/${BUILD_VERSION//v/}/" "$app_dir/DEBIAN/control"
|
|
else
|
|
sed -i "s/BUILD_VERSION/0/" "$app_dir/DEBIAN/control"
|
|
fi
|
|
cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/usr/share/icons/wechat-devtools.png"
|
|
|
|
cp -r "$root_dir/package.nw" "$app_dir/opt/wechat-devtools/package.nw"
|
|
cp -r "$root_dir/nwjs" "$app_dir/opt/wechat-devtools/nwjs"
|
|
rm -rf "$app_dir/opt/wechat-devtools/nwjs"/{node,node.exe}
|
|
cp "$root_dir/node/bin/node" "$app_dir/opt/wechat-devtools/nwjs/node"
|
|
cd "$app_dir/opt/wechat-devtools/nwjs/" && ln -s "node" "node.exe"
|
|
|
|
notice "BUILD DEB Package"
|
|
cd "$root_dir/tmp/deb"
|
|
ls -l "$root_dir/tmp/deb"
|
|
dpkg-deb -b . "WeChat_Dev_Tools_$BUILD_VERSION.deb"
|