Skip to content

Conversation

@dengbo11
Copy link

This commit introduces the linglong.yaml file for deepin-draw, enabling it to be built and packaged as a Linglong package on the SW64 architecture.

The linglong.yaml file specifies the package ID, name, version, kind, and description. It also defines the command to run the application, the base and runtime images to use, and the build steps. The build process involves:

  1. Installing dependencies from deb packages.
  2. Modifying the service file to use Linglong.
  3. Preparing the plugin for image formats.
  4. Running CMake to build and install the application.
  5. Generating the .install file to set the LIBHEIF_PLUGIN_PATH for libheif plugins.
  6. Setting the LIBHEIF_PLUGIN_PATH to allow libheif.so.1 to load plugins.

The commit also includes a list of source files, which are deb packages required for building deepin-draw. This allows Linglong to automatically fetch and extract these dependencies during the build process.

Influence:

  1. Verify that deepin-draw can be successfully built and packaged using Linglong.
  2. Test the application's functionality after installation from the Linglong package.
  3. Check if the image formats are properly supported through the plugin.
  4. Confirm that the libheif plugins can be loaded correctly by checking if HEIF images can be opened in Deepin Draw.

feat: 为 deepin-draw 添加 linglong.yaml 文件

此提交为 deepin-draw 引入了 linglong.yaml 文件,使其能够在 SW64 架构上 构建和打包为 Linglong 软件包。

linglong.yaml 文件指定了软件包 ID、名称、版本、类型和描述。它还定义了
运行应用程序的命令,要使用的基础镜像和运行时镜像,以及构建步骤。 构建过
程包括:

  1. 从 deb 包安装依赖项。
  2. 修改服务文件以使用 Linglong。
  3. 准备图像格式的插件。
  4. 运行 CMake 来构建和安装应用程序。
  5. 生成 .install 文件以设置 libheif 插件的 LIBHEIF_PLUGIN_PATH。
  6. 设置 LIBHEIF_PLUGIN_PATH 以允许 libheif.so.1 加载插件。

此提交还包括一个源文件列表,这些源文件是构建 deepin-draw 所需的 deb 包。
这允许 Linglong 在构建过程中自动获取和提取这些依赖项。

Influence:

  1. 验证 deepin-draw 是否可以使用 Linglong 成功构建和打包。
  2. 测试从 Linglong 软件包安装后应用程序的功能。
  3. 检查是否通过插件正确支持图像格式。
  4. 确认 libheif 插件可以正确加载,方法是检查是否可以在 Deepin Draw 中打 开 HEIF 图像。

This commit introduces the `linglong.yaml` file for deepin-draw,
enabling it to be built and packaged as a Linglong package on the SW64
architecture.

The `linglong.yaml` file specifies the package ID, name, version, kind,
and description. It also defines the command to run the application, the
base and runtime images to use, and the build steps. The build process
involves:

1.  Installing dependencies from deb packages.
2.  Modifying the service file to use Linglong.
3.  Preparing the plugin for image formats.
4.  Running CMake to build and install the application.
5.  Generating the `.install` file to set the LIBHEIF\_PLUGIN\_PATH for
libheif plugins.
6.  Setting the LIBHEIF\_PLUGIN\_PATH to allow libheif.so.1 to load
plugins.

The commit also includes a list of source files, which are deb packages
required for building deepin-draw. This allows Linglong to automatically
fetch and extract these dependencies during the build process.

Influence:
1. Verify that deepin-draw can be successfully built and packaged using
Linglong.
2. Test the application's functionality after installation from the
Linglong package.
3. Check if the image formats are properly supported through the plugin.
4. Confirm that the libheif plugins can be loaded correctly by checking
if HEIF images can be opened in Deepin Draw.

feat: 为 deepin-draw 添加 linglong.yaml 文件

此提交为 deepin-draw 引入了 `linglong.yaml` 文件,使其能够在 SW64 架构上
构建和打包为 Linglong 软件包。

`linglong.yaml` 文件指定了软件包 ID、名称、版本、类型和描述。它还定义了
运行应用程序的命令,要使用的基础镜像和运行时镜像,以及构建步骤。 构建过
程包括:

1.  从 deb 包安装依赖项。
2.  修改服务文件以使用 Linglong。
3.  准备图像格式的插件。
4.  运行 CMake 来构建和安装应用程序。
5.  生成 `.install` 文件以设置 libheif 插件的 LIBHEIF\_PLUGIN\_PATH。
6.  设置 LIBHEIF\_PLUGIN\_PATH 以允许 libheif.so.1 加载插件。

此提交还包括一个源文件列表,这些源文件是构建 deepin-draw 所需的 deb 包。
这允许 Linglong 在构建过程中自动获取和提取这些依赖项。

Influence:
1. 验证 deepin-draw 是否可以使用 Linglong 成功构建和打包。
2. 测试从 Linglong 软件包安装后应用程序的功能。
3. 检查是否通过插件正确支持图像格式。
4. 确认 libheif 插件可以正确加载,方法是检查是否可以在 Deepin Draw 中打
开 HEIF 图像。
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @dengbo11, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot
Copy link

deepin pr auto review

这是一个玲珑应用的配置文件,我来对其进行审查:

1. 语法逻辑

  1. YAML格式问题

    • 文件末尾缺少换行符(\ No newline at end of file
    • 长列表项应该使用YAML的多行格式以提高可读性
  2. 构建脚本逻辑

    • LDD_FILES数组中的路径引用可能存在问题,使用了相对路径,在构建过程中可能会找不到文件
    • deploy_dep命令的使用没有错误检查,如果失败会导致后续步骤继续执行

2. 代码质量

  1. 可维护性

    • sources部分列出了大量的依赖包,建议使用脚本或工具自动生成,减少手动维护的工作量
    • digest校验值较长,可以考虑使用变量或脚本管理
  2. 注释

    • 部分关键步骤缺少注释说明,如deploy_dep命令的具体作用
    • 建议添加更多注释说明配置项的用途

3. 代码性能

  1. 构建效率

    • cmake --build build -j使用了所有可用的CPU核心,这是合理的
    • 但是没有看到缓存配置,可以考虑添加ccache等工具加速构建
  2. 依赖管理

    • 依赖包数量庞大,建议考虑使用依赖合并或共享依赖来减少包体积
    • 一些基础包可能可以通过基础镜像提供,不需要单独列出

4. 代码安全

  1. URL安全

    • 所有依赖包都使用了HTTPS协议,这是好的实践
    • 建议添加更多关于源服务器可靠性的说明
  2. 完整性校验

    • 每个包都有digest校验,这是很好的安全措施
    • 建议考虑使用更安全的哈希算法(如SHA-256)

改进建议

  1. 格式优化
sources:
  - kind: file
    url: https://pools.uniontech.com/desktop-professional-V25/pool/main/q/qt6-base/qt6-base-dev_6.8.0+dfsg-0deepin5_sw64.deb
    digest: 214ec3b8071bbb10fc3967d8bc4b83546ad55e736165e487d8ce741106472ab9
  1. 构建脚本改进
# 修改服务使用玲珑启动
sed -i "s|Exec=/usr/bin/deepin-draw|Exec=deepin-draw|g" com.deepin.Draw.service || exit 1

# 准备插件
mkdir -p $PREFIX/bin/imageformats || exit 1
cp ${PREFIX}/lib/${TRIPLET}/qt6/plugins/imageformats/*.so $PREFIX/bin/imageformats || exit 1
  1. 依赖管理优化

    • 考虑将基础依赖移到基础镜像中
    • 使用依赖分组来管理不同类型的依赖
  2. 添加错误处理

# 生成应用名和动态隐式加载的依赖库
LDD_FILES=(
  deepin-draw
  ../libdeepin-event-log.so
  ../../bin/imageformats/kimg_avif.so
  ../../bin/imageformats/kimg_heif.so
  # plugins for libheif.so.1
  libheif/plugins/libheif-aomdec.so
  libheif/plugins/libheif-dav1d.so
  libheif/plugins/libheif-j2kdec.so
  libheif/plugins/libheif-libde265.so
  libheif/plugins/libheif-x265.so
)

# 生成.install 文件
if ! bash ./deploy_dep "${LDD_FILES[@]}"; then
    echo "Failed to deploy dependencies"
    exit 1
fi
  1. 添加构建缓存
build: |
  export CCACHE_DIR=/path/to/ccache
  export CCACHE_MAXSIZE=10G
  export CCACHE_COMPRESS=1
  export CCACHE_COMPRESSLEVEL=6
  
  bash ./install_dep linglong/sources "$PREFIX"
  # ... 其他构建步骤 ...

这些改进可以提高配置文件的可维护性、安全性和构建效率。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengbo11, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lzwind lzwind merged commit 1e5fa67 into linuxdeepin:develop/snipe Oct 15, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants