Merge pull request #286 from hatch01/master
packaging: add nixpkgs avalability and make wrapped script the default
This commit is contained in:
@@ -226,11 +226,10 @@ set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTOR
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Nix wrapper
|
### Nix wrapper
|
||||||
On NixOS or when using `nix`, `clang-uml` provides a wrapper script called
|
On NixOS or when using `nix`, `clang-uml` uses a wrapper script,
|
||||||
`clang-uml-wrapped`, which builds and exports `CPATH` and `CPLUS_INCLUDE_PATH`
|
which builds and exports `CPATH` and `CPLUS_INCLUDE_PATH`
|
||||||
environment variables before running `clang-uml`, which contain valid
|
environment variables before running `clang-uml`, which contain valid
|
||||||
system header Clang paths for the current Nix environment.
|
system header Clang paths for the current Nix environment.
|
||||||
|
|
||||||
The `clang-uml-wrapped` script can be called the same way as `clang-uml` and
|
If you want to use an unwrapped version, the `clang-uml-unwrapped` binary
|
||||||
should resolve the system include paths without the need for any of the above
|
can be called the same way as `clang-uml`.
|
||||||
solutions.
|
|
||||||
|
|||||||
@@ -56,7 +56,16 @@ conda install -c bkryza/label/clang-uml clang-uml
|
|||||||
|
|
||||||
#### Nix
|
#### Nix
|
||||||
|
|
||||||
|
You can use the version packaged in nixpkgs like this:
|
||||||
|
Currently clang-uml version 0.5.1 is available in nixos-unstable and nixos-24.05
|
||||||
```bash
|
```bash
|
||||||
|
nix-shell -p clang-uml
|
||||||
|
```
|
||||||
|
|
||||||
|
Or you can build it by yourself
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# To build it by yourself
|
||||||
git clone https://github.com/bkryza/clang-uml
|
git clone https://github.com/bkryza/clang-uml
|
||||||
|
|
||||||
# To build using nix flakes
|
# To build using nix flakes
|
||||||
|
|||||||
@@ -30,13 +30,16 @@ stdenv.mkDerivation {
|
|||||||
clang = if enableLibcxx then llvmPackages.libcxxClang else llvmPackages.clang;
|
clang = if enableLibcxx then llvmPackages.libcxxClang else llvmPackages.clang;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
export unwrapped_clang_uml="$out/bin/clang-uml"
|
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 unwrap_clang_uml variables into wrapper
|
# inject clang and unwrapp_clang_uml variables into wrapper
|
||||||
substituteAll ${./wrapper} $out/bin/clang-uml-wrapped
|
substituteAll ${./wrapper} $out/bin/clang-uml
|
||||||
chmod +x $out/bin/clang-uml-wrapped
|
chmod +x $out/bin/clang-uml
|
||||||
|
|
||||||
installShellCompletion --bash $src/packaging/autocomplete/clang-uml
|
installShellCompletion --cmd clang-uml \
|
||||||
installShellCompletion --zsh $src/packaging/autocomplete/_clang-uml
|
--bash $src/packaging/autocomplete/clang-uml \
|
||||||
|
--zsh $src/packaging/autocomplete/_clang-uml
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user