packaging: now wrapped is the default for nix

This commit is contained in:
eymeric
2024-06-06 20:48:06 +02:00
parent 1393afc146
commit aec9d553dd
2 changed files with 11 additions and 10 deletions

View File

@@ -226,11 +226,10 @@ set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTOR
```
### Nix wrapper
On NixOS or when using `nix`, `clang-uml` provides a wrapper script called
`clang-uml-wrapped`, which builds and exports `CPATH` and `CPLUS_INCLUDE_PATH`
On NixOS or when using `nix`, `clang-uml` uses a wrapper script,
which builds and exports `CPATH` and `CPLUS_INCLUDE_PATH`
environment variables before running `clang-uml`, which contain valid
system header Clang paths for the current Nix environment.
The `clang-uml-wrapped` script can be called the same way as `clang-uml` and
should resolve the system include paths without the need for any of the above
solutions.
If you want to use an unwrapped version, the `clang-uml-unwrapped` binary
can be called the same way as `clang-uml`.

View File

@@ -30,11 +30,13 @@ stdenv.mkDerivation {
clang = if enableLibcxx then llvmPackages.libcxxClang else llvmPackages.clang;
postInstall = ''
export unwrapped_clang_uml="$out/bin/clang-uml"
# inject clang and unwrap_clang_uml variables into wrapper
substituteAll ${./wrapper} $out/bin/clang-uml-wrapped
chmod +x $out/bin/clang-uml-wrapped
cp $out/bin/clang-uml $out/bin/clang-uml-unwrapped
rm $out/bin/clang-uml
export unwrapped_clang_uml="$out/bin/clang-uml-unwrapped"
# inject clang and unwrapp_clang_uml variables into wrapper
substituteAll ${./wrapper} $out/bin/clang-uml
chmod +x $out/bin/clang-uml
installShellCompletion --bash $src/packaging/autocomplete/clang-uml
installShellCompletion --zsh $src/packaging/autocomplete/_clang-uml