diff options
author | Vincenzo Mantova <1962985+xworld21@users.noreply.github.com> | 2024-01-21 03:13:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-20 22:13:40 -0500 |
commit | 28dbc86c498e4da9a4e44949e82a583627273319 (patch) | |
tree | 66f9e0ff38ae90fe828d642275a257b6fd50ccb5 /pkgs | |
parent | e2398020855514bde3a6b33594dad9d9c72a153d (diff) | |
download | nixlib-28dbc86c498e4da9a4e44949e82a583627273319.tar nixlib-28dbc86c498e4da9a4e44949e82a583627273319.tar.gz nixlib-28dbc86c498e4da9a4e44949e82a583627273319.tar.bz2 nixlib-28dbc86c498e4da9a4e44949e82a583627273319.tar.lz nixlib-28dbc86c498e4da9a4e44949e82a583627273319.tar.xz nixlib-28dbc86c498e4da9a4e44949e82a583627273319.tar.zst nixlib-28dbc86c498e4da9a4e44949e82a583627273319.zip |
texlive: create outputsToInstall outputs in main derivation (#270232)
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/typesetting/tex/texlive/build-tex-env.nix | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix index 0074991eaaf6..606d9dcb0840 100644 --- a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix +++ b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix @@ -203,14 +203,9 @@ let withPackages = reqs: self (args // { requiredTeXPackages = ps: requiredTeXPackages ps ++ reqs ps; __fromCombineWrapper = false; }); }; - out = (if (! __combine) - # meta.outputsToInstall = [ "out" "man" ] is invalid within buildEnv: - # checkMeta will notice that there is no actual "man" output, and fail - # so we set outputsToInstall from the outside, where it is safe - then lib.addMetaAttrs { inherit (pkgList) outputsToInstall; } - else x: x) # texlive.combine: man pages used to be part of out + out = # no indent for git diff purposes -((buildEnv { +(buildEnv { inherit name; @@ -240,6 +235,14 @@ let inherit meta passthru; postBuild = + # create outputs + lib.optionalString (! __combine) '' + for otherOutputName in $outputs ; do + if [[ "$otherOutputName" == 'out' ]] ; then continue ; fi + otherOutput="otherOutput_$otherOutputName" + ln -s "''${!otherOutput}" "''${!otherOutputName}" + done + '' + # environment variables (note: only export the ones that are used in the wrappers) '' TEXMFROOT="${texmfroot}" @@ -431,5 +434,16 @@ let ln -s "$TEXMFDIST" "$out"/share/texmf '' ; -}).overrideAttrs (_: { allowSubstitutes = true; })); +}).overrideAttrs (prev: + { allowSubstitutes = true; } + # the outputsToInstall must be built by the main derivation for nix-profile-install to work + // lib.optionalAttrs (! __combine) ({ + outputs = pkgList.outputsToInstall; + meta = prev.meta // { inherit (pkgList) outputsToInstall; }; + } // (lib.mapAttrs' + (out: drv: { name = "otherOutput_" + out; value = drv; }) + (lib.getAttrs (builtins.tail pkgList.outputsToInstall) splitOutputs) + ) + ) +); in out) |