From ed6b78022a53890381e9f5e5f0392f86b7b4f5f1 Mon Sep 17 00:00:00 2001 From: eymeric Date: Thu, 6 Jun 2024 15:26:36 +0200 Subject: [PATCH 1/4] doc: add nixpkgs avalability --- docs/installation.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index cfc6e31a..22db7bdb 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -56,7 +56,15 @@ conda install -c bkryza/label/clang-uml clang-uml #### Nix +You can use the version packaged in nixpkgs like this: ```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 # To build using nix flakes From 1393afc1468bf5aa55bd9b9fb24a115f56196c35 Mon Sep 17 00:00:00 2001 From: eymeric Date: Thu, 6 Jun 2024 17:29:00 +0200 Subject: [PATCH 2/4] doc: add nix version info --- docs/installation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/installation.md b/docs/installation.md index 22db7bdb..8820a3a4 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -57,6 +57,7 @@ conda install -c bkryza/label/clang-uml clang-uml #### 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 nix-shell -p clang-uml ``` From aec9d553ddebdf695ac6cbdc32bd5d0a181a63ff Mon Sep 17 00:00:00 2001 From: eymeric Date: Thu, 6 Jun 2024 20:48:06 +0200 Subject: [PATCH 3/4] packaging: now wrapped is the default for nix --- docs/common_options.md | 9 ++++----- packaging/nix/default.nix | 12 +++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/common_options.md b/docs/common_options.md index 83abcf84..563730e9 100644 --- a/docs/common_options.md +++ b/docs/common_options.md @@ -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`. diff --git a/packaging/nix/default.nix b/packaging/nix/default.nix index f6571b2c..6be05643 100644 --- a/packaging/nix/default.nix +++ b/packaging/nix/default.nix @@ -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 From 37334d54ccbc84bb683ceb31ff1696d4b56a06c5 Mon Sep 17 00:00:00 2001 From: eymeric Date: Thu, 6 Jun 2024 20:51:12 +0200 Subject: [PATCH 4/4] small nix packaging shell completion cleanup --- packaging/nix/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packaging/nix/default.nix b/packaging/nix/default.nix index 6be05643..15410c67 100644 --- a/packaging/nix/default.nix +++ b/packaging/nix/default.nix @@ -38,7 +38,8 @@ stdenv.mkDerivation { 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 + installShellCompletion --cmd clang-uml \ + --bash $src/packaging/autocomplete/clang-uml \ + --zsh $src/packaging/autocomplete/_clang-uml ''; }