This repository contains the manifests and scripts used for building and packaging Lapce for Flathub.
The scripts make use of cargo/flatpak-cargo-generator.py
from flatpak-builder-tools and a modified update.py
from flathub/net.veloren.veloren.
Running a code editor sandboxed can be tricky. Linters and other plugins often need access to source files normally not accessible by the flatpak sandbox. Therefore this flatpak sets the following permissions by default:
filesystem=host
: The whole host filesystem is accessible by Lapce (to work around issues like this).talk-name=org.freedesktop.Flatpak
: Allows the use of flatpak-spawn --host. Lapce opens a host shell automatically if this permission is set (see upstream PR for details).
Flathub provides SDK extensions that package development tools for various programming languages. These have to be installed and enabled manually.
- To get a list of available extensions on your system, run
flatpak search org.freedesktop.Sdk.Extension
- Install the desired extension with
flatpak install org.freedesktop.Sdk.Extension.rust-stable
- To enable the extension you have to add it to the sandbox $PATH by running
flatpak override --user dev.lapce.lapce --env=PATH=/app/bin:/usr/bin:/usr/lib/sdk/rust-stable/bin
The Lapce developers provide nightly builds for testing. These can be downloaded via their releases page.
Flathub is only meant for distributing stable releases, so nightly flatpaks won't be provided. If you want to build a flatpak from the latest upstream commit, follow these simple steps:
# create a new branch
git checkout -b bleeding-edge
# update the manifests to match the latest upstream commit
python update.py lapce-git.json
# build and install the flatpak
flatpak-builder --user --install --force-clean build dev.lapce.lapce.yaml
Similar to the instructions above, you can build from a different repository or branch for testing:
- create a new branch:
git checkout -b test-feature-x
- edit
lapce-git.json
to point to the desired repository/branch:
{
"type": "git",
"url": "https://github.com/user-name/lapce",
"branch": "branch-name"
}
git add lapce-git.json && git commit -m "Use custom repository"
- update the manifests to match the latest commit:
python update.py lapce-git.json
. Run this command again, every time the remote repository changes. - build and install the flatpak:
flatpak-builder --user --install --force-clean build dev.lapce.lapce.yaml