Skip to content

Commit

Permalink
buildenv: pass preferLocalBuild & allowSubstitutes
Browse files Browse the repository at this point in the history
Avoids an `.overrideAttrs` invocation in `buildTexliveCombinedEnv`.
  • Loading branch information
bb010g committed Apr 25, 2021
1 parent d822ae0 commit c588d0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pkgs/build-support/buildenv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ lib.makeOverridable
, nativeBuildInputs ? [] # Handy e.g. if using makeWrapper in `postBuild`.
, buildInputs ? []

, preferLocalBuild ? true
, allowSubstitutes ? false

, passthru ? {}
, meta ? {}
}:
Expand All @@ -55,7 +58,8 @@ runCommand name
rec {
inherit manifest ignoreCollisions checkCollisionContents passthru
meta pathsToLink extraPrefix postBuild
nativeBuildInputs buildInputs;
nativeBuildInputs buildInputs
preferLocalBuild allowSubstitutes;
pkgs = builtins.toJSON (map (drv: {
paths =
# First add the usual output(s): respect if user has chosen explicitly,
Expand All @@ -71,8 +75,6 @@ runCommand name
(builtins.map (outName: drv.${outName} or null) extraOutputsToInstall);
priority = drv.meta.priority or 5;
}) paths);
preferLocalBuild = true;
allowSubstitutes = false;
# XXX: The size is somewhat arbitrary
passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
}
Expand Down
6 changes: 4 additions & 2 deletions pkgs/tools/typesetting/tex/texlive/combine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let
mkUniqueOutPaths = pkgs: uniqueStrings
(map (p: p.outPath) (builtins.filter lib.isDerivation pkgs));

in (buildEnv {
in buildEnv {
name = "texlive-${extraName}-${texliveBin.texliveYear}${extraVersion}";

extraPrefix = "/share/texmf";
Expand All @@ -53,6 +53,8 @@ in (buildEnv {
"/tex/generic/config" # make it a real directory for scheme-infraonly
];

allowSubstitutes = true;

buildInputs = [ makeWrapper ] ++ pkgList.extraInputs;

# This is set primarily to help find-tarballs.nix to do its job
Expand Down Expand Up @@ -279,6 +281,6 @@ in (buildEnv {
''
+ texliveBin.cleanBrokenLinks
;
}).overrideAttrs (_: { allowSubstitutes = true; })
}
# TODO: make TeX fonts visible by fontconfig: it should be enough to install an appropriate file
# similarly, deal with xe(la)tex font visibility?

0 comments on commit c588d0e

Please sign in to comment.