117人参与 • 2024-08-06 • 云计算
如意玲珑(linyaps)项目已与开放原子开源基金会完成捐赠协议签署,目前如意玲珑已成为基金会的正式孵化期项目。
如意玲珑是开源软件包格式,用于替代 deb、rpm 等包管理工具,实现应用包管理、分发、容器、集成开发工具等功能。作为一种新型的独立包管理工具集,如意玲珑主要提供分层与隔离的运行环境,来解决传统包管理系统强依赖导致的兼容性问题,以及权限松散导致的安全问题。减少不同操作系统下分发时的打包次数,做到 “一个架构,一次构建”,为 linux 生态发展提供了坚实的基础。
近日,如意玲珑官网使用手册新增 openeuler 添加如意玲珑仓库源介绍,诚邀您抢先体验。
本文适用于 1.5.6 版本,请使用 ll-cli --version 检查您的如意玲珑程序版本。
ll-builder 用来构建和调试如意玲珑应用,由 linglong-builder 提供;
ll-box 沙箱容器,由 linglong-box 提供;
ll-cli 管理和运行如意玲珑应用,由 linglong-bin 提供。
sudo curl -o /etc/yum.repos.d/linglong.repo -l https://eur.openeuler.openatom.cn/coprs/kamiyadm/linglong/repo/openeuler-24.03_lts/kamiyadm-linglong-openeuler-24.03_lts.repo
sudo dnf update
sudo dnf install linglong-builder linglong-box linglong-bin
如果想运行 gui 类型应用,需要安装桌面环境,仅运行终端类型应用不需要安装桌面环境。这里以安装 dde 为例,也支持在其他桌面环境下使用,如 kde,gnome。
sudo dnf install dde
sudo systemctl set-default graphical.target
sudo reboot
1.1 创建项目
创建如意玲珑项目命令:
ll-builder create
查看 ll-builder create 命令的帮助信息:
ll-builder create --help
ll-builder create 命令的帮助信息如下:
usage: ll-builder [options] create <org.deepin.demo>
options:
-v, --verbose show detail log
-h, --help displays help on commandline options.
--help-all displays help including qt specific options.
arguments:
create create build template project
name project name
ll-builder create 命令根据输入的项目名称,在当前目录创建对应的文件夹,同时生成构建所需的 linglong.yaml 模板文件。示例:
ll-builder create org.deepin.hello
命令输出如下:
org.deepin.hello/
└── linglong.yaml
1.2 编辑 linglong.yaml
linglong.yaml 文件语法的版本:version: "1"
软件包元信息配置:
package:
id: org.deepin.hello
name: hello
version: 0.0.0.1
kind: app
description: /
simple demo.
基础环境,最小的根文件系统:
base: org.deepin.foundation/23.0.0
如意玲珑应用的启动命令:
command: [echo, -e, hello world]
在容器内构建项目需要的命令:
build: /
echo 'hello' #some operation to build this project
完整的 linglong.yaml 配置内容如下:
version: "1"
package:
id: org.deepin.hello
name: your name #set your application name
version: 0.0.0.1 #set your version
kind: app
description: /
your description #set a brief text to introduce your application.
command: [echo, -e, hello world] #the commands that your application need to run.
base: org.deepin.foundation/23.0.0 #set the base environment, this can be changed.
#set the runtime environment if you need, a example of setting deepin runtime is as follows.
#runtime:
#org.deepin.runtime/23.0.1
#set the source if you need, a simple example of git is as follows.
#sources:
# - kind: git
# url: https://github.com/linuxdeepin/linglong-builder-demo.git
# version: master\n
# commit: a3b89c3aa34c1aff8d7f823f0f4a87d5da8d4dc0
build: /
echo 'hello' #some operation to build this project
1.3 构建应用
ll-builder build 命令用来构建如意玲珑应用。
查看 ll-builder build 命令的帮助信息:
ll-builder build --help
ll-builder build 命令的帮助信息如下:
--exec <command> run exec than build script
--offline only use local files. this implies --skip-fetch-source
and --skip-pull-depend
--skip-fetch-source skip fetch sources
--skip-pull-depend skip pull dependency
--skip-run-container skip run container. this implies skip-commit-output
--skip-commit-output skip commit build output
--arch <arch> set the build arch
arguments:
build build project
ll-builder build 命令必须运行在工程的根目录,即 linglong.yaml 文件所在位置。以如意玲珑项目 org.deepin.demo 为例,构建如意玲珑应用主要步骤如下:
● 进入到 org.deepin.demo 项目工程目录:
cd org.deepin.demo
● 执行 ll-builder build 命令将开始构建如意玲珑应用:
ll-builder build
构建完成后,构建内容将自动提交到本地 ostree 缓存中。
1.4 验证应用
ll-builder run 命令用来运行验证应用。
查看 ll-builder run 命令的帮助信息:
ll-builder run --help
ll-builder run 命令的帮助信息如下:
usage: ll-builder [options] run
options:
-v, --verbose show detail log
-h, --help displays this help.
--exec <exec> run exec than build script
arguments:
run run project
在 linglong.yaml 文件所在位置,执行 ll-builder run 即可运行该应用。
示例项目 org.deepin.demo 运行结果如下:
hello
也可从构建缓存中导出成离线文件,通过客户端工具 ll-cli 安装使用。
1.5 导出离线文件
ll-builder 提供了子命令 export 来导出离线文件(.uab/.layer)。
查看 ll-builder export 命令的帮助信息:
ll-builder export --help
ll-builder export 命令的帮助信息如下:
usage: ll-builder [options]
options:
-v, --verbose show detail log (deprecated, use qt_logging_rules)
-h, --help displays help on commandline options.
--help-all displays help including qt specific options.
-f, --file <path> file path of the linglong.yaml (default is ./linglong.yaml)
-i, --icon <path> uab icon (optional)
-l, --layer export layer file
在 linglong.yaml 文件所在位置,执行以下命令即可将构建缓存导出离线文件:
ll-builder export --layer
执行成功后,将在当前目录下,生成两个以.layer 结尾的文件:
org.deepin.demo_0.0.0.1_x86_64_develop.layer
org.deepin.demo_0.0.0.1_x86_64_binary.layer
包含 binary(此前这部分名为 runtime)的部分为应用的主要运行内容,develop 在 binary 的基础上保留调试环境(如调试符号)。
2.1 安装玲珑应用
2.1.1 使用 ll-cli install 安装
首先查看 ll-cli install 命令的帮助信息:
ll-cli install --help
ll-cli install 命令的帮助信息如下:
linglong cli
a cli program to run application and manage linglong pagoda and tiers.
usage:
ll-cli [--json] --version
ll-cli [--json] run app [--no-dbus-proxy] [--dbus-proxy-cfg=path] ( [--file=file] | [--url=url] ) [--] [command...]
ll-cli [--json] ps
ll-cli [--json] exec pagoda [--working-directory=path] [--] command...
ll-cli [--json] enter pagoda [--working-directory=path] [--] [command...]
ll-cli [--json] kill pagoda
ll-cli [--json] [--no-dbus] install tier
ll-cli [--json] uninstall tier [--all] [--prune]
ll-cli [--json] upgrade tier
ll-cli [--json] search [--type=type] [--dev] text
ll-cli [--json] [--no-dbus] list [--type=type]
ll-cli [--json] repo modify [--name=repo] url
ll-cli [--json] repo show
ll-cli [--json] info tier
ll-cli [--json] content app
arguments:
app specify the application.
pagoda specify the pagodas (container).
tier specify the tier (container layer).
url specify the new repo url.
text the text used to search tiers.
options:
-h --help show help information of ll-cli.
--version show version.
--json use json to output command result, you can get the description of the output refer to linglong api documentation(/usr/share/linglong/api/api.json).
--no-dbus use peer to peer dbus, this is used only in case that dbus daemon is not available.
--no-dbus-proxy do not enable linglong-dbus-proxy.
--dbus-proxy-cfg=path path of config of linglong-dbus-proxy.
--file=file you can refer to https://linglong.dev/guide/ll-cli/run.html to use this parameter.
--url=url you can refer to https://linglong.dev/guide/ll-cli/run.html to use this parameter.
--working-directory=path specify working directory.
--type=type filter result with tiers type. one of "runtime", "app" or "all". [default: app]
--state=state filter result with the tiers install state. should be "local" or "remote". [default: local]
--prune remove application data if the tier is an application and all version of that application has been removed.
--dev include develop tiers in result.
subcommands:
run run an application.
ps list all pagodas.
exec execute command in a pagoda.
enter enter a pagoda.
kill stop applications and remove the pagoda.
install install tier(s).
uninstall uninstall tier(s).
upgrade upgrade tier(s).
search search for tiers.
list list known tiers.
repo display or modify information of the repository currently using.
info display the information of layer
content display the exported files of application
从玲珑仓库安装玲珑应用,以百度网盘为例:
ll-cli install com.baidu.baidunetdisk
ll-cli install 命令需要输入应用完整的 id,若仓库有多个版本则会默认安装最高版本。安装指定版本需在 appid 后附加对应版本号:
ll-cli install com.baidu.baidunetdisk/4.17.7.0
应用安装完成后,客户端会显示安装结果。
2.1.2 从本地通过离线文件安装应用
以构建示例 org.deepin.demo 为例:
安装.layer 文件:
ll-cli install ./org.deepin.demo_0.0.0.1_x86_64_binary.layer
查看安装是否成功命令:
ll-cli list | grep org.deepin.demo
2.2 运行玲珑应用
如果有桌面环境的情况下,可以通过双击启动器下的图标运行应用,或通过终端命令行运行,使用 run 命令运行应用:
ll-cli run org.deepin.demo
已有数十家企业、数十位个人开发者参与如意玲珑应用生态贡献,目前已成功适配超过 2000 款玲珑应用,这些应用将逐步上架至如意玲珑网页版商店、deepin 以及统信应用商店,为广大用户提供更丰富的选择和更便捷的体验。诚挚邀请广大伙伴及用户加入如意玲珑生态共建,携手推动 linux 生态的进步和发展。
(1)deepin 历史版本镜像(含 deepin v15)
(2)如意玲珑社区官网
(3)如意玲珑代码仓库
您想发表意见!!点此发布评论
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论