Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'book/src/building-from-source.md')
-rw-r--r--book/src/building-from-source.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/book/src/building-from-source.md b/book/src/building-from-source.md
index 539e9cf8..b422f4bf 100644
--- a/book/src/building-from-source.md
+++ b/book/src/building-from-source.md
@@ -7,6 +7,7 @@
- [Note to packagers](#note-to-packagers)
- [Validating the installation](#validating-the-installation)
- [Configure the desktop shortcut](#configure-the-desktop-shortcut)
+- [Building the Debian package](#building-the-debian-package)
Requirements:
@@ -162,3 +163,39 @@ file. For example, to use `kitty`:
sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
```
+
+### Building the Debian package
+
+If the `.deb` file provided on the release page uses a `libc` version higher
+than that used by your Debian, Ubuntu, or Mint system, you can build the package
+from source to match your system's dependencies.
+
+Install `cargo-deb`, the tool used for building the `.deb` file:
+
+```sh
+cargo install cargo-deb
+```
+
+After cloning and entering the Helix repository as previously described,
+use the following command to build the release binary and package it into a `.deb` file in a single step.
+
+```sh
+cargo deb -- --locked
+```
+
+> 💡 This locks you into the `--release` profile. But you can also build helix in any way you like.
+> As long as you leave a `target/release/hx` file, it will get packaged with `cargo deb --no-build`
+
+> 💡 Don't worry about the repeated
+> ```
+> warning: Failed to find dependency specification
+> ```
+> warnings. Cargo deb just reports which packaged files it didn't derive dependencies for. But
+> so far the dependency deriving seams very good, even if some of the grammar files are skipped.
+
+You can find the resulted `.deb` in `target/debian/`. It should contain everything it needs, including the
+
+- completions for bash, fish, zsh
+- .desktop file
+- icon (though desktop environments might use their own since the name of the package is correctly `helix`)
+- launcher to the binary with the runtime