Compare commits

...

3 Commits

Author SHA1 Message Date
df5d08cd68 应用运行库新增bwrap识别 2024-07-21 11:46:54 +08:00
2357c646a1 优化在termux的使用体验 2024-07-21 11:34:44 +08:00
0b0a757765 添加NOVNC 2024-07-21 09:36:40 +08:00
8 changed files with 41 additions and 3 deletions

3
.gitmodules vendored Normal file

@ -0,0 +1,3 @@
[submodule "novnc"]
path = novnc
url = https://github.com/novnc/noVNC

@ -146,6 +146,8 @@ copy-files:
cp -rv RemoveQemuUser.sh deb/opt/apps/deepin-wine-runner
cp -rv InstallBox86.sh deb/opt/apps/deepin-wine-runner
cp -rv InstallRuntime deb/opt/apps/deepin-wine-runner
if [[ ! -d novnc/utils/websockify ]]; then git submodule update --init --recursive ; fi
cp -rv novnc deb/opt/apps/deepin-wine-runner
mkdir -pv deb/opt/apps/deepin-wine-runner/entries/
cp -rv deb/usr/share/applications deb/opt/apps/deepin-wine-runner/entries/applications
python3 UpdateTime.py
@ -210,6 +212,9 @@ package-termux-deb:
sudo cp deb-termux/DEBIAN /tmp/spark-deepin-wine-runner-builder/DEBIAN -rv
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/entries/applications
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/share/applications
# 加入 termux loader
sudo cp -rv mainwindow-termux-loader.sh /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner
sudo cp -rv mainwindow.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/mainwindow.py
sudo bash builddeb/ChangeDebVersion.sh
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-termux.deb
make remove-copy-files -j$(nproc)

@ -1,6 +1,8 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
import PyQt5.QtWidgets as QtWidgets
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
arch = subprocess.getoutput("dpkg --print-architecture").replace(" ", "").replace("\n", "")
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
@ -13,6 +15,10 @@ if not os.path.exists(f"{programPath}/VirtualMachine-amd64"):
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
os.system(f"{programPath}/VirtualMachine-{arch}")
exit()
app = QtWidgets.QApplication(sys.argv)
QtWidgets.QMessageBox.information(None, "提示", "虚拟机安装器暂不支持此系统")
exit(1)
# 后面已废弃
# 只能使用 Qemu User 运行程序
if os.path.exists("/usr/lib/x86_64-linux-gnu/") and not os.system("which qemu-x86_64"):
os.system(f"qemu-x86_64 '{programPath}/VirtualMachine-x86_64'")

@ -26,7 +26,8 @@ Depends: python3,
git,
xfwm4,
tigervnc,
proot
proot,
bash
Recommends: winbind,
wimtools | wimlib,
python3-pyquery,

@ -27,7 +27,8 @@ Depends: python3,
zenity,
tree,
dpkg,
fakeroot
fakeroot,
bash
Recommends: winbind,
wimtools | wimlib,
python3-pyquery,

14
mainwindow-termux-loader.sh Executable file

@ -0,0 +1,14 @@
#!/data/data/com.termux/files/usr/bin/bash
CURRENT_DIR=$(cd $(dirname $0); pwd)
if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]]; then
# 自动配置 NoVNC
export DISPLAY=:5
vncserver $DISPLAY &
sleep 3
xfwm4 &
if [[ -f /data/data/com.termux/files/usr/bin/startxfce4 ]]; then
startxfce4 &
fi
$CURRENT_DIR/novnc/utils/novnc_proxy --vnc localhost:5905 &
fi
python3 $CURRENT_DIR/mainwindow.py

@ -3172,7 +3172,7 @@ if os.path.exists(f"{programPath}/WineLib/usr"):
libPathList.append(f"{libPath}/{i}/")
AddRunnerLib(len(libPathList) - 1, f"{i}/")
print(libPathList)
if os.path.exists(f"{programPath}/InstallRuntime"):
if os.path.exists(f"{programPath}/InstallRuntime") and (not os.system("which bwrap")):
installLib.addSeparator()
systemalllibinfo = QtWidgets.QAction("全局运行库(与其他运行库以及部分兼容层冲突)")
systemalllibinfo.setDisabled(True)
@ -3307,6 +3307,13 @@ for i in [
if not os.path.exists(i[1]):
for x in i[0]:
x.setDisabled(True)
# 有些功能是 Termux 不适用的,需要屏蔽
if os.system("which bwrap"):
for i in [
installLib, howtouseQemuUser, runnerlibinfo, installRunnerLib,
statusRunnerLib, removeRunnerLib, diyRunnerLib, diyRunnerLibRemoveTips,
]:
i.setDisabled(True)
# 有些功能是 Arch Linux 不适用的,需要屏蔽
if not os.path.exists("/etc/debian_version"):
if os.path.exists(f"{programPath}/off-line.lock"):

1
novnc Submodule

@ -0,0 +1 @@
Subproject commit 7fcf9dcfe0cc5b14e3841a4429dc091a6ffca861