diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index dd1822de4925e..fefaa8cdffe7a 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, fetchpatch, buildPackages -, texlive +, bin, combine, pkgs, src, version , zlib, libiconv, libpng, libX11 , freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext , perl, perlPackages, python3Packages, pkg-config @@ -7,7 +7,7 @@ , brotli, cairo, pixman, xorg, clisp, biber, woff2, xxHash , makeWrapper, shortenPerlShebang, useFixedHashes, asymptote , biber-ms -}: +}@args: # Useful resource covering build options: # http://tug.org/texlive/doc/tlbuild.html @@ -15,21 +15,14 @@ let withSystemLibs = map (libname: "--with-system-${libname}"); - year = toString ((import ./tlpdb.nix)."00texlive.config").year; - version = year; # keep names simple for now + version = toString args.version.texliveYear; # keep names simple for now # detect and stop redundant rebuilds that may occur when building new fixed hashes assertFixedHash = name: src: if ! useFixedHashes || src ? outputHash then src else throw "The TeX Live package '${src.pname}' must have a fixed hash before building '${name}'."; common = { - src = fetchurl { - urls = [ - "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0321-source.tar.xz" - "ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0321-source.tar.xz" - ]; - hash = "sha256-X/o0heUessRJBJZFD8abnXvXy55TNX2S20vNT9YXm1Y="; - }; + inherit src; prePatch = '' for i in texk/kpathsea/mktex*; do @@ -77,7 +70,7 @@ let in rec { # un-indented inherit (common) cleanBrokenLinks; -texliveYear = year; +texliveYear = version; core = stdenv.mkDerivation rec { @@ -93,8 +86,8 @@ core = stdenv.mkDerivation rec { ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ # configure: error: tangle was not found but is required when cross-compiling. # dev (himktables) is used when building hitex to generate the additional source file hitables.c - texlive.bin.core - texlive.bin.core.dev + bin.core + bin.core.dev ]; buildInputs = [ @@ -196,7 +189,7 @@ core = stdenv.mkDerivation rec { }; -inherit (core-big) metafont mflua metapost luatex luahbtex luajittex xetex; +inherit (bin.core-big) metafont mflua metapost luatex luahbtex luajittex xetex; core-big = stdenv.mkDerivation { #TODO: upmendex pname = "texlive-core-big.bin"; inherit version; @@ -394,7 +387,7 @@ pygmentex = python3Packages.buildPythonApplication rec { inherit (src) version; format = "other"; - src = assertFixedHash pname (lib.head (builtins.filter (p: p.tlType == "run") texlive.pygmentex.pkgs)); + src = assertFixedHash pname (lib.head (builtins.filter (p: p.tlType == "run") pkgs.pygmentex.pkgs)); propagatedBuildInputs = with python3Packages; [ pygments chardet ]; @@ -475,7 +468,7 @@ xdvi = stdenv.mkDerivation { xpdfopen = stdenv.mkDerivation { pname = "texlive-xpdfopen.bin"; - inherit (lib.head texlive.xpdfopen.pkgs) version; + inherit (lib.head pkgs.xpdfopen.pkgs) version; inherit (common) src; @@ -510,7 +503,7 @@ xindy = stdenv.mkDerivation { nativeBuildInputs = [ pkg-config perl - (texlive.combine { inherit (texlive) scheme-basic cyrillic ec; }) + (combine { inherit (pkgs) scheme-basic cyrillic ec; }) ]; buildInputs = [ clisp libiconv perl ]; diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix index 8a32657271683..09aaba4e275c6 100644 --- a/pkgs/tools/typesetting/tex/texlive/combine.nix +++ b/pkgs/tools/typesetting/tex/texlive/combine.nix @@ -1,6 +1,6 @@ { lib, buildEnv, runCommand, writeText, makeWrapper, libfaketime, makeFontsConf , perl, bash, coreutils, gnused, gnugrep, gawk, ghostscript -, bin, tl }: +, bin, pkgs }: # combine = args@{ pkgFilter ? (pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "core" @@ -49,7 +49,7 @@ let paths = lib.catAttrs "outPath" pkgList.nonbin; # mktexlsr - nativeBuildInputs = [ (lib.last tl."texlive.infra".pkgs) ]; + nativeBuildInputs = [ (lib.last pkgs."texlive.infra".pkgs) ]; postBuild = # generate ls-R database '' @@ -107,9 +107,9 @@ in (buildEnv { nativeBuildInputs = [ makeWrapper libfaketime - (lib.last tl."texlive.infra".pkgs) # mktexlsr - (lib.last tl.texlive-scripts.pkgs) # fmtutil, updmap - (lib.last tl.texlive-scripts-extra.pkgs) # texlinks + (lib.last pkgs."texlive.infra".pkgs) # mktexlsr + (lib.last pkgs.texlive-scripts.pkgs) # fmtutil, updmap + (lib.last pkgs.texlive-scripts-extra.pkgs) # texlinks perl ]; diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 96bc6f61e4f0e..d188bed177d3d 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -2,79 +2,20 @@ - source: ../../../../../doc/languages-frameworks/texlive.xml - current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive */ -{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv -, callPackage, ghostscript_headless, harfbuzz -, makeWrapper, installShellFiles -, python3, ruby, perl, tk, jdk, bash, snobol4 -, coreutils, findutils, gawk, getopt, gnugrep, gnumake, gnupg, gnused, gzip, ncurses, zip -, libfaketime, asymptote, biber-ms, makeFontsConf -, useFixedHashes ? true +{ lib +, makeScopeWithSplicing', pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsHostTarget , recurseIntoAttrs +, fetchurl, runCommand +, ghostscript_headless, harfbuzz +, tlpdb, tlpdbxzHash, src, version, mirrors, useFixedHashes ? true, fixedHashes ? {} }: let - # various binaries (compiled) - bin = callPackage ./bin.nix { - ghostscript = ghostscript_headless; - harfbuzz = harfbuzz.override { - withIcu = true; withGraphite2 = true; - }; - inherit useFixedHashes; - }; - - # function for creating a working environment from a set of TL packages - combine = import ./combine.nix { - inherit bin buildEnv lib makeWrapper writeText runCommand - perl libfaketime makeFontsConf bash tl coreutils gawk gnugrep gnused; - ghostscript = ghostscript_headless; - }; - - tlpdb = import ./tlpdb.nix; - - tlpdbVersion = tlpdb."00texlive.config"; - - # the set of TeX Live packages, collections, and schemes; using upstream naming - overriddenTlpdb = let - overrides = import ./tlpdb-overrides.nix { - inherit - lib bin tlpdb tlpdbxz tl - installShellFiles - coreutils findutils gawk getopt ghostscript_headless gnugrep - gnumake gnupg gnused gzip ncurses perl python3 ruby zip; - }; - in overrides tlpdb; - - version = { - # day of the snapshot being taken - year = "2023"; - month = "03"; - day = "19"; - # TeX Live version - texliveYear = 2022; - # final (historic) release or snapshot - final = true; - }; - - # The tarballs on CTAN mirrors for the current release are constantly - # receiving updates, so we can't use those directly. Stable snapshots - # need to be used instead. Ideally, for the release branches of NixOS we - # should be switching to the tlnet-final versions - # (https://tug.org/historic/). - mirrors = with version; lib.optionals final [ - # tlnet-final snapshot; used when texlive.tlpdb is frozen - # the TeX Live yearly freeze typically happens in mid-March - "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${toString texliveYear}/tlnet-final" - "ftp://tug.org/texlive/historic/${toString texliveYear}/tlnet-final" - ] ++ [ - # daily snapshots hosted by one of the texlive release managers; - # used for non-final snapshots and as fallback for final snapshots that have not reached yet the historic mirrors - # please note that this server is not meant for large scale deployment and should be avoided on release branches - # https://tug.org/pipermail/tex-live/2019-November/044456.html - "https://texlive.info/tlnet-archive/${year}/${month}/${day}/tlnet" - ]; + # the "texlive-specific" arguments passed to this function. + args = { inherit tlpdb tlpdbxzHash src version mirrors useFixedHashes fixedHashes; }; tlpdbxz = fetchurl { urls = map (up: "${up}/tlpkg/texlive.tlpdb.xz") mirrors; - hash = "sha256-vm7DmkH/h183pN+qt1p1wZ6peT2TcMk/ae0nCXsCoMw="; + hash = tlpdbxzHash; }; tlpdbNix = runCommand "tlpdb.nix" { @@ -85,85 +26,122 @@ let xzcat "$tlpdbxz" | sed -rn -f "$tl2nix" | uniq > "$out" ''; - # map: name -> fixed-output hash - fixedHashes = lib.optionalAttrs useFixedHashes (import ./fixed-hashes.nix); - - buildTeXLivePackage = import ./build-texlive-package.nix { - inherit lib fetchurl runCommand bash jdk perl python3 ruby snobol4 tk; - texliveBinaries = bin; + assertions = let tlpdbVersion = tlpdb."00texlive.config"; in + lib.assertMsg (tlpdbVersion.year == version.texliveYear) "TeX Live year in texlive does not match tlpdb.nix, refusing to evaluate" && + lib.assertMsg (tlpdbVersion.frozen == version.final) "TeX Live final status in texlive does not match tlpdb.nix, refusing to evaluate"; + + # the function defining the recursive attribute set that eventually makes up the texlive scope + addPackages = self: + let + callPackage = self.newScope (args // { + ghostscript = ghostscript_headless; + harfbuzz = harfbuzz.override { withIcu = true; withGraphite2 = true; }; + }); + in { + inherit callPackage; + + tlpdb = { + # nested in an attribute set to prevent them from appearing in search + nix = tlpdbNix; + xz = tlpdbxz; + }; + + bin = assert assertions; callPackage ./bin.nix { }; + + combine = assert assertions; callPackage ./combine.nix { }; + + pkgs = let + buildTeXLivePackage = callPackage ./build-texlive-package.nix { texliveBinaries = self.bin; }; + + overrides = callPackage ./tlpdb-overrides.nix { tlpdbxz = self.tlpdb.xz; }; + + overriddenTlpdb = overrides tlpdb; + + makePackageSet = tlpdb: + lib.mapAttrs (pname: { revision, extraRevision ? "", ... }@args: + buildTeXLivePackage (args + # NOTE: the fixed naming scheme must match generate-fixed-hashes.nix + // { inherit mirrors pname; fixedHashes = fixedHashes."${pname}-${toString revision}${extraRevision}" or { }; } + // lib.optionalAttrs (args ? deps) { deps = map (n: self.pkgs.${n}) (args.deps or [ ]); }) + ) tlpdb; + + in lib.makeOverridable makePackageSet overriddenTlpdb; + + + # Pre-defined combined packages for TeX Live schemes, + # to make nix-env usage more comfortable and build selected on Hydra. + combined = with lib; + let + # these license lists should be the sorted union of the licenses of the packages the schemes contain. + # The correctness of this collation is tested by tests.texlive.licenses + licenses = with lib.licenses; { + scheme-basic = [ free gfl gpl1Only gpl2 gpl2Plus knuth lgpl21 lppl1 lppl13c mit ofl publicDomain ]; + scheme-context = [ bsd2 bsd3 cc-by-sa-40 free gfl gfsl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus knuth lgpl2 lgpl21 + lppl1 lppl13c mit ofl publicDomain x11 ]; + scheme-full = [ artistic1-cl8 artistic2 asl20 bsd2 bsd3 bsdOriginal cc-by-10 cc-by-40 cc-by-sa-10 cc-by-sa-20 + cc-by-sa-30 cc-by-sa-40 cc0 fdl13Only free gfl gfsl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus isc knuth + lgpl2 lgpl21 lgpl3 lppl1 lppl12 lppl13a lppl13c mit ofl publicDomain x11 ]; + scheme-gust = [ artistic1-cl8 asl20 bsd2 bsd3 cc-by-40 cc-by-sa-40 cc0 fdl13Only free gfl gfsl gpl1Only gpl2 + gpl2Plus gpl3 gpl3Plus knuth lgpl2 lgpl21 lppl1 lppl12 lppl13a lppl13c mit ofl publicDomain x11 ]; + scheme-infraonly = [ gpl2 gpl2Plus lgpl21 ]; + scheme-medium = [ artistic1-cl8 asl20 bsd2 bsd3 cc-by-40 cc-by-sa-20 cc-by-sa-30 cc-by-sa-40 cc0 fdl13Only + free gfl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus isc knuth lgpl2 lgpl21 lgpl3 lppl1 lppl12 lppl13a lppl13c mit ofl + publicDomain x11 ]; + scheme-minimal = [ free gpl1Only gpl2 gpl2Plus knuth lgpl21 lppl1 lppl13c mit ofl publicDomain ]; + scheme-small = [ asl20 cc-by-40 cc-by-sa-40 cc0 fdl13Only free gfl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus knuth + lgpl2 lgpl21 lppl1 lppl12 lppl13a lppl13c mit ofl publicDomain x11 ]; + scheme-tetex = [ artistic1-cl8 asl20 bsd2 bsd3 cc-by-40 cc-by-sa-10 cc-by-sa-20 cc-by-sa-30 cc-by-sa-40 cc0 + fdl13Only free gfl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus isc knuth lgpl2 lgpl21 lgpl3 lppl1 lppl12 lppl13a + lppl13c mit ofl publicDomain x11]; + }; + in recurseIntoAttrs ( + mapAttrs + (pname: attrs: + addMetaAttrs rec { + description = "TeX Live environment for ${pname}"; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ veprbl ]; + license = licenses.${pname}; + } + (self.combine { + ${pname} = attrs; + extraName = "combined" + lib.removePrefix "scheme" pname; + extraVersion = with version; if final then "-final" else ".${year}${month}${day}"; + }) + ) + { inherit (self.pkgs) + scheme-basic scheme-context scheme-full scheme-gust scheme-infraonly + scheme-medium scheme-minimal scheme-small scheme-tetex; + } + ); }; - tl = lib.mapAttrs (pname: { revision, extraRevision ? "", ... }@args: - buildTeXLivePackage (args - # NOTE: the fixed naming scheme must match generate-fixed-hashes.nix - // { inherit mirrors pname; fixedHashes = fixedHashes."${pname}-${toString revision}${extraRevision}" or { }; } - // lib.optionalAttrs (args ? deps) { deps = map (n: tl.${n}) (args.deps or [ ]); }) - ) overriddenTlpdb; - - assertions = with lib; - assertMsg (tlpdbVersion.year == version.texliveYear) "TeX Live year in texlive does not match tlpdb.nix, refusing to evaluate" && - assertMsg (tlpdbVersion.frozen == version.final) "TeX Live final status in texlive does not match tlpdb.nix, refusing to evaluate"; - -in - tl // { - - tlpdb = { - # nested in an attribute set to prevent them from appearing in search - nix = tlpdbNix; - xz = tlpdbxz; + texlive = makeScopeWithSplicing' { + # We select the things we want in the splices explicitly to avoid infinite + # recursion that occurs when using then compat fixups that reinsert pkgs + # into the toplevel + # TODO: switch to generateSplicesForMkScope when the compat layer is removed + otherSplices = { + selfBuildBuild = { inherit (pkgsBuildBuild.texlive) bin pkgs combine combined; }; + selfBuildHost = { inherit (pkgsBuildHost.texlive) bin pkgs combine combined; }; + selfBuildTarget = { inherit (pkgsBuildTarget.texlive) bin pkgs combine combined; }; + selfHostHost = { inherit (pkgsHostHost.texlive) bin pkgs combine combined; }; + selfHostTarget = { inherit (pkgsHostTarget.texlive) bin pkgs combine combined; }; + selfTargetTarget = { }; }; + f = addPackages; + }; + + applyOverScope = f: scope: f (scope // { + overrideScope = g: applyOverScope f (scope.overrideScope g); + }); - bin = assert assertions; bin // { - # for backward compatibility - latexindent = lib.findFirst (p: p.tlType == "bin") tl.latexindent.pkgs; + # for backward compability + compatFixups = scope: + scope.pkgs // scope // { + bin = scope.bin // { + latexindent = lib.findFirst (p: p.tlType == "bin") scope.pkgs.latexindent.pkgs; + }; }; - combine = assert assertions; combine; - - # Pre-defined combined packages for TeX Live schemes, - # to make nix-env usage more comfortable and build selected on Hydra. - combined = with lib; - let - # these license lists should be the sorted union of the licenses of the packages the schemes contain. - # The correctness of this collation is tested by tests.texlive.licenses - licenses = with lib.licenses; { - scheme-basic = [ free gfl gpl1Only gpl2 gpl2Plus knuth lgpl21 lppl1 lppl13c mit ofl publicDomain ]; - scheme-context = [ bsd2 bsd3 cc-by-sa-40 free gfl gfsl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus knuth lgpl2 lgpl21 - lppl1 lppl13c mit ofl publicDomain x11 ]; - scheme-full = [ artistic1-cl8 artistic2 asl20 bsd2 bsd3 bsdOriginal cc-by-10 cc-by-40 cc-by-sa-10 cc-by-sa-20 - cc-by-sa-30 cc-by-sa-40 cc0 fdl13Only free gfl gfsl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus isc knuth - lgpl2 lgpl21 lgpl3 lppl1 lppl12 lppl13a lppl13c mit ofl publicDomain x11 ]; - scheme-gust = [ artistic1-cl8 asl20 bsd2 bsd3 cc-by-40 cc-by-sa-40 cc0 fdl13Only free gfl gfsl gpl1Only gpl2 - gpl2Plus gpl3 gpl3Plus knuth lgpl2 lgpl21 lppl1 lppl12 lppl13a lppl13c mit ofl publicDomain x11 ]; - scheme-infraonly = [ gpl2 gpl2Plus lgpl21 ]; - scheme-medium = [ artistic1-cl8 asl20 bsd2 bsd3 cc-by-40 cc-by-sa-20 cc-by-sa-30 cc-by-sa-40 cc0 fdl13Only - free gfl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus isc knuth lgpl2 lgpl21 lgpl3 lppl1 lppl12 lppl13a lppl13c mit ofl - publicDomain x11 ]; - scheme-minimal = [ free gpl1Only gpl2 gpl2Plus knuth lgpl21 lppl1 lppl13c mit ofl publicDomain ]; - scheme-small = [ asl20 cc-by-40 cc-by-sa-40 cc0 fdl13Only free gfl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus knuth - lgpl2 lgpl21 lppl1 lppl12 lppl13a lppl13c mit ofl publicDomain x11 ]; - scheme-tetex = [ artistic1-cl8 asl20 bsd2 bsd3 cc-by-40 cc-by-sa-10 cc-by-sa-20 cc-by-sa-30 cc-by-sa-40 cc0 - fdl13Only free gfl gpl1Only gpl2 gpl2Plus gpl3 gpl3Plus isc knuth lgpl2 lgpl21 lgpl3 lppl1 lppl12 lppl13a - lppl13c mit ofl publicDomain x11]; - }; - in recurseIntoAttrs ( - mapAttrs - (pname: attrs: - addMetaAttrs rec { - description = "TeX Live environment for ${pname}"; - platforms = lib.platforms.all; - maintainers = with lib.maintainers; [ veprbl ]; - license = licenses.${pname}; - } - (combine { - ${pname} = attrs; - extraName = "combined" + lib.removePrefix "scheme" pname; - extraVersion = with version; if final then "-final" else ".${year}${month}${day}"; - }) - ) - { inherit (tl) - scheme-basic scheme-context scheme-full scheme-gust scheme-infraonly - scheme-medium scheme-minimal scheme-small scheme-tetex; - } - ); - } +in applyOverScope compatFixups texlive diff --git a/pkgs/tools/typesetting/tex/texlive/stable.nix b/pkgs/tools/typesetting/tex/texlive/stable.nix new file mode 100644 index 0000000000000..1da841870d3d6 --- /dev/null +++ b/pkgs/tools/typesetting/tex/texlive/stable.nix @@ -0,0 +1,30 @@ +{ callPackage, lib, fetchurl, useFixedHashes ? true, fetchpatch }: +lib.makeOverridable callPackage ./. rec { + version = { + texliveYear = 2022; + final = true; + }; + + mirrors = with version; [ + # tlnet-final snapshot; used when texlive.tlpdb is frozen + # the TeX Live yearly freeze typically happens in mid-March + "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${toString texliveYear}/tlnet-final" + "ftp://tug.org/texlive/historic/${toString texliveYear}/tlnet-final" + # mostly just kept to prevent rebuilds :) + "https://texlive.info/tlnet-archive/2023/03/19/tlnet" + ]; + + src = with version; fetchurl { + urls = [ + "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${toString texliveYear}/texlive-${toString texliveYear}0321-source.tar.xz" + "ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${toString texliveYear}/texlive-${toString texliveYear}0321-source.tar.xz" + ]; + hash = "sha256-X/o0heUessRJBJZFD8abnXvXy55TNX2S20vNT9YXm1Y="; + }; + + tlpdb = import ./tlpdb.nix; + tlpdbxzHash = "sha256-vm7DmkH/h183pN+qt1p1wZ6peT2TcMk/ae0nCXsCoMw="; + + fixedHashes = lib.optionalAttrs useFixedHashes (import ./fixed-hashes.nix); + inherit useFixedHashes; +} diff --git a/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix b/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix index 4d2ce46ed4757..f687b7bd1d4cb 100644 --- a/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix +++ b/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix @@ -1,4 +1,4 @@ -{ lib, tlpdb, bin, tlpdbxz, tl +{ lib, tlpdb, bin, tlpdbxz, pkgs , installShellFiles , coreutils, findutils, gawk, getopt, ghostscript_headless, gnugrep , gnumake, gnupg, gnused, gzip, ncurses, perl, python3, ruby, zip @@ -134,7 +134,7 @@ in lib.recursiveUpdate orig rec { texlive-scripts.binlinks = { mktexfmt = "fmtutil"; - texhash = (lib.last tl."texlive.infra".pkgs) + "/bin/mktexlsr"; + texhash = (lib.last pkgs."texlive.infra".pkgs) + "/bin/mktexlsr"; }; texlive-scripts-extra.binlinks = { @@ -391,14 +391,14 @@ in lib.recursiveUpdate orig rec { license = [ "gpl2Plus" ] ++ lib.toList bin.core.meta.license.shortName ++ orig."texlive.infra".license or [ ]; scriptsFolder = "texlive"; - extraBuildInputs = [ coreutils gnused gnupg (lib.last tl.kpathsea.pkgs) (perl.withPackages (ps: with ps; [ Tk ])) ]; + extraBuildInputs = [ coreutils gnused gnupg (lib.last pkgs.kpathsea.pkgs) (perl.withPackages (ps: with ps; [ Tk ])) ]; # make tlmgr believe it can use kpsewhich to evaluate TEXMFROOT postFixup = '' substituteInPlace "$out"/bin/tlmgr \ --replace 'if (-r "$bindir/$kpsewhichname")' 'if (1)' sed -i '2i$ENV{PATH}='"'"'${lib.makeBinPath [ gnupg ]}'"'"' . ($ENV{PATH} ? ":$ENV{PATH}" : '"'''"');' "$out"/bin/tlmgr - sed -i '2iPATH="${lib.makeBinPath [ coreutils gnused (lib.last tl.kpathsea.pkgs) ]}''${PATH:+:$PATH}"' "$out"/bin/mktexlsr + sed -i '2iPATH="${lib.makeBinPath [ coreutils gnused (lib.last pkgs.kpathsea.pkgs) ]}''${PATH:+:$PATH}"' "$out"/bin/mktexlsr ''; # add minimal texlive.tlpdb diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index df11cbca064b4..95ffd203e7d98 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5373,7 +5373,12 @@ with pkgs; texFunctions = callPackage ../tools/typesetting/tex/nix pkgs; # TeX Live; see https://nixos.org/nixpkgs/manual/#sec-language-texlive - texlive = recurseIntoAttrs (callPackage ../tools/typesetting/tex/texlive { }); + texlive = recurseIntoAttrs + # callPackage is not used here in order not to override the override-attribute + # from makeOverridable in stable.nix + (import ../tools/typesetting/tex/texlive/stable.nix { + inherit (__splicedPackages) callPackage lib fetchurl fetchpatch; + }); fop = callPackage ../tools/typesetting/fop { jdk = openjdk8;