about summary refs log tree commit diff
path: root/pkgs/applications/networking
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2019-04-14 16:44:56 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2019-04-14 17:52:58 +0200
commit681b1d80611ce291c612e5d9f1d3a5e3cb532984 (patch)
tree60004a5c65f5664207f6efad4113f48360b22dfe /pkgs/applications/networking
parentcd80cab3b058c9a4de6c59e91177aa6a1b9c1eca (diff)
downloadnixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.tar
nixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.tar.gz
nixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.tar.bz2
nixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.tar.lz
nixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.tar.xz
nixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.tar.zst
nixlib-681b1d80611ce291c612e5d9f1d3a5e3cb532984.zip
weechat: install all outputs into the final store path
Resolves #59300

Until now only `$out/bin/weechat` and `$out/bin/weechat-headless` were installed
into the store path that will be used when running i.e. `nix-env -iA weechat`.

Further outputs like icons (`$out/share/icons`), man pages (`$man`) or the HTML
documentation (`$out/share/doc/weechat`) are omitted at the moment. As
this can be fairly confusing I figured that it's better to copy those
files into the environment as well.

As `buildEnv` doesn't appear to support output splitting (you can only
install additional outputs of `paths` using `extraOutputsToInstall`),
it's easier for now to always install the `man` output by
default.

Man page installation can be turned off like this now:

```
weechat.override { installManPages = false; }
```
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r--pkgs/applications/networking/irc/weechat/wrapper.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/applications/networking/irc/weechat/wrapper.nix b/pkgs/applications/networking/irc/weechat/wrapper.nix
index 81073222c2b4..bd05b63c68bb 100644
--- a/pkgs/applications/networking/irc/weechat/wrapper.nix
+++ b/pkgs/applications/networking/irc/weechat/wrapper.nix
@@ -6,7 +6,8 @@ weechat:
 
 let
   wrapper = {
-    configure ? { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; }
+    installManPages ? true
+  , configure ? { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; }
   }:
 
   let
@@ -65,14 +66,22 @@ let
       ${lib.concatMapStringsSep "\n" (p: lib.optionalString (p ? extraEnv) p.extraEnv) plugins}
       exec ${weechat}/bin/${bin} "$@" --run-command ${lib.escapeShellArg init}
     '') // {
-      inherit (weechat) name;
+      inherit (weechat) name man;
       unwrapped = weechat;
+      outputs = [ "out" "man" ];
     };
   in buildEnv {
     name = "weechat-bin-env-${weechat.version}";
+    extraOutputsToInstall = lib.optionals installManPages [ "man" ];
     paths = [
       (mkWeechat "weechat")
       (mkWeechat "weechat-headless")
+      (runCommand "weechat-out-except-bin" { } ''
+        mkdir $out
+        ln -sf ${weechat}/include $out/include
+        ln -sf ${weechat}/lib $out/lib
+        ln -sf ${weechat}/share $out/share
+      '')
     ];
     meta = builtins.removeAttrs weechat.meta [ "outputsToInstall" ];
   };