我想用 snapcraft 创建一个 snap。我没有源代码,只有一个可立即使用的可执行文件 (application/x-executable) 和一个共享库 (.so)。
用户稍后只需在 bash 中输入“test1”,我的程序就会启动。我无法创建 snap。
我的文件夹结构:
snapcraft-test --> snap --> test1, snapcraft.yaml, test.so
这是我的 snapcraft.yaml:
name: testsnap
version: '0.1'
summary: Single-line elevator pitch for your amazing snap
description: Some description
grade: devel
confinement: devmode
apps:
test1:
command: bin/test1
parts:
test1:
plugin: dump
source: .
stage-packages: [libsocketcan-dev]
当我使用时,我收到以下错误消息snapcraft cleanbuild
:
FileNotFoundError: [Errno 2] No such file or directory: '/root/build_testsnap/prime/bin/test1'
Stopping local:snapcraft-about-overremiss-gaynell
答案1
如果不解决 .so 文件的问题(请参阅我上面的问题),我相信您需要稍微使用一下“组织”和“环境”选项:
name: testsnap
version: '0.1'
summary: Single-line elevator pitch for your amazing snap
description: Some description
grade: devel
confinement: devmode
apps:
test1:
command: usr/local/bin/test1
environment:
LD_LIBRARY_PATH: ${SNAP}/usr/local/lib
parts:
test1:
plugin: dump
source: .
stage-packages: [libsocketcan-dev]
organize:
snap/test1 : usr/local/bin/test1
snap/test.so : usr/local/lib/test.so