diff --git a/en/guide/debug/faq.md b/en/guide/debug/faq.md index 9813b66..d860ad5 100644 --- a/en/guide/debug/faq.md +++ b/en/guide/debug/faq.md @@ -9,73 +9,59 @@ SPDX-License-Identifier: LGPL-3.0-or-later 1. When the application runs to read the application installation resource file under `/usr/share`, why does the reading fail? Linglong applications run in a container, and the application data will be mounted to `/opt/apps/`/. Only system data will exist in the `/usr/share` directory, and there will be no application-related data. Therefore, reading directly from `/usr/share` will fail. Suggested processing: Use the `XDG_DATA_DIRS` environment variable to read resources, and `/opt/apps//files/share` will exist in this environment variable search path. - 2. The font library file cannot be found when the application is running. Why can the corresponding font library be read when the `deb` package is installed? When the `deb` package is installed, it will depend on the corresponding font library file. The Linglong package format adopts a self-sufficient packaging format. Except for the basic system library, `qt` library and `dtk` library files provided in `runtime`, do not need to be provided by yourself, other dependent data files need to be provided by yourself. It is recommended to put the corresponding data file under `files/share`, and use the environment variable `XDG_DATA_DIRS` to read the path. - 3. What is in the Linglong application `runtime`? Can you add some library files to it? At present, the `runtime` that Linglong application depends on provides the `qt` library and the `dtk` library. Because `runtime` has a strict size limit, adding additional library files to `runtime` is currently not allowed. - 4. The application runs in the container. Can a configuration file be created in any path of the container during the running process? This is not allowed. The file system in the container is a read-only file system and configuration files are not allowed to be created under arbitrary paths. - 5. Where is app data saved? Where can I find it outside the container? Because Linglong applications follow the principle of non-interference, the `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, `XDG_CACHE_HOME` environment variables are defined in the corresponding path of the host machine, `~/.linglong/`/. So the user application data will be saved under this path. When writing data while the application is running, it should also be able to read the corresponding environment variable to write the data. Mutual configuration calls between applications are prohibited. - 6. The application provides the `dbus service` file, where do I place it? What does the `Exec` segment write? When the application provides the `dbus service` file, it needs to be placed in the `entries/dbus-1/services` directory. If `Exec` executes the binary in the Linglong package, use the `--exec` option parameter to execute the corresponding binary. - 7. Can the application download files to the `$HOME` directory by default? I downloaded the file, why can't I find it on the host machine? Linglong specification does not allow files and directories to be created in the `$HOME` directory. - 8. Why does the desktop shortcut icon appear as a gear or blank? How are the icon files placed? - If the gear shaped icon is displayed, the icon has not been obtained. You need to confirm whether the `Icon` path name is correct. When the icon is empty, the `tryExec` field exists. When the command does not exist, it will cause the shortcut to display improperly. Place the application icon in the `icons` directory. The directory structure should be consistent with the system `icons` directory structure. The recommended path is `icons/hicolor/scalable/apps/org.desktopspec.demo.svg`. Use `svg` format icons. Refer to the icon file format specification. If you use a non-vector format, please place the icon according to the resolution. Note that the `desktop` file should not write the icon path, but directly write the icon name. - + If the gear shaped icon is displayed, the icon has not been obtained. You need to confirm whether the `Icon` path name is correct. When the icon is empty, the `tryExec` field exists. When the command does not exist, it will cause the shortcut to display improperly. Place the application icon in the `icons` directory. The directory structure should be consistent with the system `icons` directory structure. The recommended path is `icons/hicolor/scalable/apps/org.desktopspec.demo.svg`. Use `svg` format icons. Refer to the icon file format specification. If you use a non-vector format, please place the icon according to the resolution. Note that the `desktop` file should not write the icon path, but directly write the icon name. 9. Why do `xdg-open` and `xdg-email` that come with the application fail? - Linglong specially handles `xdg-open` and `xdg-email` in `runtime`, so the application is forbidden to execute the executable file or script of `xdg-open` and `xdg-email` that it carries. - + Linglong specially handles `xdg-open` and `xdg-email` in `runtime`, so the application is forbidden to execute the executable file or script of `xdg-open` and `xdg-email` that it carries. 10. Why doesn't the system environment variable used by the application take effect? When using environment variables, you need to confirm whether there are corresponding environment variables in the container. If not, you need to contact the Linglong team for processing. - 11. The library files required for the application to run were not found. How can I provide them? - The resource files that the application needs to use and the library files both need to be provided by the application itself. The library files are placed in the `files/lib` path. - + The resource files that the application needs to use and the library files both need to be provided by the application itself. The library files are placed in the `$PREFIX/lib` path. 12. Where can I choose the application download directory? Currently Linglong users can only choose the `Desktop`, `Documents`, `Downloads`, `Music`, `Pictures`, `Videos`, `Public`, and `Templates` directories under the user's home directory, and cannot be downloaded to other directories. - 13. Why has the `QTWebEngine` rendering process crashed when the application is running? Due to the system upgrade of `glibc`, the application fails to use the built-in browser, and the application needs to be re-adapted. A temporary solution is to set the environment variable: `export QTWEBENGINE_DISABLE_container=1`. - 14. When the application is running, the `libqxcb.so` library cannot be found or the `qtwebengine` error is reported. What can I do? When a `qt.conf` file exists, you need to configure the correct path in the file or use the `QTWEBENGINEPROCESS_PATH`, `QTWEBENGINERESOURCE_PATH`, `QT_QPA_PLATFORM_PLUGIN_PATH`, and `QT_PLUGIN_PATH` environment variables to configure the search path. - 15. The application running error message `gpu_data_manager_impl_private`, how can I solve it? The current temporary solution is to add `--no-container`. - Reference: - + Reference: [https://github.com/Automattic/simplenote-electron/issues/3044](https://github.com/Automattic/simplenote-electron/issues/3044) 16. Can the application carry the database file by itself and write data to the database during operation? The file system in the container is a read-only file system and does not allow data to be written to application resource files. - 17. Why does the execution of binary with `suid` and `guid` permissions fail? In order to ensure system security, Linglong container prohibits the execution of such permission binaries in the container. - 18. Can the input method of uab offline package format not be used under Debian and Ubuntu? It is recommended to install the `fictx` input method to experience it. +19. How can I know which packages are installed in a container environment? + + Enter the container environment using the command `ll-builder run --exec bash`. To view the pre-installed packages, utilize the command `cat /var/lib/dpkg/status | grep "^Package: "`. Additionally, for libraries compiled from source code, you can inspect them using `cat /runtime/packages.list`. diff --git a/en/guide/ll-builder/manifests.md b/en/guide/ll-builder/manifests.md index a6ffdfd..87a1de9 100644 --- a/en/guide/ll-builder/manifests.md +++ b/en/guide/ll-builder/manifests.md @@ -123,11 +123,11 @@ cd org.deepin.foundation bash build_base.sh eagle amd64 ``` -该项目用来构建玲珑使用的根文件系统。eagle 指发行版代号,amd64 指架构。 +The project is designed to construct the root filesystem utilized by Linglong, with "eagle" referring to the codename of the distribution and "amd64" indicating the architecture. | Distribution version | Arch | | -------------------- | ------------------------- | -| eagle (uos 20) | amd64、arm64、loongarch64 | +| eagle (UOS 20) | amd64、arm64、loongarch64 | | beige (deepin 23) | amd64、arm64 | ### Build runtime diff --git a/en/guide/ll-cli/install.md b/en/guide/ll-cli/install.md index f55ca5b..9f83be0 100644 --- a/en/guide/ll-cli/install.md +++ b/en/guide/ll-cli/install.md @@ -57,3 +57,17 @@ message: install org.deepin.calculator, version:5.7.21.4 success ``` After the application is installed, the installation result will be displayed. + +The layer files we export using the `ll-builder export` command can be installed using the `ll-cli install` command. + +```bash +ll-cli install ./com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer +``` + +You can use the command `ll-cli list | grep com.baidu.baidunetdisk` to check if it has been installed successfully. + +Run the application using the following command. + +```bash +ll-cli run com.baidu.baidunetdisk +``` diff --git a/en/guide/ll-cli/query.md b/en/guide/ll-cli/query.md index 9185d33..f2d548a 100644 --- a/en/guide/ll-cli/query.md +++ b/en/guide/ll-cli/query.md @@ -45,3 +45,9 @@ appId name version org.deepin.calculator deepin-calculator 5.5.23 x86_64 linglong runtime Calculator for UOS org.deepin.calculator deepin-calculator 5.7.1 x86_64 linglong runtime Calculator for UOS ``` + +If you need to look up Base and Runtime, you can use the following command: + +```bash +ll-cli search . --type=runtime +``` diff --git a/en/guide/ll-pica/adep.md b/en/guide/ll-pica/adep.md new file mode 100644 index 0000000..7469f1e --- /dev/null +++ b/en/guide/ll-pica/adep.md @@ -0,0 +1,35 @@ +## Add dependency + +Linglong applications may lack package dependencies, which can currently + be addressed by adding the corresponding package dependencies in the `linglong.yaml` file. + +The `ll-pica adep` command is used to add package dependencies to the `linglong.yaml` file. + +View the help information for the `ll-cli adep` command: + +```bash +ll-pica adep --help +``` + +Here is the output: + +```bash +Add dependency packages to linglong.yaml + +Usage: + ll-pica adep [flags] + +Flags: + -d, --deps string dependencies to be added, separator is ',' + -h, --help help for adep + -p, --path string path to linglong.yaml (default "linglong.yaml") + +Global Flags: + -V, --verbose verbose output +``` + +```bash +ll-builder adep -d "dep1,dep2" -p /path/to/linglong.yaml +``` + +If executing within the same path where the `linglong.yaml` file resides, there is no need to include the `-p` parameter. diff --git a/en/guide/ll-pica/convert.md b/en/guide/ll-pica/convert.md new file mode 100644 index 0000000..6970f64 --- /dev/null +++ b/en/guide/ll-pica/convert.md @@ -0,0 +1,72 @@ +## Conversion application + +The `ll-pica convert` command is used to generate the `linglong.yaml` file required by Linglong. + +View the help information for the `ll-cli convert` command: + +```bash +ll-pica convert --help +``` + +Here is the output: + +```bash +Convert deb to uab + +Usage: + ll-pica convert [flags] + +Flags: + -b, --build build linglong + -c, --config string config file + -h, --help help for convert + --pi string package id + --pn string package name + -t, --type string get app type (default "local") + -w, --workdir string work directory + +Global Flags: + -V, --verbose verbose output +``` + +Translation: After executing the `ll-pica init -w w --pi com.baidu.baidunetdisk --pn com.baidu.baidunetdisk -t repo` command + +We only need to execute the command `ll-pica convert -w w -b` to convert the Linglong application. Here, we will use the `apt download` command to download the deb package named `com.baidu.baidunetdisk`. + +```bash +ll-pica convert -c com.baidu.baidunetdisk_4.17.7_amd64.deb -w work -b +``` + +:::tip +Here, the `apt download` command is used to download the deb package; however, the process may fail due to +the deb package being excessively large or issues with obtaining the link. It is recommended to use the following command instead. If you use the following command directly, there is no need to execute the command `ll-pica init -w w --pi com.baidu.baidunetdisk --pn com.baidu.baidunetdisk -t repo`. +::: + +```bash +apt download com.baidu.baidunetdisk +``` + +```bash +ll-pica convert -c com.baidu.baidunetdisk_4.17.7_amd64.deb -w w -b +``` + +- -w working directory。 +- -c The configuration method employed here utilizes deb files. +- -b It indicates that a build is required; without adding this parameter, neither building nor exporting the layer file will take place. + +The constructed products are as follows: + +```bash +├── package +│ └── com.baidu.baidunetdisk +│ └── amd64 +│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_develop.layer +│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer +│ ├── linglong +│ └── linglong.yaml +└── package.yaml +``` + +Layer files are divided into two categories: `runtime` and `develop`. The `runtime` includes the application's execution environment, while the `develop` layer, built upon the `runtime`, retains the debugging environment. + +Installing Layer Files and Running the Application Reference:[Install Linglong Apps](../ll-cli/install.md) diff --git a/en/guide/ll-pica/faq.md b/en/guide/ll-pica/faq.md new file mode 100644 index 0000000..62e334e --- /dev/null +++ b/en/guide/ll-pica/faq.md @@ -0,0 +1,11 @@ +# FAQ + +1. Where is the default configuration located for the `linglong.yaml` file generated by `ll-pica`? + + The configuration file for `ll-pica` is located at `~/.pica/config.json`. +2. Does ll-pica fail to convert software such as Wine, Android apps, input methods, or security applications? + + Linglong applications currently do not support this type of application, and consequently, ll-pica cannot convert them either. +3. Why is there no sound from software that requires audio? + + Prompt "libpulsecommon-12.2.so not found" can be addressed by adding a line in the `build` section of the linglong.yaml file: `mv $PREFIX/lib/$TRIPLET/pulseaudio/* $PREFIX/lib/$TRIPLET`. diff --git a/en/guide/ll-pica/init.md b/en/guide/ll-pica/init.md new file mode 100644 index 0000000..9ade9ef --- /dev/null +++ b/en/guide/ll-pica/init.md @@ -0,0 +1,79 @@ +# Initialization configuration + +The `ll-pica init` command is used to initialize the configuration information for the conversion package. + +View the help information for the `ll-cli init` command: + +```bash +ll-pica init --help +``` + +Here is the output: + +```bash +init config template + +Usage: + ll-pica init [flags] + +Flags: + -a, --arch string runtime arch + -c, --config string config file + --dv string distribution Version + -h, --help help for init + --pi string package id + --pn string package name + -s, --source string runtime source + -t, --type string get type + -v, --version string runtime version + -w, --workdir string work directory + +Global Flags: + -V, --verbose verbose output +``` + +The specific command as follows: + +```bash +ll-pica init -w w --pi com.baidu.baidunetdisk --pn com.baidu.baidunetdisk -t repo +``` + +- -w working directory +- --pi specifies the appid used by the Linglong application. +- --pn specifies the correct package name that apt can search for. +- -t specifies the type to retrieve, `repo` fetches from the apt repository. + +The specific configuration is as follows: + +```bash +runtime: + version: 23.0.1 + base_version: 23.0.0 + source: https://community-packages.deepin.com/beige/ + distro_version: beige + arch: amd64 +file: + deb: + - type: repo + id: com.baidu.baidunetdisk + name: com.baidu.baidunetdisk +``` + +Detailed Field Reference: [Manifests](../manifests.md) + +:::tip +The default configuration file `~/.pica/config.json` + is set to use Deepin v23. If you need to specify UOS 20 as the BASE and + RUNTIME, modify the default configuration using the following command. +Please update the link below, [https://professional-packages.chinauos.com/desktop-professional](https://professional-packages.chinauos.com/desktop-professional), to a version that does not require authentication. +::: + +```bash +ll-pica init --rv "20.0.0" --bv "20.0.0" -s "https://professional-packages.chinauos.com/desktop-professional" --dv "eagle/1070" +``` + +If it needs to be used on arm64, the default architecture needs to be modified. + +```bash +ll-pica init -a "arm64" +``` diff --git a/en/guide/ll-pica/introduction.md b/en/guide/ll-pica/introduction.md new file mode 100644 index 0000000..28a57c9 --- /dev/null +++ b/en/guide/ll-pica/introduction.md @@ -0,0 +1,35 @@ +# ll-pica Introduction + +This tool currently provides the capability to convert DEB packages into Linglong packages. Only software packages that comply with the app store packaging standards are supported for conversion. Packages related to Wine, Android emulators, input methods, and security software cannot be converted at this time. + +View the help information for the `ll-pica` command: + +```bash +ll-pica --help +``` + +Here is the output: + +```bash +Convert the deb to uab. For example: +Simple: + ll-pica init -c package -w work-dir + ll-pica convert -c package.yaml -w work-dir + ll-pica help + +Usage: + ll-pica [command] + +Available Commands: + adep Add dependency packages to linglong.yaml + convert Convert deb to uab + help Help about any command + init init config template + +Flags: + -h, --help help for ll-pica + -V, --verbose verbose output + -v, --version version for ll-pica + +Use "ll-pica [command] --help" for more information about a command. +``` diff --git a/en/guide/ll-pica/manifests.md b/en/guide/ll-pica/manifests.md new file mode 100644 index 0000000..3e870d5 --- /dev/null +++ b/en/guide/ll-pica/manifests.md @@ -0,0 +1,57 @@ +# Manifests + +The `package.yaml` file serves as the foundation for ll-pica to convert packages into DEB format. It encompasses essential information such as the base and runtime versions used in the build process, as well as the DEB package that is to be converted. + +## Project directory structure + +```bash +{workdir} +├── package +│ └── {appid} +│ └── amd64 +│ ├── linglong +│ ├── linglong.yaml +│ └── start.sh +└── package.yaml +``` + +## Field definitions + +### Build environment + +Conversion build environment for DEB packages to Linglong packages. + +```bash +runtime: + version: 23.0.1 + base_version: 23.0.0 + source: https://community-packages.deepin.com/beige/ + distro_version: beige + arch: amd64 +``` + +| name | description | +| -------------- | ------------------------------------------------------------------------------------------- | +| version | Runtime version, A three-digit number can be loosely matched with a potential fourth digit | +| base_version | Base version, A three-digit number can be loosely matched with a potential fourth digit | +| source | Obtain the sources used by the dependencies of a deb package. | +| distro_version | The codename of a distribution." | +| arch | The architecture required by a deb package. | + +### Deb package informationeb + +```bash +file: + deb: + - type: local + id: com.baidu.baidunetdisk + name: com.baidu.baidunetdisk + ref: /tmp/com.baidu.baidunetdisk_4.17.7_amd64.deb +``` + +| name | description | +| ---- | -------------------------------------------------------------------------------------------------------------------------- | +| type | The method of acquisition: 'local' requires specifying a reference, while 'repo' does not require specifying a reference." | +| id | Unique name of the build product | +| name | Specify the correct package name that apt can search for. | +| ref | The path of the deb package on the host machine. | diff --git a/en/guide/start/how_to_use.md b/en/guide/start/how_to_use.md new file mode 100644 index 0000000..efbd6fa --- /dev/null +++ b/en/guide/start/how_to_use.md @@ -0,0 +1,143 @@ + + +# Build Linglong applications + +Here, we use `deepin-calculator` as an example for building a Linglong application from source code. + +## Create Linglong project + +```bash +mkdir org.deepin.calculator +``` + +Create a file named `linglong.yaml` in the directory. + +```bash +touch org.deepin.calculator/linglong.yaml +``` + +Enter the directory + +```bash +cd org.deepin.calculator +``` + +Edit the linglong.yaml file using a text editor. + +```bash +version: "1" + +package: + id: org.deepin.calculator + name: deepin-calculator + version: 5.7.21.0 + kind: app + description: | + calculator for deepin os. + +command: + - /opt/apps/org.deepin.calculator/files/bin/deepin-calculator + +base: org.deepin.foundation/23.0.0 +runtime: org.deepin.Runtime/23.0.1 + +sources: + - kind: git + url: https://github.com/linuxdeepin/deepin-calculator.git + version: master + commit: d7e207b4a71bbd97f7d818de5044228c1a6e2c92 + + - kind: git + url: https://github.com/linuxdeepin/dde-qt-dbus-factory.git + version: master + +build: | + # build dde-qt-dbus-factory + cd /project/linglong/sources/dde-qt-dbus-factory.git + qmake -makefile \ + PREFIX=${PREFIX} \ + LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET} \ + INSTALL_ROOT=${PREFIX} + + make + make install + + # build calculator + cd /project/linglong/sources/deepin-calculator.git + cmake -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib/${TRIPLET} + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \ + -DAPP_VERSION=5.7.21 \ + -DVERSION=5.7.21 + + cmake --build build + cmake --build build --target install +``` + +The file "linglong.yaml" is written following the YAML syntax specifications. + +Detailed explanation of fields in linglong.yaml for reference: [Manifests](../ll-builder/manifests.md) + +## Build + +```bash +ll-builder build +``` + +## Run + +```bash +ll-builder run +``` + +the successful output of `ll-builder run` is as follows: + +![org.deepin.demo.png](../ll-builder/images/org.deepin.demo.png) + +For debugging purposes, use the additional `--exec /bin/bash` parameter to replace the default program executed upon entering the container, for example: + +```bash +ll-builder run --exec /bin/bash +``` + +# Conversion application + +Here, we use baidunetdisk as an example for converting to a Linglong package from a deb package. + +## Obtain software package + +Take baidunetdisk as an example. First, obtain the deb package file. +Currently, only software following the application store packaging +specifications is supported for conversion. + +```bash +apt download com.baidu.baidunetdisk +``` + +## Conversion + +```bash +ll-pica convert -c com.baidu.baidunetdisk_4.17.7_amd64.deb -w work -b +``` + +Enter the directory + +```bash +cd work/package/com.baidu.baidunetdisk/amd64 +``` + +Installed using the `ll-cli install` command. + +```bash +ll-cli install ./com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer +``` + +Successful execution output as follows: + +![img](images/com.baidu.baidunetdisk.png) diff --git a/en/guide/start/images/com.baidu.baidunetdisk.png b/en/guide/start/images/com.baidu.baidunetdisk.png new file mode 100644 index 0000000..3f286e3 Binary files /dev/null and b/en/guide/start/images/com.baidu.baidunetdisk.png differ diff --git a/en/guide/start/images/com.baidu.baidunetdisk.png.license b/en/guide/start/images/com.baidu.baidunetdisk.png.license new file mode 100644 index 0000000..b003320 --- /dev/null +++ b/en/guide/start/images/com.baidu.baidunetdisk.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. + +SPDX-License-Identifier: LGPL-3.0-or-later diff --git a/en/guide/start/images/org.deepin.calculator.png b/en/guide/start/images/org.deepin.calculator.png new file mode 100644 index 0000000..3a330d7 Binary files /dev/null and b/en/guide/start/images/org.deepin.calculator.png differ diff --git a/en/guide/start/images/org.deepin.calculator.png.license b/en/guide/start/images/org.deepin.calculator.png.license new file mode 100644 index 0000000..b003320 --- /dev/null +++ b/en/guide/start/images/org.deepin.calculator.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. + +SPDX-License-Identifier: LGPL-3.0-or-later diff --git a/en/guide/start/install.md b/en/guide/start/install.md index 3cf3944..efe5c60 100644 --- a/en/guide/start/install.md +++ b/en/guide/start/install.md @@ -4,68 +4,27 @@ SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. SPDX-License-Identifier: LGPL-3.0-or-later --> -# Install Linglong Environment +# Install -## Kernel version requirement +Currently supported: deepin v23, UOS 1070. -Use `uname -r` to check the kernel version: +## Operating system -```bash -uname -r -``` - -Here is the output: +- deepin v23 -```text -5.10.101-amd64-desktop +```bash +sudo apt install linglong-builder ``` -Kernel version requirement >=4.19. - -* The 4.19 kernel of the x86 architecture needs to enable the user namespace. +- UOS 1070 -## Deb package installation tutorial - -### deepin 20 - -Use `apt` to install the Linglong environment. +add Linglong repository source ```bash -sudo apt install linglong-builder \ - linglong-box \ - linglong-dbus-proxy \ - linglong-bin \ - linglong-installer +echo "deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community/linglong-repo/ unstable main" | sudo tee -a /etc/apt/sources.list ``` -### deepin 23 - -Deepin 23 comes preinstalled with the Linglong environment. - -## Deb download - -### Debian 11 (bullseye) - -[Click here to download Debian 11 (bullseye) Linglong deb package](https://github.com/linuxdeepin/linglong-hub/releases/download/1.3.3/debian_bullseye.tar.gz) - -### Ubuntu 22.04 (jammy) - -[Click here to download Ubuntu 22.04 (jammy) Linglong deb package](https://github.com/linuxdeepin/linglong-hub/releases/download/1.3.3/ubuntu_jammy.tar.gz) - -### Update the repository source - -Add the Tsinghua warehouse source for your distro to your sources: - -* [Debian source](https://mirrors.tuna.tsinghua.edu.cn/help/debian/) - -* [Ubuntu source](https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/) - -### Deb install - -The Debian 11 installation is as follows: - ```bash -tar -zxvf debian_bullseye.tar.gz -sudo apt install ./*.deb -sudo reboot +sudo apt update +sudo apt install linglong-builder ``` diff --git a/en/guide/start/install_pica.md b/en/guide/start/install_pica.md new file mode 100644 index 0000000..4c4f80a --- /dev/null +++ b/en/guide/start/install_pica.md @@ -0,0 +1,26 @@ + + +# Install the Pica tool + +## Operating system + +- deepin v23 + ```bash + sudo apt install linglong-pica + ``` +- UOS 1070 + +add Linglong repository source,If the repository source has already been added previously, there is no need to add it again. + +```bash +echo "deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community/linglong-repo/ unstable main" | sudo tee -a /etc/apt/sources.list +``` + +```bash +sudo apt update +sudo apt install linglong-pica +``` diff --git a/guide/debug/faq.md b/guide/debug/faq.md index 7535a71..fa7eb38 100644 --- a/guide/debug/faq.md +++ b/guide/debug/faq.md @@ -6,74 +6,60 @@ SPDX-License-Identifier: LGPL-3.0-or-later # 常见运行问题 -1. 应用运行读取`/usr/share`下应用安装资源文件,为什么读取失败? +1. 应用运行读取 `/usr/share`下应用安装资源文件,为什么读取失败? - 玲珑应用是在容器环境中运行,应用数据会挂载到`/opt/apps/`/下,`/usr/share`目录下只会存在系统数据,不会存在应用相关数据。因此直接读取`/usr/share`下会失败。建议处理:采用`XDG_DATA_DIRS`环境变量读取资源,`/opt/apps//files/share`会存在在此环境变量搜索路径中。 + 玲珑应用是在容器环境中运行,应用数据会挂载到 `/opt/apps/`/下,`/usr/share`目录下只会存在系统数据,不会存在应用相关数据。因此直接读取 `/usr/share`下会失败。建议处理:采用 `XDG_DATA_DIRS`环境变量读取资源,`/opt/apps//files/share`会存在在此环境变量搜索路径中。 +2. 应用运行时找不到字体库文件?为什么 `deb`包安装时能读取到对应的字体库? -2. 应用运行时找不到字体库文件?为什么`deb`包安装时能读取到对应的字体库? - - `deb`包安装时,会依赖带入对应的字体库文件。而玲珑包格式采用自给自足打包格式。除了基本的系统库,`runtime`里面提供的`qt`库与`dtk`库文件不用自己提供外,其他依赖数据文件,均需自己提供。建议对应的数据文件放入`files/share`下,采用环境变量`XDG_DATA_DIRS`读取路径。 - -3. 玲珑应用`runtime`里面有什么?能不能往里面添加一些库文件进去? - - 目前玲珑应用依赖的`runtime`里面提供的是`qt`库与`dtk`库。因`runtime`有严格的大小限制。目前不允许往`runtime`里面添加额外的库文件。 + `deb`包安装时,会依赖带入对应的字体库文件。而玲珑包格式采用自给自足打包格式。除了基本的系统库,`runtime`里面提供的 `qt`库与 `dtk`库文件不用自己提供外,其他依赖数据文件,均需自己提供。建议对应的数据文件放入 `files/share`下,采用环境变量 `XDG_DATA_DIRS`读取路径。 +3. 玲珑应用 `runtime`里面有什么?能不能往里面添加一些库文件进去? + 目前玲珑应用依赖的 `runtime`里面提供的是 `qt`库与 `dtk`库。因 `runtime`有严格的大小限制。目前不允许往 `runtime`里面添加额外的库文件。 4. 应用在容器内运行,运行过程中能不能往容器任意路径下创建配置文件? 这是不允许的行为,容器内文件系统是只读文件系统,不允许随意路径下创建配置文件。 - 5. 应用数据保存到哪里?在容器外哪里能找到? - 因玲珑应用遵循互不干涉原则,`XDG_DATA_HOME`、`XDG_CONFIG_HOME`、`XDG_CACHE_HOME`环境变量被定义到宿主机`~/.linglong/`/对应的路径下,因此用户应用数据会保存在此路径下,应用运行过程中写入数据时,也应该读取对应的环境变量写入数据。禁止应用间互相配置调用。 - -6. 应用提供了`dbus service`文件,如何放置?`Exec`段写什么? + 因玲珑应用遵循互不干涉原则,`XDG_DATA_HOME`、`XDG_CONFIG_HOME`、`XDG_CACHE_HOME`环境变量被定义到宿主机 `~/.linglong/`/对应的路径下,因此用户应用数据会保存在此路径下,应用运行过程中写入数据时,也应该读取对应的环境变量写入数据。禁止应用间互相配置调用。 +6. 应用提供了 `dbus service`文件,如何放置?`Exec`段写什么? - 应用提供`dbus service`文件时,需要放到`entries/dbus-1/services`目录下,如果`Exec`执行玲珑包内二进制,使用`--exec`选项参数执行对应的二进制。 - -7. 应用能不能默认往`$HOME`目录下下载文件?下载了文件,为什么宿主机器下找不到? - - 玲珑规范,不允许往`$HOME`目录下创建文件与目录。 + 应用提供 `dbus service`文件时,需要放到 `entries/dbus-1/services`目录下,如果 `Exec`执行玲珑包内二进制,使用 `--exec`选项参数执行对应的二进制。 +7. 应用能不能默认往 `$HOME`目录下下载文件?下载了文件,为什么宿主机器下找不到? + 玲珑规范,不允许往 `$HOME`目录下创建文件与目录。 8. 桌面快捷方式为什么显示齿轮状?或者为空?图标文件如何放置? - 显示齿轮状是图标未获取到,需要确认`Icon`路径名称是否正确。图标为空时,是存在 `tryExec`字段,当命令不存在时,会导致快捷方式显示异常。放置应用图标`icons`,目录结构与系统`icons`目录结构保持一致即可,建议路径为`icons/hicolor/scalable/apps/org.desktopspec.demo.svg`,使用`svg`格式图标。参考图标文件格式规范如果使用非矢量格式,请按照分辨率来放置图标,注意`desktop`文件不要写死图标路径,直接写图标名即可。 - -9. 应用自带的`xdg-open`、`xdg-email`为什么失效? - - `runtime`中玲珑特殊处理了`xdg-open`、`xdg-email`,因此应用禁止执行自己携带的xdg-open、xdg-email可执行文件或者脚本。 + 显示齿轮状是图标未获取到,需要确认 `Icon`路径名称是否正确。图标为空时,是存在 `tryExec`字段,当命令不存在时,会导致快捷方式显示异常。放置应用图标 `icons`,目录结构与系统 `icons`目录结构保持一致即可,建议路径为 `icons/hicolor/scalable/apps/org.desktopspec.demo.svg`,使用 `svg`格式图标。参考图标文件格式规范如果使用非矢量格式,请按照分辨率来放置图标,注意 `desktop`文件不要写死图标路径,直接写图标名即可。 +9. 应用自带的 `xdg-open`、`xdg-email`为什么失效? + `runtime`中玲珑特殊处理了 `xdg-open`、`xdg-email`,因此应用禁止执行自己携带的xdg-open、xdg-email可执行文件或者脚本。 10. 应用使用系统环境变量未生效,为什么? 当使用环境变量时,需要确认容器内是否存在对应的环境变量,如果没有,需要联系玲珑团队处理。 - 11. 应用运行需要的库文件没找到,如何提供? - 应用需要使用的资源文件,与库文件需要应用自身提供。库文件放到`files/lib`路径下。 - + 应用需要使用的资源文件,与库文件需要应用自身提供。库文件放到 `$PREFIX/lib` 路径下。 12. 应用下载目录可以选择哪里? - 目前玲珑用户下载目录只能选择用户主目录下`Desktop`、`Documents`、`Downloads`、`Music`、`Pictures`、`Videos`、`Public`、`Templates` 目录,不能下载到其他目录。 - -13. 应用运行时,为什么`QT WebEngine`渲染进程已崩溃? - - 因系统升级了`glibc`,导致应用使用内置浏览器时失败,需要应用重新适配。临时解决方案是设置环境变量:`export QTWEBENGINE_DISABLE_SANDBOX=1`。 - -14. 应用运行时,找不到`libqxcb.so`库或者`qtwebengin` 报错? + 目前玲珑用户下载目录只能选择用户主目录下 `Desktop`、`Documents`、`Downloads`、`Music`、`Pictures`、`Videos`、`Public`、`Templates` 目录,不能下载到其他目录。 +13. 应用运行时,为什么 `QT WebEngine`渲染进程已崩溃? - 存在`qt.conf`文件时,在文件中配置正确路径,或者使用 `QTWEBENGINEPROCESS_PATH`、`QTWEBENGINERESOURCE_PATH`、`QT_QPA_PLATFORM_PLUGIN_PATH`、`QT_PLUGIN_PATH`环境变量配置搜索路径。 + 因系统升级了 `glibc`,导致应用使用内置浏览器时失败,需要应用重新适配。临时解决方案是设置环境变量:`export QTWEBENGINE_DISABLE_SANDBOX=1`。 +14. 应用运行时,找不到 `libqxcb.so`库或者 `qtwebengin` 报错? -15. 应用运行报错信息`gpu_data_manager_impl_private`,如何解决? - - 目前临时解决方案是加`--no-sandbox`,参考:[https://github.com/Automattic/simplenote-electron/issues/3044](https://github.com/Automattic/simplenote-electron/issues/3044)。 + 存在 `qt.conf`文件时,在文件中配置正确路径,或者使用 `QTWEBENGINEPROCESS_PATH`、`QTWEBENGINERESOURCE_PATH`、`QT_QPA_PLATFORM_PLUGIN_PATH`、`QT_PLUGIN_PATH`环境变量配置搜索路径。 +15. 应用运行报错信息 `gpu_data_manager_impl_private`,如何解决? + 目前临时解决方案是加 `--no-sandbox`,参考:[https://github.com/Automattic/simplenote-electron/issues/3044](https://github.com/Automattic/simplenote-electron/issues/3044)。 16. 应用能否自己携带数据库文件,并在运行中往数据库中写入数据? 容器内文件系统是只读文件系统,不允许往应用资源文件中写入数据。 - -17. 为什么执行携带`suid`、`guid`权限二进制失效? +17. 为什么执行携带 `suid`、`guid`权限二进制失效? 玲珑容器为保证系统安全,容器内禁止执行此类权限二进制。 - 18. uab离线包格式在debian、ubuntu下输入法无法使用? - 建议安装`fictx`输入法后体验。 + 建议安装 `fictx`输入法后体验。 +19. 怎么知道容器环境中安装了哪些包? + + `ll-builder run --exec bash` 进入容器环境,使用 `cat /var/lib/dpkg/status | grep "^Package: "` 命令查看预装的软件包,另外源码编译的库可以使用 `cat /runtime/packages.list` 查看。 diff --git a/guide/ll-builder/manifests.md b/guide/ll-builder/manifests.md index d8b4344..f0a7001 100644 --- a/guide/ll-builder/manifests.md +++ b/guide/ll-builder/manifests.md @@ -36,7 +36,7 @@ package: calculator for deepin os. ``` -| name | description | +| 名称 | 描述 | | ----------- | -------------------------------------------------- | | description | 构建产物的详细描述 | | id | 构建产物的唯一名称 | @@ -45,12 +45,16 @@ package: ### 基础环境(base) +```bash +base: org.deepin.foundation/23.0.0 +``` + 最小根文件系统。 -| name | description | -| ------- | ---------------------------------------------------------------------------------------- | -| id | Unique name of the base | -| version | Base version, A three-digit number can be loosely matched with a potential fourth digit | +| 名称 | 描述 | +| ------- | ---------------------------------------- | +| id | base 的唯一名称 | +| version | base 的版本号, 三位数可以模糊匹配第四位 | ### 运行时(runtime) @@ -60,7 +64,7 @@ package: runtime: org.deepin.Runtime/23.0.1 ``` -| name | description | +| 名称 | 描述 | | ------- | ----------------------------------------------- | | id | 运行时(runtime)的唯一名称 | | version | 运行时(runtime)版本,三位数可以模糊匹配第四位 | @@ -80,7 +84,7 @@ source: - patches/fix-lib-install-path.patch ``` -| name | description | +| 名称 | 描述 | | ------- | --------------------------------------------------------- | | kind | 源码类型,可选类型 local、archive、git | | url | 源码地址,类型为 archive、git 时填写 | @@ -100,7 +104,7 @@ build: | make install ``` -| name | description | +| 名称 | 描述 | | ----- | --------------- | | build | 构建时build规则 | @@ -108,7 +112,7 @@ build: | 描述构建可以使用的变量,配合build构建使用。 -| name | description | +| 名称 | 描述 | | ------- | ---------------------------------------------------------------------------------------------------- | | PREFIX | 环境变量之一,可在variable、build字段下使用;提供构建时的安装路径,如/opt/apps/org.deepin.calculator | | TRIPLET | 环境变量之一,可在variable、build字段下使用;提供包含架构信息的三元组,如x86_64-linux-gnu | @@ -127,7 +131,7 @@ bash build_base.sh beige amd64 | 发行版 | 架构 | | ----------------- | ------------------------- | -| eagle (uos 20) | amd64、arm64、loongarch64 | +| eagle (UOS 20) | amd64、arm64、loongarch64 | | beige (deepin 23) | amd64、arm64 | ### 构建运行时 @@ -157,7 +161,7 @@ package: calculator for deepin os. command: - - /opt/apps/org.deepin.demo/files/bin/deepin-calculator + - /opt/apps/org.deepin.calculator/files/bin/deepin-calculator base: org.deepin.foundation/23.0.0 runtime: org.deepin.Runtime/23.0.1 diff --git a/guide/ll-cli/install.md b/guide/ll-cli/install.md index 360d6bc..a9d76c3 100644 --- a/guide/ll-cli/install.md +++ b/guide/ll-cli/install.md @@ -8,7 +8,7 @@ SPDX-License-Identifier: LGPL-3.0-or-later `ll-cli install`命令用来安装玲珑应用。 -查看`ll-cli install`命令的帮助信息: +查看 `ll-cli install`命令的帮助信息: ```bash ll-cli install --help @@ -34,15 +34,15 @@ Arguments: appId application id ``` -运行`ll-cli install`命令安装玲珑应用: +运行 `ll-cli install`命令安装玲珑应用: ```bash ll-cli install ``` -`ll-cli install`命令需要输入应用完整的`appid`,若仓库有多个版本则会默认安装最高版本。 +`ll-cli install`命令需要输入应用完整的 `appid`,若仓库有多个版本则会默认安装最高版本。 -安装指定版本需在`appid`后附加对应版本号: +安装指定版本需在 `appid`后附加对应版本号: ```bash ll-cli install @@ -57,3 +57,17 @@ message: install org.deepin.calculator, version:5.7.21.4 success ``` 应用安装完成后,客户端会显示安装结果信息。 + +我们在使用 `ll-builder export` 命令导出的 layer 文件,可以使用 `ll-cli install` 进行安装。 + +```bash +ll-cli install ./com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer +``` + +可以使用 `ll-cli list | grep com.baidu.baidunetdisk` 命令来查看是否安装成功。 + +使用下面的命令运行应用。 + +```bash +ll-cli run com.baidu.baidunetdisk +``` diff --git a/guide/ll-cli/query.md b/guide/ll-cli/query.md index 139f49f..6eecea9 100644 --- a/guide/ll-cli/query.md +++ b/guide/ll-cli/query.md @@ -46,3 +46,9 @@ org.deepin.calculator deepin-calculator 5.5.23 org.deepin.calculator deepin-calculator 5.7.1 x86_64 linglong runtime Calculator for UOS ``` + +如果需要查找 Base 和 Runtime 可以使用以下命令: + +```bash +ll-cli search . --type=runtime +``` diff --git a/guide/ll-pica/adep.md b/guide/ll-pica/adep.md new file mode 100644 index 0000000..e3bd448 --- /dev/null +++ b/guide/ll-pica/adep.md @@ -0,0 +1,34 @@ +## 添加依赖 + +玲珑应用可能缺少包依赖,目前可以通过在 linglong.yaml 文件添加对应的包依赖。 + +`ll-pica adep` 命令用来给 linglong.yaml 文件添加包依赖。 + +查看 `ll-pica adep` 命令的帮助信息: + +```bash +ll-pica adep --help +``` + +`ll-pica adep` 命令的帮助信息如下: + +```bash +Add dependency packages to linglong.yaml + +Usage: + ll-pica adep [flags] + +Flags: + -d, --deps string dependencies to be added, separator is ',' + -h, --help help for adep + -p, --path string path to linglong.yaml (default "linglong.yaml") + +Global Flags: + -V, --verbose verbose output +``` + +```bash +ll-builder adep -d "dep1,dep2" -p /path/to/linglong.yaml +``` + +如果在 linglong.yaml 所在路径中执行不用添加 -p 参数。 diff --git a/guide/ll-pica/convert.md b/guide/ll-pica/convert.md new file mode 100644 index 0000000..c997aad --- /dev/null +++ b/guide/ll-pica/convert.md @@ -0,0 +1,67 @@ +## 转换应用 + +`ll-pica convert` 命令用来生成玲珑需要使用的 linglong.yaml 文件。 + +查看 `ll-pica convert` 命令的帮助信息: + +```bash +ll-pica convert --help +``` + +`ll-pica convert` 命令的帮助信息如下: + +```bash +Convert deb to uab + +Usage: + ll-pica convert [flags] + +Flags: + -b, --build build linglong + -c, --config string config file + -h, --help help for convert + --pi string package id + --pn string package name + -t, --type string get app type (default "local") + -w, --workdir string work directory + +Global Flags: + -V, --verbose verbose output +``` + +在执行 `ll-pica init -w w --pi com.baidu.baidunetdisk --pn com.baidu.baidunetdisk -t repo` 命令后,我们仅需要执行 `ll-pica convert -w w -b` 命令来转换出玲珑应用,这里会使用 `apt download` 命令去下载包名为 `com.baidu.baidunetdisk` 的 deb 包。 + +:::tip +这里使用 apt download 命令下载 deb 包,可能由于 deb 包过大而下载或者无法获取链接导致,失败推荐使用下面的命令。 + +如果直接使用下面的命令,就不需要执行 `ll-pica init -w w --pi com.baidu.baidunetdisk --pn com.baidu.baidunetdisk -t repo` 命令 +::: + +```bash +apt download com.baidu.baidunetdisk +``` + +```bash +ll-pica convert -c com.baidu.baidunetdisk_4.17.7_amd64.deb -w w -b +``` + +- -w 表示工作目录。 +- -c 配置的方式,这里使用 deb 文件。 +- -b 表示需要进行构建,不添加该参数不会进行构建和导出 layer 文件。 + +构建产物如下: + +```bash +├── package +│ └── com.baidu.baidunetdisk +│ └── amd64 +│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_develop.layer +│ ├── com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer +│ ├── linglong +│ └── linglong.yaml +└── package.yaml +``` + +目前玲珑应用的产物是 layer 文件,layer 文件分为runtime 和 develop, runtime 包含应用的运行环境,develop 在 runtime 的基础上保留调试环境。 + +安装 layer 文件和运行应用参考:[安装应用](../ll-cli/install.md) diff --git a/guide/ll-pica/faq.md b/guide/ll-pica/faq.md new file mode 100644 index 0000000..4b516d4 --- /dev/null +++ b/guide/ll-pica/faq.md @@ -0,0 +1,11 @@ +# 常见问题 + +1. ll-pica 生成的 linglong.yaml 文件的默认配置在哪里? + + ll-pica 配置文件在 `~/.pica/config.json`。 +2. ll-pica 无法转换,wine、安卓、输入法、安全类软件吗? + + 玲珑应用目前不支持这类应用,ll-pica 也无法转换。 +3. 为什么需要使用音频的软件没有声音? + + 提示 not found libpulsecommon-12.2.so 可以在linglong.yaml 文件build 字段的里面,添加一行 `mv $PREFIX/lib/$TRIPLET/pulseaudio/* $PREFIX/lib/$TRIPLET`。 diff --git a/guide/ll-pica/init.md b/guide/ll-pica/init.md new file mode 100644 index 0000000..062fd21 --- /dev/null +++ b/guide/ll-pica/init.md @@ -0,0 +1,79 @@ +# 初始化配置 + +`ll-pica init` 命令用来初始化转换包的配置信息。会读取 `~/.pica/config.json` 文件来生成 package.yaml, + +查看 `ll-pica init` 命令的帮助信息: + +```bash +ll-pica init --help +``` + +`ll-pica init` 命令的帮助信息如下: + +```bash +init config template + +Usage: + ll-pica init [flags] + +Flags: + -a, --arch string runtime arch + -c, --config string config file + --dv string distribution Version + -h, --help help for init + --pi string package id + --pn string package name + -s, --source string runtime source + -t, --type string get type + -v, --version string runtime version + -w, --workdir string work directory + +Global Flags: + -V, --verbose verbose output +``` + +具体命令如下: + +```bash +ll-pica init -w w --pi com.baidu.baidunetdisk --pn com.baidu.baidunetdisk -t repo +``` + +- -w 表示工作目录 +- --pi 指定玲珑应用使用的 appid。 +- --pn 指定 apt 能搜索到的正确包名。 +- -t 指定获取类型,repo 从仓库中获取。 + +在 w 目录下会生成 package.yaml 文件。 + +具体配置如下: + +```bash +runtime: + version: 23.0.1 + base_version: 23.0.0 + source: https://community-packages.deepin.com/beige/ + distro_version: beige + arch: amd64 +file: + deb: + - type: repo + id: com.baidu.baidunetdisk + name: com.baidu.baidunetdisk +``` + +详细字段参考:[转换配置文件简介](../manifests.md)。 + +:::tip +默认使用的 `~/.pica/config.json` 使用的是 deepin v23,如果需要指定 UOS 20 版本作为 BASE 和 RUNTIME 使用以下命令修改默认配置。 +下面的 https://professional-packages.chinauos.com/desktop-professional 请修改成不需要鉴权的地址。 +::: + +```bash +ll-pica init --rv "20.0.0" --bv "20.0.0" -s "https://professional-packages.chinauos.com/desktop-professional" --dv "eagle/1070" +``` + +如果需要在 arm64 上使用,需要修改默认架构。 + +```bash +ll-pica init -a "arm64" +``` diff --git a/guide/ll-pica/introduction.md b/guide/ll-pica/introduction.md new file mode 100644 index 0000000..27f201f --- /dev/null +++ b/guide/ll-pica/introduction.md @@ -0,0 +1,35 @@ +# ll-pica 简介 + +本工具目前提供 deb 包转换为玲珑包的能力。目前只支持转换符合应用商店打包规范的软件包,wine、安卓、输入法、安全类软件无法转换。 + +查看 `ll-pica` 帮助信息: + +```bash +ll-pica --help +``` + +`ll-pica` 命令的帮助信息如下: + +```bash +Convert the deb to uab. For example: +Simple: + ll-pica init -c package -w work-dir + ll-pica convert -c package.yaml -w work-dir + ll-pica help + +Usage: + ll-pica [command] + +Available Commands: + adep Add dependency packages to linglong.yaml + convert Convert deb to uab + help Help about any command + init init config template + +Flags: + -h, --help help for ll-pica + -V, --verbose verbose output + -v, --version version for ll-pica + +Use "ll-pica [command] --help" for more information about a command. +``` diff --git a/guide/ll-pica/manifests.md b/guide/ll-pica/manifests.md new file mode 100644 index 0000000..bd3f7f8 --- /dev/null +++ b/guide/ll-pica/manifests.md @@ -0,0 +1,58 @@ +# 转换配置文件简介 + +package.yaml 是 `ll-pica` 转换 deb 包的基础信息。如构建的 base、runtime 的版本,需要被转换的 deb 包。 + +## 工程目录结构 + +```bash +{workdir} +├── package +│ └── {appid} +│ └── amd64 +│ ├── linglong +│ ├── linglong.yaml +│ └── start.sh +└── package.yaml +``` + +## 字段定义 + +### 构建环境 + +deb 包转玲珑包的构建环境。 + +```bash +runtime: + version: 23.0.1 + base_version: 23.0.0 + source: https://community-packages.deepin.com/beige/ + distro_version: beige + arch: amd64 +``` + +| 名称 | 描述 | +| -------------- | ----------------------------------------------- | +| runtime | 运行时(runtime) | +| version | 运行时(runtime)版本,三位数可以模糊匹配第四位 | +| base_version | base 的版本号, 三位数可以模糊匹配第四位 | +| source | 获取 deb 包依赖时使用的源 | +| distro_version | 发行版的代号 | +| arch | 获取 deb 包需要的架构 | + +### deb 包信息 + +```bash +file: + deb: + - type: local + id: com.baidu.baidunetdisk + name: com.baidu.baidunetdisk + ref: /tmp/com.baidu.baidunetdisk_4.17.7_amd64.deb +``` + +| 名称 | 描述 | +| ---- | ----------------------------------------------------- | +| type | 获取的方式,local 需要指定 ref,repo 不需要指定 ref。 | +| id | 构建产物的唯一名称 | +| name | 指定 apt 能搜索到的正确包名 | +| ref | deb 包在宿主机的路径 | diff --git a/guide/start/how_to_use.md b/guide/start/how_to_use.md new file mode 100644 index 0000000..93a5e0f --- /dev/null +++ b/guide/start/how_to_use.md @@ -0,0 +1,154 @@ + + +# 构建玲珑应用 + +这里以 [deepin-calculator](https://github.com/linuxdeepin/deepin-calculator.git) 作为从源码构建玲珑应用的例子。 + +玲珑应用的 appid 需要使用倒置域名的方式命名。 + +## 创建项目 + +```bash +mkdir org.deepin.calculator +``` + +目录下创建 linglong.yaml 文件 + +```bash +touch org.deepin.calculator/linglong.yaml +``` + +进入目录 + +```bash +cd org.deepin.calculator +``` + +使用文本编辑器编辑 linglong.yaml + +```bash +version: "1" + +package: + id: org.deepin.calculator + name: deepin-calculator + version: 5.7.21.0 + kind: app + description: | + calculator for deepin os. + +command: + - /opt/apps/org.deepin.calculator/files/bin/deepin-calculator + +base: org.deepin.foundation/23.0.0 +runtime: org.deepin.Runtime/23.0.1 + +sources: + - kind: git + url: https://github.com/linuxdeepin/deepin-calculator.git + version: master + commit: d7e207b4a71bbd97f7d818de5044228c1a6e2c92 + + - kind: git + url: https://github.com/linuxdeepin/dde-qt-dbus-factory.git + version: master + +build: | + # build dde-qt-dbus-factory + cd /project/linglong/sources/dde-qt-dbus-factory.git + qmake -makefile \ + PREFIX=${PREFIX} \ + LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET} \ + INSTALL_ROOT=${PREFIX} + + make + make install + + # build calculator + cd /project/linglong/sources/deepin-calculator.git + cmake -Bbuild \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib/${TRIPLET} + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \ + -DAPP_VERSION=5.7.21 \ + -DVERSION=5.7.21 + + cmake --build build + cmake --build build --target install +``` + +linglong.yaml 文件遵循 yaml 语法规范编写的。 + +linglong.yaml 中字段的详细解释参考:[构建配置文件简介](../ll-builder/manifests.md) + +## 构建 + +```bash +ll-builder build +``` + +等待玲珑应用构建完成。 + +## 运行玲珑应用 + +```bash +ll-builder run +``` + +`ll-builder run` 运行成功输出如下: + +![org.deepin.demo.png](../ll-builder/images/org.deepin.demo.png) + +为了便于调试,使用额外的 `--exec /bin/bash`参数可替换进入容器后默认执行的程序,如: + +```bash +ll-builder run --exec /bin/bash +``` + +
+
+ +# 转换 deb 应用 + +这里使用百度网盘作为 deb 转换玲珑包的例子。 + +## 获取软件包 + +以百度网盘为例。先获取 deb 包文件。目前只支持转换遵循应用商店打包规范的软件。 + +```bash +apt download com.baidu.baidunetdisk +``` + +## 转换应用 + +```bash +ll-pica convert -c com.baidu.baidunetdisk_4.17.7_amd64.deb -w work -b +``` + +进入目录 + +```bash +cd work/package/com.baidu.baidunetdisk/amd64 +``` + +## 安装 layer 文件 + +```bash +ll-cli install ./com.baidu.baidunetdisk_4.17.7.0_x86_64_runtime.layer +``` + +## 运行应用 + +``` +ll-cli run com.baidu.baidunetdisk +``` + +运行成功输出如下: + +![img](images/com.baidu.baidunetdisk.png) diff --git a/guide/start/images/com.baidu.baidunetdisk.png b/guide/start/images/com.baidu.baidunetdisk.png new file mode 100644 index 0000000..3f286e3 Binary files /dev/null and b/guide/start/images/com.baidu.baidunetdisk.png differ diff --git a/guide/start/images/com.baidu.baidunetdisk.png.license b/guide/start/images/com.baidu.baidunetdisk.png.license new file mode 100644 index 0000000..b003320 --- /dev/null +++ b/guide/start/images/com.baidu.baidunetdisk.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. + +SPDX-License-Identifier: LGPL-3.0-or-later diff --git a/guide/start/images/org.deepin.calculator.png b/guide/start/images/org.deepin.calculator.png new file mode 100644 index 0000000..3a330d7 Binary files /dev/null and b/guide/start/images/org.deepin.calculator.png differ diff --git a/guide/start/images/org.deepin.calculator.png.license b/guide/start/images/org.deepin.calculator.png.license new file mode 100644 index 0000000..b003320 --- /dev/null +++ b/guide/start/images/org.deepin.calculator.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. + +SPDX-License-Identifier: LGPL-3.0-or-later diff --git a/guide/start/install.md b/guide/start/install.md index 4d06cb9..767646d 100644 --- a/guide/start/install.md +++ b/guide/start/install.md @@ -4,55 +4,27 @@ SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. SPDX-License-Identifier: LGPL-3.0-or-later --> -# 安装玲珑环境 +# 安装 -## 内核版本 +目前支持,deepin v23、UOS 1070。 -使用 `uname -r` 查看内核版本。 +## 系统 -```bash -uname -r -``` - -输出如下: +- deepin v23 -```text -5.10.101-amd64-desktop +```bash +sudo apt install linglong-builder ``` -内核版本要求>=4.19。 - -* x86架构4.19内核需要开启user namespace。 - -## deb包安装教程 -### deepin v23 - -deepin v23 已预装玲珑环境。 - -### deb包下载 - -### debian 11(bullseye) +- UOS 1070 -[点击下载debian 11(bullseye)玲珑deb包](https://github.com/linuxdeepin/linglong-hub/releases/download/1.3.3/debian_bullseye.tar.gz) +添加玲珑仓库源 -### ubuntu 22.04(jammy) - -[点击下载ubuntu 22.04(jammy)玲珑deb包](https://github.com/linuxdeepin/linglong-hub/releases/download/1.3.3/ubuntu_jammy.tar.gz) - -### 更新仓库源 - -根据系统版本将对应的清华仓库源添加到源配置文件中。 - -* [debian 添加清华仓库源教程](https://mirrors.tuna.tsinghua.edu.cn/help/debian/) - -* [ubuntu 添加清华仓库源教程](https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/) - -### deb包安装 - -debian 11 安装示例如下: +```bash +echo "deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community/linglong-repo/ unstable main" | sudo tee -a /etc/apt/sources.list +``` ```bash -tar -zxvf debian_bullseye.tar.gz -sudo apt install ./*.deb -sudo reboot +sudo apt update +sudo apt install linglong-builder ``` diff --git a/guide/start/install_pica.md b/guide/start/install_pica.md new file mode 100644 index 0000000..1061b2f --- /dev/null +++ b/guide/start/install_pica.md @@ -0,0 +1,26 @@ + + +# 安装 pica 工具 + +## 系统 + +- deepin v23 + ```bash + sudo apt install linglong-pica + ``` +- UOS 1070 + +添加玲珑仓库源,如果前面已经添加了仓库源,就不需要再添加了。 + +```bash +echo "deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community/linglong-repo/ unstable main" | sudo tee -a /etc/apt/sources.list +``` + +```bash +sudo apt update +sudo apt install linglong-pica +```