|
94 | 94 | meta.description = "texlive scheme-small + standalone/tikz-cd/xy combo for forester"; |
95 | 95 | }; |
96 | 96 |
|
| 97 | + # Build tectonic from master @ 2025-10-06 (which supports the .ttb |
| 98 | + # bundle format from doronbehar's nix overlay in tectonic#1269 comment |
| 99 | + # 3551606513). nixpkgs's tectonic 0.16.9 is too old for the TL2024 |
| 100 | + # bundle; we need post-2025-10-06. |
| 101 | + tectonicUnstableFor = pkgs: pkgs.tectonic-unwrapped.overrideAttrs (final: prev: { |
| 102 | + version = "0.15.0-unstable-2025-10-06"; |
| 103 | + src = pkgs.fetchFromGitHub { |
| 104 | + owner = "tectonic-typesetting"; |
| 105 | + repo = "tectonic"; |
| 106 | + rev = "d7f3275adf6b501fc21122a1873912e970bf52ba"; |
| 107 | + hash = "sha256-4p5ZU1O75xcE4pDUs1xwZkFkxJ+g3Rm9LL5Cog96Sm8="; |
| 108 | + }; |
| 109 | + patches = []; |
| 110 | + cargoPatches = []; |
| 111 | + cargoDeps = pkgs.rustPlatform.fetchCargoVendor { |
| 112 | + inherit (final) src; |
| 113 | + hash = "sha256-J3q0dtQ/qb/72b6A40TNYDIZvDrUSpxF3SFjhc+X0fw="; |
| 114 | + }; |
| 115 | + # Skip the sandbox-incompatible segfault test. |
| 116 | + checkFlags = (prev.checkFlags or []) ++ [ |
| 117 | + "--skip=tests::no_segfault_after_failed_compilation" |
| 118 | + ]; |
| 119 | + }); |
| 120 | + |
| 121 | + tectonicBundleUrl = "https://bebopbamf-tex.syd1.cdn.digitaloceanspaces.com/texlive2024-0312.ttb"; |
| 122 | + |
97 | 123 | forestTectonicFor = pkgs: pkgs.stdenv.mkDerivation { |
98 | 124 | pname = "forest-tectonic"; |
99 | 125 | # Includes dvisvgm now too — nixery rejects the standalone dvisvgm |
100 | 126 | # pkg name; shipping it alongside tectonic in the same NAR avoids |
101 | 127 | # the manifest miss. |
102 | | - version = "${tectonicVersion}+dvisvgm"; |
| 128 | + version = "${tectonicVersion}+dvisvgm+ttb2024"; |
103 | 129 |
|
104 | | - # No source — we build off the nixpkgs tectonic binary plus a tiny |
| 130 | + # No source — we build off the master tectonic plus a tiny |
105 | 131 | # warmup .tex file that pulls every package the real forest build |
106 | 132 | # is expected to need. |
107 | 133 | dontUnpack = true; |
108 | 134 | dontConfigure = true; |
109 | 135 |
|
110 | | - nativeBuildInputs = [ pkgs.tectonic pkgs.cacert pkgs.texlive.bin.dvisvgm ]; |
| 136 | + nativeBuildInputs = [ (tectonicUnstableFor pkgs) pkgs.cacert pkgs.texlive.bin.dvisvgm ]; |
111 | 137 |
|
112 | 138 | buildPhase = '' |
113 | 139 | runHook preBuild |
114 | 140 | export HOME=$TMPDIR |
115 | 141 | export TECTONIC_CACHE_DIR=$HOME/.cache/Tectonic |
116 | 142 | mkdir -p "$TECTONIC_CACHE_DIR" |
117 | | - # Warmup: a representative doc that loads the heavy packages forest |
118 | | - # uses. Iterate this — add \usepackage{...} lines as the forest LaTeX |
119 | | - # surfaces missing packages on the first real run. |
| 143 | + # Warmup: representative doc that loads the heavy packages forest |
| 144 | + # uses. Add \usepackage{...} lines as forest LaTeX surfaces more. |
120 | 145 | cat > warmup.tex <<'WARMUP' |
121 | 146 | \documentclass[a4paper]{article} |
122 | 147 | \usepackage{amsmath, amssymb, amsthm} |
|
128 | 153 | Hello world. |
129 | 154 | \end{document} |
130 | 155 | WARMUP |
131 | | - # tectonic's default bundle works; we don't pin --bundle because |
132 | | - # the v2 URL returns 404 and the current default (v33) redirects |
133 | | - # to the TL2022 tlextras anyway. For forest, render.yml fetches |
134 | | - # the newer pseudo.sty from CTAN at runtime and stages it into |
135 | | - # the latex shim's cwd to override TL2022's stale version. |
136 | | - tectonic --outdir . warmup.tex || true |
| 156 | + # Pin to the BebopBamf TL2024 .ttb bundle (tectonic#1269 community |
| 157 | + # workaround — official bundles stopped at TL2022). Newer |
| 158 | + # pseudo.sty in TL2024 auto-registers /tcb/pseudo/* keys forest |
| 159 | + # expects, so the runtime CTAN override becomes redundant. |
| 160 | + tectonic --bundle ${tectonicBundleUrl} --outdir . warmup.tex || true |
137 | 161 | ls -la "$TECTONIC_CACHE_DIR" || true |
138 | 162 | runHook postBuild |
139 | 163 | ''; |
140 | 164 |
|
141 | 165 | installPhase = '' |
142 | 166 | runHook preInstall |
143 | 167 | mkdir -p $out/bin $out/share |
144 | | - ln -s ${pkgs.tectonic}/bin/tectonic $out/bin/tectonic |
| 168 | + ln -s ${tectonicUnstableFor pkgs}/bin/tectonic $out/bin/tectonic |
145 | 169 | # dvisvgm comes from texlive.bin.dvisvgm in this nixpkgs (top-level |
146 | 170 | # pkgs.dvisvgm is absent; texlive.bin.core doesn't include it). |
147 | 171 | # Fail loud if the path doesn't exist so we don't ship a broken NAR. |
|
0 commit comments