From 681b1d80611ce291c612e5d9f1d3a5e3cb532984 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 14 Apr 2019 16:44:56 +0200 Subject: [PATCH] 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; } ``` --- .../applications/networking/irc/weechat/wrapper.nix | 13 +++++++++++-- 1 file 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" ]; };