|
| 1 | +#!/bin/bash |
| 2 | +# set -e |
| 3 | + |
| 4 | +notice() { |
| 5 | + echo -e "\033[36m $1 \033[0m " |
| 6 | +} |
| 7 | + |
| 8 | +strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC |
| 9 | +strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2 |
| 10 | +# gcc -v |
| 11 | +# g++ -v |
| 12 | +# cc -v |
| 13 | +# node --version |
| 14 | +# python --version |
| 15 | +# python3 --version |
| 16 | + |
| 17 | +echo "==============" |
| 18 | +cd /workspace |
| 19 | +# mkdir -p tmp/test/node_modules |
| 20 | +# cd tmp/test |
| 21 | +# npm install nodegit |
| 22 | +# tail -f /etc/issue |
| 23 | +./tools/setup-wechat-devtools-bash |
| 24 | + |
| 25 | +############ 构建deb包 ################ |
| 26 | +root_dir=$(cd `dirname $0`/../../.. && pwd -P) |
| 27 | +echo "root_dir: $root_dir" |
| 28 | +tmp_dir="$root_dir/tmp" |
| 29 | +app_dir="$root_dir/tmp/deb" |
| 30 | + |
| 31 | +# Remove any previous build |
| 32 | +rm -rf $app_dir |
| 33 | +# Make usr and icons dirs |
| 34 | +notice "Make Dirs" |
| 35 | +mkdir -p $app_dir/opt/wechat-devtools/bin |
| 36 | +mkdir -p $app_dir/usr/{src,bin} |
| 37 | +mkdir -p $app_dir/usr/share/{metainfo,icons,applications} |
| 38 | + |
| 39 | +notice "COPY Files" |
| 40 | +cp -r "$root_dir/res/deb/data"/* $app_dir |
| 41 | +cp "$root_dir/bin/wechat-devtools" "$app_dir/opt/wechat-devtools/bin" |
| 42 | +cp "$root_dir/res/deb.desktop" "$app_dir/usr/share/applications/wechat-devtools.desktop" |
| 43 | +if [[ ! $BUILD_VERSION -eq 'continuous' ]];then |
| 44 | + sed -i "s/BUILD_VERSION/${BUILD_VERSION//v/}/" "$app_dir/DEBIAN/control" |
| 45 | +else |
| 46 | + sed -i "s/BUILD_VERSION/0/" "$app_dir/DEBIAN/control" |
| 47 | +fi |
| 48 | +cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/usr/share/icons/wechat-devtools.png" |
| 49 | + |
| 50 | +cp -r "$root_dir/package.nw" "$app_dir/opt/wechat-devtools/package.nw" |
| 51 | +cp -r "$root_dir/nwjs" "$app_dir/opt/wechat-devtools/nwjs" |
| 52 | +rm -rf "$app_dir/opt/wechat-devtools/nwjs"/{node,node.exe} |
| 53 | +cp "$root_dir/node/bin/node" "$app_dir/opt/wechat-devtools/nwjs/node" |
| 54 | +cd "$app_dir/opt/wechat-devtools/nwjs/" && ln -s "node" "node.exe" |
| 55 | + |
| 56 | +notice "BUILD DEB Package" |
| 57 | +cd "$root_dir/tmp/deb" |
| 58 | +ls -l "$root_dir/tmp/deb" |
| 59 | +dpkg-deb -b . "WeChat_Dev_Tools_$BUILD_VERSION.deb" |
0 commit comments