feat: no wine support

This commit is contained in:
msojocs 2022-02-22 18:04:24 +08:00
parent d14fd2c0aa
commit b7891922e2
7 changed files with 12 additions and 17 deletions

View File

@ -92,15 +92,15 @@ jobs:
tar -zvcf ${{ env.name }}_${{ env.ARCH }}_wine.tar.gz ${{ env.name }}
# reduce wine
export REDUCE_WINE=true
export NO_WINE=true
bash ${{ env.name }}/tools/fix-core
bash ${{ env.name }}/tools/fix-other
bash ./${{ env.name }}/tools/appimage.sh
# build AppImage
./appimagetool-x86_64.AppImage ./${{ env.name }}/tmp/AppDir ${{ env.name }}_${{ env.ARCH }}_reduce_wine.AppImage
./appimagetool-x86_64.AppImage ./${{ env.name }}/tmp/AppDir ${{ env.name }}_${{ env.ARCH }}_no_wine.AppImage
sudo rm -rf compiler nodegit ${{ env.name }}/tmp
# pack
tar -zvcf ${{ env.name }}_${{ env.ARCH }}_reduce_wine.tar.gz ${{ env.name }}
tar -zvcf ${{ env.name }}_${{ env.ARCH }}_no_wine.tar.gz ${{ env.name }}
sudo rm -rf appimagetool-x86_64.AppImage ${{ env.name }}
ls -l

View File

@ -8,4 +8,5 @@ services:
environment:
- ACTION=${ACTION_MODE:-false}
- https_proxy=${https_proxy:-}
- NO_WINE=${NO_WINE:-false}
entrypoint: /workspace/docker/entrypoint

View File

@ -69,7 +69,7 @@ Docker容器启动方法
# 自行构建
> 注:
> 如需进行降低`wine`依赖的操作,请添加环境变量:`REDUCE_WINE=true`
> 如果不想使用`wine`,请添加环境变量:`NO_WINE=true`,但是稳定性未测试
## 方法0推荐

View File

@ -1,6 +1,5 @@
#!/bin/bash
export REDUCE_WINE=true
export NO_WINE=true
root_dir=$(cd `dirname $0`/.. && pwd -P)
$root_dir/tools/fix-core

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [[ $REDUCE_WINE == 'true' ]];then
if [[ $NO_WINE == 'true' ]];then
echo "not wine"
fi

View File

@ -40,13 +40,13 @@ if [[ ! -z $find_result ]];then
sed -i "s#open -a Terminal \"\`pwd\`\"#$new_str#g" "$find_result"
fi
# wcc、wcsc处理设置REDUCE_WINE环境变量生效
if [[ $REDUCE_WINE == 'true' ]];then
# 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.exe":!0,"wcsc.exe":!0,"wcc.bin":!0,"wcsc.bin":!0,wcc:!0,wcsc:!0,DevToolProtector:!0}'
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"
@ -61,8 +61,3 @@ fi
echo "pack"
node "$root_dir/tools/wxvpkg/pack" "$tmp_dir/core.wxvpkg" "$package_dir/core.wxvpkg"
rm -rf "$tmp_dir/core.wxvpkg"
if [ -d ~/.config/wechat_devtools/WeappCache ];then
echo "删除缓存"
rm -rf ~/.config/wechat_devtools/WeappCache
fi

View File

@ -29,9 +29,9 @@ cd $tmp_dir && npm install miniprogram-compiler
&& cp -r "${srcdir}/compiler/wcsc_node"/* "wcsc"
)
# 预览编译,设置REDUCE_WINE环境变量生效
# 预览编译,设置NO_WINE=true环境变量生效
# 如果是mac执行wcc,否则wcc.exe
if [[ $REDUCE_WINE == 'true' ]];then
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"