Skip to content

Commit

Permalink
Merge pull request #60 from weilinfox/main
Browse files Browse the repository at this point in the history
Add 0.14.0 doc
  • Loading branch information
xijing21 authored Jul 31, 2024
2 parents 65225aa + 9fda03d commit 129d279
Showing 1 changed file with 181 additions and 0 deletions.
181 changes: 181 additions & 0 deletions docs/old/ruyi/updates/0.14.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# v0.14.0 版本新增特性

+ 新增 box64-upstream 模拟器包
+ 新增 wps-office 支持

## 安装 v0.14.0

在 amd64 架构环境安装:

```bash
$ wget https://mirror.iscas.ac.cn/ruyisdk/ruyi/releases/0.14.0/ruyi.amd64
$ chmod +x ./ruyi.amd64
$ sudo cp ./ruyi.amd64 /usr/local/bin/ruyi
```

在 riscv64 架构环境安装:

```bash
$ wget https://mirror.iscas.ac.cn/ruyisdk/ruyi/releases/0.14.0/ruyi.riscv64
$ chmod +x ./ruyi.riscv64
$ sudo cp ./ruyi.riscv64 /usr/local/bin/ruyi
```

在 arm64 架构环境安装:

```bash
$ wget https://mirror.iscas.ac.cn/ruyisdk/ruyi/releases/0.14.0/ruyi.arm64
$ chmod +x ./ruyi.arm64
$ sudo cp ./ruyi.arm64 /usr/local/bin/ruyi
```

检查安装版本:

```bash
$ ruyi version
Ruyi 0.14.0

Running on linux/x86_64.

Copyright (C) 2023 Institute of Software, Chinese Academy of Sciences (ISCAS).
All rights reserved.
License: Apache-2.0 <https://www.apache.org/licenses/LICENSE-2.0>

This version of ruyi makes use of code licensed under the Mozilla Public
License 2.0 (https://mozilla.org/MPL/2.0/). You can get the respective
project's sources from the project's official website:

* certifi: https://github.com/certifi/python-certifi

```

## 新增 box64-upstream 模拟器包

``ruyi list`` 可以看到新增的 box64-upstream 软件包。

```bash
* emulator/box64-upstream
- 0.2.9-pre.ruyi.20240702+git.4b0b3fc9 (prerelease, latest-prerelease)
- 0.2.8-ruyi.20240702 (latest)
```

由于上游 0.2.9 版本尚未发布,而 0.2.9 包含了众多重要的修复,故提供了 0.2.9 的主线快照版本,且推荐安装该版本。

编辑配置文件 ``~/.config/ruyi/config.toml`` 以允许安装预发布版本的软件包:

```toml
[packages]
prereleases = true
```

## 新增 wps-office 支持

注意, box64-upstream 0.2.8 版本无法正常运行 WPS 办公套件。

注意,该支持当前已知在 RevyOS 和 openEuler RISC-V 23.09 独立发行版本通过验证,在 BPI-F3 Bianbu 验证失败。

```bash
$ ruyi install box64-upstream
info: downloading https://mirror.iscas.ac.cn/ruyisdk/dist/box64-upstream-0.2.9-pre.ruyi.20240702+git.4b0b3fc9.riscv64.tar.zst to
```

由于 WPS 套件使用了一个启动 Bash 脚本,最简单的复用该脚本的方式便是采用 binfmt\_misc 机制。若不希望配置 binfmt\_misc 或系统不支持,同样也可以手动启动。

若希望配置 binfmt\_misc,则首先确认 box64 二进制位置。

```bash
$ ls ~/.local/share/ruyi/binaries/riscv64/box64-upstream-0.2.9-pre.ruyi.20240702+git.4b0b3fc9/bin/box64
$ realpath ~/.local/share/ruyi/binaries/riscv64/box64-upstream-0.2.9-pre.ruyi.20240702+git.4b0b3fc9/bin/box64
```

使用文本编辑器编辑 binfmt\_misc 配置文件,将行尾的 ``//bin/box64`` 改为先前验证过的绝对路径。

```bash
$ nano ~/.local/share/ruyi/binaries/riscv64/box64-upstream-0.2.8-ruyi.20240702/etc/binfmt.d/box64.conf
```

部署配置并使其生效。

```bash
$ sudo cp ~/.local/share/ruyi/binaries/riscv64/box64-upstream-0.2.8-ruyi.20240702/etc/binfmt.d/box64.conf /etc/binfmt.d/box64.conf
$ sudo systemctl restart systemd-binfmt
$ cat /proc/sys/fs/binfmt_misc/box64
```

注意,如果系统中已经配置过 QEMU linux-user 等其他的 x86\_64 模拟机制,则需要保证 box64 被默认采用,否则 WPS 套件的启动脚本将依然无法正常工作。

安装 x86 sysroot,补全 WPS 套件运行所需的 x86\_64 动态链接库。注意这里提供的 sysroot 链接为临时性链接,后续待本功能迭代稳定之后,操作方式将改变,此链接也将失效。

```bash
$ pushd ~/Downloads
$ wget https://mirror.iscas.ac.cn/ruyisdk/dist/temp/debian-bookworm.gui.20240705.amd64.tar.zst
$ sudo mkdir /opt/debian-bookworm.amd64
$ cd /opt/debian-bookworm.amd64
$ tar -xf ~/Downloads/debian-bookworm.gui.20240705.amd64.tar.zst
$ popd
```

安装 x86\_64 架构的 WPS Office 软件包。

```bash
$ ruyi install --host x86_64 wps-office
```

该命令将打印提示信息,需要根据提示手动下载 wps-office 发布的 deb 软件包。

注意在 locale 配置为 en\_US.UTF-8 和 zh\_CN.UTF-8 以外的环境下当前版本 ruyi 包管理器该命令会失败。

注意当前版本只支持 11.1.0.11719 版本的 WPS,包名应为 wps-office\_11.1.0.11719\_amd64.deb。

调整 WPS Office 启动脚本。

```bash
$ pushd ~/.local/share/ruyi/binaries/x86_64/wps-office-11.1.0-r.11719
$ sed -i "s@gInstallPath=/@gInstallPath=$(pwd)/@" ./usr/bin/*
$ popd
```

运行 WPS Office。

```bash
$ export BOX64_EMULATED_LIBS=libsqlite3.so.0
$ export BOX64_LD_LIBRARY_PATH=/opt/debian-bookworm.amd64/usr/lib/x86_64-linux-gnu
$ ~/.local/share/ruyi/binaries/x86_64/wps-office-11.1.0-r.11719/usr/bin/wps
```

若运行失败,可以手动运行获取日志,这里给出 WPS 文字和 WPS 演示的运行命令。

```bash
$ ~/.local/share/ruyi/binaries/riscv64/box64-upstream-0.2.9-pre.ruyi.20240702+git.4b0b3fc9/bin/box64 ~/.local/share/ruyi/binaries/x86_64/wps-office-11.1.0-r.11719/opt/kingsoft/wps-office/office6/wps
$ ~/.local/share/ruyi/binaries/riscv64/box64-upstream-0.2.9-pre.ruyi.20240702+git.4b0b3fc9/bin/box64 ~/.local/share/ruyi/binaries/x86_64/wps-office-11.1.0-r.11719/opt/kingsoft/wps-office/office6/wpp
```

若您在 openEuler RISC-V 23.09 独立发行版本运行 wps-office 时遇到以下错误:

```bash
Error initializing native libxkbcommon-x11.so.0 (last dlerror is libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)
Error loading needed lib libxkbcommon-x11.so.0
Using native(wrapped) libxkbcommon.so.0
Error loading one of needed lib
Error initializing needed lib /home/openeuler/.local/share/ruyi/binaries/x86_64/wps-office-11.1.0-r.11719/opt/kingsoft/wps-office/office6/qt/plugins/platforms/libqxcb.so
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.
```

请手动安装 libxkbcommon-x11 软件包。

```bash
$ sudo dnf install libxkbcommon-x11
```

若 WPS 官网版本已经更新,可能无法从官网下载页面下载到历史版本,可以参考下一节内容。

## WPS Office 版本下载参考

若希望以 wget 或 curl 的方式下载 WPS Office,这里给出两种方法供参考。

1. 使用优麒麟二次分发的 deb 包 <https://archive.ubuntukylin.com/ubuntukylin/pool/partner/wps-office_11.1.0.11719_amd64.deb>
2. 参考 AUR wps-office-cn PKGBUILD 中的 [\_get\_source\_url](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wps-office-cn&id=da5958b5179c1345d24840ea30803a8d52c8d0c6#n21) 函数

0 comments on commit 129d279

Please sign in to comment.