我使用的是deepin15.10.1版本,刚开始装的flatpak一直是0.8.9版本,使用官方的命令一直无法调通,需要添加stretch-backports源,可以更新到1.2.4版。
- Install a runtime and the matching SDK
sudo apt install flatpak flatpak-builder deepin-fprt-com.deepin.platform-15.5 deepin-fprt-com.deepin.sdk-15.5
2.Create the app新建helloworld.sh
#!/bin/sh
echo "Hello world"
3.Add a manifest新建com.flatpak.helloworld.json
{
"app-id":"com.flatpak.Helloworld",
"runtime":"com.deepin.Platform",
"runtime-version":"15.5.2",
"sdk":"com.deepin.Sdk",
"command":"hello.sh",
"modules":[
{
"name":"hello",
"buildsystem":"simple",
"build-commands":[
"install -D hello.sh /app/bin/hello.sh"
],
"sources":[
{
"type":"file",
"path":"hello.sh"
}
]
}
]
}
4.Build the application
flatpak-builder build-dir com.flatpak.helloworld.json
5.Test the build
flatpak-builder --run build-dir com.flatpak.helloworld.json helloworld.sh
6. Put the app in a repository
flatpak-builder --repo=repo --force-clean build-dir com.flatpak.helloworld.json
7. Install the app
flatpak --user remote-add --no-gpg-verify tutorial-repo repo
flatpak --user install tutorial-repo com.flatpak.helloworld
8. Run the app
flatpak run org.flatpak.Hello