mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
texlivePackages: use proper multioutput derivations
TeX Live packages under `texlivePackages` are now left as simple
multioutput derivations (without changes done in `passthru`). This
should ensure that all outputs are copied in the binary caches.
(cherry picked from commit 637c1c82bf
)
This commit is contained in:
parent
45343c299d
commit
637e8d887c
@ -62,7 +62,7 @@ let
|
||||
# TeX Live packages should not be installed directly into the user profile
|
||||
outputsToInstall = [ ];
|
||||
longDescription = ''
|
||||
This package cannot be installed directly. Please use `texlive.withPackages`.
|
||||
This package cannot be installed or used directly. Please use `texlive.withPackages (ps: [ ps.${lib.strings.escapeNixIdentifier pname} ])`.
|
||||
'';
|
||||
# discourage nix-env from matching this package
|
||||
priority = 10;
|
||||
@ -152,7 +152,7 @@ let
|
||||
|
||||
# fake derivation for resolving dependencies in the absence of a "tex" containers
|
||||
fakeTeX = passthru
|
||||
// { inherit meta; tlOutputName = "tex"; }
|
||||
// { inherit meta; tlOutputName = "tex"; inherit build; }
|
||||
// outputDrvs;
|
||||
|
||||
containers = rec {
|
||||
@ -214,22 +214,31 @@ let
|
||||
ln -s {"$texdoc"/doc,"$out"/share}/info
|
||||
'') [ "out" ] // outputDrvs;
|
||||
};
|
||||
in
|
||||
if outputs == [ ] then removeAttrs fakeTeX [ "outputSpecified" ] else
|
||||
runCommand name
|
||||
{
|
||||
__structuredAttrs = true;
|
||||
inherit meta outputDrvs outputs;
|
||||
passthru = removeAttrs passthru [ "outputSpecified" ];
|
||||
|
||||
# force output name in case "out" is missing
|
||||
nativeBuildInputs = lib.optional (! hasBinfiles)
|
||||
(writeShellScript "force-output.sh" ''
|
||||
# multioutput derivation to be exported under texlivePackages
|
||||
# to make Hydra build all containers
|
||||
build = runCommand name
|
||||
{
|
||||
__structuredAttrs = true;
|
||||
inherit meta outputDrvs;
|
||||
outputs = if outputs != [ ] then outputs else [ "out" ];
|
||||
passthru = removeAttrs passthru [ "outputSpecified" ] // { inherit build; };
|
||||
|
||||
# force output name in case "out" is missing
|
||||
preHook = lib.optionalString (!hasBinfiles && outputs != [ ]) ''
|
||||
export out="''${${builtins.head outputs}-}"
|
||||
'');
|
||||
}
|
||||
''
|
||||
for outputName in ''${!outputs[@]} ; do
|
||||
ln -s "''${outputDrvs[$outputName]}" "''${outputs[$outputName]}"
|
||||
done
|
||||
'' // outputDrvs
|
||||
'';
|
||||
}
|
||||
# each output is just a symlink to the corresponding container
|
||||
# if the container is missing (that is, outputs == [ ]), create a file, to prevent passing the package to .withPackages
|
||||
''
|
||||
for outputName in ''${!outputs[@]} ; do
|
||||
if [[ -z ''${outputDrvs[$outputName]} ]] ; then
|
||||
ln -s "''${outputDrvs[$outputName]}" "''${outputs[$outputName]}"
|
||||
else
|
||||
touch "''${outputs[$outputName]}"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
in
|
||||
if outputs == [ ] then removeAttrs fakeTeX [ "outputSpecified" ] else build // outputDrvs
|
||||
|
@ -5278,7 +5278,7 @@ with pkgs;
|
||||
# TeX Live; see https://nixos.org/nixpkgs/manual/#sec-language-texlive
|
||||
texlive = callPackage ../tools/typesetting/tex/texlive { };
|
||||
inherit (texlive.schemes) texliveBasic texliveBookPub texliveConTeXt texliveFull texliveGUST texliveInfraOnly texliveMedium texliveMinimal texliveSmall texliveTeTeX;
|
||||
texlivePackages = recurseIntoAttrs (lib.filterAttrs (_: lib.isDerivation) texlive.pkgs);
|
||||
texlivePackages = recurseIntoAttrs (lib.mapAttrs (_: v: v.build) texlive.pkgs);
|
||||
|
||||
fop = callPackage ../tools/typesetting/fop { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user