makedeb


wechat-devtools 2:1.05.2203030-2


WeChat Devtools For Linux.

Click here to go back to the commit logs for wechat-devtools.

Commit:


Hash: f58779b288fb93c342786e88d7857e780d428fef

Message: update

Diff


diff --git a/.SRCINFO b/.SRCINFO
index 8f94fb3..3562a0a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,25 @@
-generated-by = makedeb-makepkg
-
 pkgbase = wechat-devtools
-	pkgdesc = WeChat Devtools Linux version.
+	pkgdesc = WeChat Devtools For Linux.
 	pkgver = 1.05.2201240
-	pkgrel = 1
-	epoch = 1
-	url = https://github.com/msojocs/wechat-devtools-linux
+	pkgrel = 13
+	epoch = 2
+	url = https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
 	arch = x86_64
 	license = unknown
 	makedepends = p7zip
 	makedepends = python2
-	depends = wine
+	makedepends = openssl
+	makedepends = gcc
+	makedepends = make
+	makedepends = libssh2
+	makedepends = krb5
 	depends = gconf
 	depends = libxkbfile
 	options = !strip
 	source = nwjs-v0.53.1.tar.gz::https://npm.taobao.org/mirrors/nwjs/v0.53.1/nwjs-sdk-v0.53.1-linux-x64.tar.gz
 	source = wechat_devtools_1.05.2201240_x64.exe::https://dldir1.qq.com/WechatWebDev/release/p-ae42ee2cde4d42ee80ac60b35f183a99/wechat_devtools_1.05.2201240_x64.exe
 	source = node-v16.1.0.tar.gz::https://npm.taobao.org/mirrors/node/v16.1.0/node-v16.1.0-linux-x64.tar.gz
-	source = compiler.tar.xz::https://github.com/msojocs/wechat-devtools-linux/releases/download/v0.6/compiler.tar.xz
+	source = compiler.tar.gz::https://download.fastgit.org/msojocs/wechat-devtools-linux/releases/download/v0.17/compiler.tar.gz
 	source = wechat-devtools.desktop
 	source = logo.svg
 	source = fix-cli.sh
@@ -31,9 +33,9 @@ pkgbase = wechat-devtools
 	md5sums = b6f49803c51d0abacca2d1e566c7fe19
 	md5sums = 85552bae33e98eb186c5068419efce03
 	md5sums = 2280bfbbf29981fd5adce334f40146ff
-	md5sums = c638ccefe09941372903c08ce70420c3
-	md5sums = baf0db59fb340793854ac1ef23f68594
-	md5sums = 88e0efe5d58444b3d39695d4fb16d61b
+	md5sums = 87a3849f7105f411bee25da9532b0382
+	md5sums = 1abd6b4ebbbb918f601a6c5dbad55a05
+	md5sums = 0f4353664123320280ea4d6bb295dce2
 	md5sums = SKIP
 	md5sums = SKIP
 	md5sums = SKIP
diff --git a/.gitignore b/.gitignore
index 81f4d8e..ebe1af7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,7 @@ node*.tar.gz
 pkg/
 src/
 
-compiler.tar.xz
+compiler.tar.gz
 wechat-devtools-*.pkg.tar.xz
 wechat-devtools-*.pkg.tar.zst
-*.deb
+*.deb
\ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
index 60c72b6..5ca5c46 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,19 +18,19 @@ _node_version="16.1.0"
 
 pkgname=wechat-devtools
 pkgver="${_wechat_devtools_ver}"  # 主版本号
-pkgrel=1   # 次版本号release
-epoch=1    # 大版本迭代强制更新(维护者变更,尽量不用)
-pkgdesc="WeChat Devtools Linux version. "
+pkgrel=13   # 次版本号release
+epoch=2    # 大版本迭代强制更新(维护者变更,尽量不用)
+pkgdesc="WeChat Devtools For Linux. "
 arch=("x86_64")
-url="https://github.com/msojocs/wechat-devtools-linux"
+url="https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html"
 license=('unknown')
-depends=('wine' 'gconf' 'libxkbfile')
-makedepends=('p7zip' 'python2')
-# compiler 用于可视化
+depends=('gconf' 'libxkbfile')
+makedepends=('p7zip' 'python2' 'openssl' 'gcc' 'make' 'libssh2' 'krb5')
+# compiler 用于可视化,以及编译
 source=("nwjs-v${_nwjs_ver}.tar.gz::https://npm.taobao.org/mirrors/nwjs/v${_nwjs_ver}/nwjs-sdk-v${_nwjs_ver}-linux-x64.tar.gz"
         "${_wechat_devtools_exe}::${_wechat_devtools_url}"
         "node-v${_node_version}.tar.gz::https://npm.taobao.org/mirrors/node/v${_node_version}/node-v${_node_version}-linux-x64.tar.gz"
-        "compiler.tar.xz::https://github.com/msojocs/wechat-devtools-linux/releases/download/v0.6/compiler.tar.xz"
+        "compiler.tar.gz::https://download.fastgit.org/msojocs/wechat-devtools-linux/releases/download/v0.17/compiler.tar.gz"
         "wechat-devtools.desktop"
         "logo.svg"
         "fix-cli.sh"
@@ -41,12 +41,12 @@ source=("nwjs-v${_nwjs_ver}.tar.gz::https://npm.taobao.org/mirrors/nwjs/v${_nwjs
         "wxvpkg_pack"
         "wxvpkg_unpack"
         "fix-other.sh")
-md5sums=(b6f49803c51d0abacca2d1e566c7fe19
+md5sums=(b6f49803c51d0abacca2d1e566c7fe19   # nwjs
          "${_wechat_devtools_md5}"
-         2280bfbbf29981fd5adce334f40146ff
-         c638ccefe09941372903c08ce70420c3
-         baf0db59fb340793854ac1ef23f68594
-         88e0efe5d58444b3d39695d4fb16d61b
+         2280bfbbf29981fd5adce334f40146ff   # nodejs
+         87a3849f7105f411bee25da9532b0382   # compiler
+         1abd6b4ebbbb918f601a6c5dbad55a05   # desktop
+         0f4353664123320280ea4d6bb295dce2   # svg
          "SKIP"
          "SKIP"
          "SKIP"
@@ -83,6 +83,7 @@ build() {
     export NW_PACKAGE_DIR="${srcdir}/wechat_devtools/code/package.nw"
     export NW_VERSION=$_nwjs_ver
     export srcdir=$srcdir
+    export NO_WINE=true
     
     for script in fix-package-name-node fix-cli.sh fix-other.sh fix-menu.sh fix-core.sh rebuild-modules.sh; do
         _log "run ${script}"
diff --git a/fix-core.sh b/fix-core.sh
index a53b724..a34f091 100644
--- a/fix-core.sh
+++ b/fix-core.sh
@@ -1,11 +1,13 @@
 #!/bin/bash
-echo "Fix Cloud Console"
+echo "Fix Core"
 
 package_dir="$srcdir/wechat_devtools/code/package.nw"
 tmp_dir=$(mktemp -d)
+unpack_script="$srcdir/wxvpkg_unpack"
+pack_script="$srcdir/wxvpkg_pack"
 
 # unpack 文件 到 路径
-node "$srcdir/wxvpkg_unpack" "$package_dir/core.wxvpkg" "$tmp_dir/core.wxvpkg"
+node "$unpack_script" "$package_dir/core.wxvpkg" "$tmp_dir/core.wxvpkg"
 
 #    ____  _____ ____  _        _    ____ _____    ____ ___  ____  _____ 
 #   |  _ \| ____|  _ \| |      / \  / ___| ____|  / ___/ _ \|  _ \| ____|
@@ -15,23 +17,47 @@ node "$srcdir/wxvpkg_unpack" "$package_dir/core.wxvpkg" "$tmp_dir/core.wxvpkg"
 #                                                                        
 
 # find
-open_find_result=$( grep -lr "this.props.onWindowOpenFail());" "$tmp_dir/core.wxvpkg" )
+open_find_result=$( grep -lr "this.props.onWindowOpenFail());if" "$tmp_dir/core.wxvpkg" )
 echo "云开发控制台启动点: $open_find_result"
-# replace
-new_cb_handle="this.props.onWindowOpenFail());Object.keys(window).forEach(key=>{if(!e.window[key]){try{e.window[key]=window[key];}catch(e){console.error(e);}}});"
-sed -i "s/this.props.onWindowOpenFail());/$new_cb_handle/g" $open_find_result
+if [[ ! -z $open_find_result ]];then
+  # replace
+  new_cb_handle="this.props.onWindowOpenFail());Object.keys(window).forEach(key=>{if(!e.window[key]){try{e.window[key]=window[key];}catch(e){console.error(e);}}});"
+  sed -i "s/this.props.onWindowOpenFail());/$new_cb_handle/g" $open_find_result
+fi
 
 token_find_result=$( grep -lr "constructor(){this._sessionToken=\"\",this._tokenMap={}}" "$tmp_dir/core.wxvpkg" )
 echo "WebSocket token存储对象位置: $token_find_result"
-new_constructor="constructor(){if(window.tokenData){/*有就直接用*/this._sessionToken=window.tokenData._sessionToken;this._tokenMap=window.tokenData._tokenMap;}else{/*没有就新建*/this._sessionToken=\"\",this._tokenMap={};window.tokenData=this;/*新建完要给中间人*/}}"
-sed -i "s#constructor(){this._sessionToken=\"\",this._tokenMap={}}#$new_constructor#g" "$token_find_result"
+if [[ ! -z $token_find_result ]];then
+  new_constructor="constructor(){if(window.tokenData){/*有就直接用*/this._sessionToken=window.tokenData._sessionToken;this._tokenMap=window.tokenData._tokenMap;}else{/*没有就新建*/this._sessionToken=\"\",this._tokenMap={};window.tokenData=this;/*新建完要给中间人*/}}"
+  sed -i "s#constructor(){this._sessionToken=\"\",this._tokenMap={}}#$new_constructor#g" "$token_find_result"
+fi
 
 # open -a Terminal "`pwd`" --> gnome-terminal
 find_result=$( grep -lr 'open -a Terminal "`pwd`"' "$tmp_dir/core.wxvpkg" )
-echo "Terminal启动位置: $find_result"
-new_str="gnome-terminal"
-sed -i "s#open -a Terminal \"\`pwd\`\"#$new_str#g" "$find_result"
+if [[ ! -z $find_result ]];then
+  echo "Terminal启动位置: $find_result"
+  new_str="gnome-terminal"
+  sed -i "s#open -a Terminal \"\`pwd\`\"#$new_str#g" "$find_result"
+fi
+
+# wcc、wcsc处理,设置NO_WINE=true环境变量生效
+if [[ $NO_WINE == 'true' ]];then
+  # "wcc.exe":!0,"wcsc.exe":!0
+  find_result=$( grep -lr '{wcc:!0,wcsc:!0,DevToolProtector:!0}' "$tmp_dir/core.wxvpkg" )
+  if [[ ! -z $find_result ]];then
+    echo "wcc: $find_result"
+    new_str='{"wcc.bin":!0,"wcsc.bin":!0,wcc:!0,wcsc:!0,DevToolProtector:!0}'
+    sed -i "s#{wcc:!0,wcsc:!0,DevToolProtector:!0}#$new_str#g" "$find_result"
+    new_str='"linux"===process.platform'
+    sed -i "s#\"darwin\"===process.platform#$new_str#g" "$find_result"
+  fi
+
+  current=`date "+%Y-%m-%d %H:%M:%S"`
+  timeStamp=`date -d "$current" +%s`
+  echo $timeStamp > "${package_dir}/.build_time"
+fi
 
 # pack 路径 到 文件
-node "$srcdir/wxvpkg_pack" "$tmp_dir/core.wxvpkg" "$package_dir/core.wxvpkg"
-rm -rf "$tmp_dir"
\ No newline at end of file
+echo "pack"
+node "$pack_script" "$tmp_dir/core.wxvpkg" "$package_dir/core.wxvpkg"
+rm -rf "$tmp_dir/core.wxvpkg"
diff --git a/fix-other.sh b/fix-other.sh
index 8f4f80b..c179ca6 100644
--- a/fix-other.sh
+++ b/fix-other.sh
@@ -12,20 +12,11 @@ sed -i 's#module.exports = createWebviewManager;#module.exports = createWebviewM
 
 # 修复:可视化用的wcc,wcsc
 echo "fix: wcc,wcsc"
-mkdir "$tmp_dir/node_modules"
+if [[ ! -d "$tmp_dir/node_modules" ]];then
+  mkdir "$tmp_dir/node_modules"
+fi
 cd $tmp_dir && npm install miniprogram-compiler
 # wcc wcsc
-# 预览编译
-# cd "${package_dir}/js/vendor/" && rm -rf "wcc.exe"
-# cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcc" "${package_dir}/js/vendor/wcc.exe"
-# wcc_md5=$( md5sum wcc.exe|cut -d ' ' -f1 ) && \
-# sed -i  's/wcc.exe": ".*"/wcc.exe": "'"${wcc_md5}"'"/g' "config.json"
-# cd "${package_dir}/js/vendor/" && rm -rf "wcsc.exe"
-# cp "${package_dir}/node_modules_tmp/node_modules/miniprogram-compiler/bin/linux/wcsc" "${package_dir}/js/vendor/wcsc.exe"
-# cd "${package_dir}/js/vendor" && \
-# wcsc_md5=$( md5sum wcsc.exe|cut -d ' ' -f1 ) && \
-# sed -i  's/wcsc.exe": ".*"/wcsc.exe": "'"${wcsc_md5}"'"/g' "config.json"
-
 # 可视化编译
 (cd "${package_dir}/node_modules/" \
 && rm -rf wcc wcsc \
@@ -36,4 +27,19 @@ cd $tmp_dir && npm install miniprogram-compiler
 && cp -r "${srcdir}/compiler/wcsc_node"/* "wcsc"
 )
 
-rm -rf $tmp_dir
\ No newline at end of file
+# 预览编译,设置NO_WINE=true环境变量生效
+# 如果是mac执行wcc,否则wcc.exe
+if [[ $NO_WINE == 'true' ]];then
+  \cp -rf "${srcdir}/compiler/generatemd5.js" "${package_dir}/js/vendor/generatemd5.js"
+  \cp -rf "${srcdir}/compiler/nodejs/wcc" "${package_dir}/js/vendor/wcc"
+  \cp -rf "${srcdir}/compiler/nodejs/wcsc" "${package_dir}/js/vendor/wcsc"
+  \cp -rf "${tmp_dir}/node_modules/miniprogram-compiler/bin/linux/wcc" "${package_dir}/js/vendor/wcc.bin"
+  \cp -rf "${tmp_dir}/node_modules/miniprogram-compiler/bin/linux/wcsc" "${package_dir}/js/vendor/wcsc.bin"
+  node "${package_dir}/js/vendor/generatemd5.js"
+
+  current=`date "+%Y-%m-%d %H:%M:%S"`
+  timeStamp=`date -d "$current" +%s`
+  echo $timeStamp > "${package_dir}/.build_time"
+fi
+
+rm -rf "$tmp_dir/node_modules"
\ No newline at end of file
diff --git a/fix-package-name-node b/fix-package-name-node
index c8d1a0c..a37f59e 100644
--- a/fix-package-name-node
+++ b/fix-package-name-node
@@ -4,11 +4,9 @@ const fs = require("fs");
 
 const parseFile = function (path) {
 
-    console.log("fix start")
     if (!fs.existsSync(path)) {
         return;
     }
-    console.log("content")
     let content = JSON.parse(fs.readFileSync(path, "utf8"));
 
     content.name = "wechat_devtools";
diff --git a/rebuild-modules.sh b/rebuild-modules.sh
index 9f82685..e58bca7 100644
--- a/rebuild-modules.sh
+++ b/rebuild-modules.sh
@@ -102,12 +102,13 @@ cp -fr "${package_dir}/node_modules_tmp/node_modules/nodegit" "${package_dir}/no
 (cp -fr "${package_dir}/node_modules_tmp/node_modules/oniguruma" "${package_dir}/node_modules_tmp/node_modules/oniguruma-node")
 (cp -fr "${package_dir}/node_modules_tmp/node_modules/spdlog" "${package_dir}/node_modules_tmp/node_modules/spdlog-node")
 
-(cd "${package_dir}/node_modules_tmp/node_modules" && find -name "obj.target" | xargs -I{} rm -rf {})
-(cd "${package_dir}/node_modules_tmp/node_modules" && find -name "*.node" | xargs -I{} cp -rf {} ${package_dir}/node_modules/{})
+(cd "${package_dir}/node_modules_tmp/node_modules" && find -name ".deps" | xargs -I{} rm -rf {} && find -name "obj.target" | xargs -I{} rm -rf {} && find -name "*.a" -delete && find -name "*.lib" -delete && find -name "*.mk" -delete)
+(cd "${package_dir}/node_modules_tmp/node_modules" && find -name "*.node" | xargs -I{} \cp -rf {} ${package_dir}/node_modules/{})
 
 mkdir -p "${package_dir}/node_modules/vscode-ripgrep/bin"
-cp -fr "${package_dir}/node_modules_tmp/node_modules/vscode-ripgrep/bin/rg" "${package_dir}/node_modules/vscode-ripgrep/bin/rg"
+\cp -fr "${package_dir}/node_modules_tmp/node_modules/vscode-ripgrep/bin/rg" "${package_dir}/node_modules/vscode-ripgrep/bin/rg"
 
+(cd "${package_dir}/node_modules" && find -name ".deps" | xargs -I{} rm -rf {} && find -name "obj.target" | xargs -I{} rm -rf {} && find -name "*.a" -delete && find -name "*.lib" -delete && find -name "*.mk" -delete && find -name "*Makefile" -delete && find -name "*gyp*" -delete)
 rm -rf "${package_dir}/node_modules_tmp"
 
 # 移除旧配置
diff --git a/wechat-devtools.desktop b/wechat-devtools.desktop
index ded5c05..03ddbb0 100644
--- a/wechat-devtools.desktop
+++ b/wechat-devtools.desktop
@@ -3,10 +3,10 @@ Name=WeChat Devtools
 Name[zh_CN]=微信web开发者工具
 Comment=The development tools for wechat web develop
 Categories=Development;WebDevelopment;IDE;
-Exec=env APPDATA=/opt/wechat-devtools/ USERPROFILE=~ /opt/wechat-devtools/nw --load-extension=~/.config/wechat_devtools/WeappPlugin --custom-devtools-frontend=file:///opt/wechat-devtools/package.nw/js/ideplugin/inspector %U
+Exec=env APPDATA=~/.config/wechat_devtools USERPROFILE=~ bash -c ' clean_cache(){ echo "清理缓存"; rm -rf "$APPDATA/WeappCache"; rm -rf "$APPDATA/WeappVendor";}; if [[ -f "$APPDATA/.build_time" ]];then diff "$APPDATA/.build_time" "/opt/wechat-devtools/package.nw/.build_time" >/dev/null; if [ ! "$?" == "0" ];then \cp -f "/opt/wechat-devtools/package.nw/.build_time" "$APPDATA/.build_time";clean_cache; fi; else \cp -f "/opt/wechat-devtools/package.nw/.build_time" "$APPDATA/.build_time"; clean_cache; fi; /opt/wechat-devtools/nw --load-extension=~/.config/wechat_devtools/WeappPlugin --custom-devtools-frontend=file:///opt/wechat-devtools/package.nw/js/ideplugin/inspector %U'
 Path=/opt/wechat-devtools
 Icon=wechat-devtools
 Type=Application
 Terminal=false
 StartupWMClass=nwjs_mbeenbnhnmdhkbicabncjghgnikfbgjh
-MimeType=x-scheme-handler/wechatide
+MimeType=x-scheme-handler/wechatide
\ No newline at end of file