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.md | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/book/src/building-from-source.md b/book/src/building-from-source.md index 33038098..42ed57a2 100644 --- a/book/src/building-from-source.md +++ b/book/src/building-from-source.md @@ -7,7 +7,6 @@ - [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: @@ -35,19 +34,10 @@ RUSTFLAGS="-C target-feature=-crt-static" 2. Compile from source: ```sh - # Reproducible cargo install --path helix-term --locked ``` - ```sh - # Optimized - cargo install \ - --profile opt \ - --config 'build.rustflags=["-C", "target-cpu=native"]' \ - --path helix-term \ - --locked - ``` - Either command will create the `hx` executable and construct the tree-sitter + This command will create the `hx` executable and construct the tree-sitter grammars in the local `runtime` folder. > 💡 If you do not want to fetch or build grammars, set an environment variable `HELIX_DISABLE_AUTO_GRAMMAR_BUILD` @@ -73,9 +63,11 @@ export HELIX_RUNTIME=~/src/helix/runtime Or, create a symbolic link: ```sh -ln -Tsf $PWD/runtime ~/.config/helix/runtime +ln -Ts $PWD/runtime ~/.config/helix/runtime ``` +If the above command fails to create a symbolic link because the file exists either move `~/.config/helix/runtime` to a new location or delete it, then run the symlink command above again. + #### Windows Either set the `HELIX_RUNTIME` environment variable to point to the runtime files using the Windows setting (search for @@ -83,7 +75,7 @@ Either set the `HELIX_RUNTIME` environment variable to point to the runtime file Cmd: ```sh -setx HELIX_RUNTIME "%userprofile%\src\helix\runtime" +setx HELIX_RUNTIME "%userprofile%\source\repos\helix\runtime" ``` > 💡 `%userprofile%` resolves to your user directory like @@ -125,7 +117,7 @@ to package the runtime into `/usr/lib/helix/runtime`. The rough steps a build script could follow are: 1. `export HELIX_DEFAULT_RUNTIME=/usr/lib/helix/runtime` -1. `cargo build --profile opt --locked` +1. `cargo build --profile opt --locked --path helix-term` 1. `cp -r runtime $BUILD_DIR/usr/lib/helix/` 1. `cp target/opt/hx $BUILD_DIR/usr/bin/hx` @@ -170,39 +162,3 @@ 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 following: -> ``` -> warning: Failed to find dependency specification -> ``` -> 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 |