···34{ lib
5, fetchFromGitHub
06, runCommand
7, tectonic
8, curl
···26 };
27 testfiles = "${biber-dev-source}/testfiles";
2829- noNetNotice = builtins.toFile "tectonic-offline-notice" ''
30 # To fetch tectonic's web bundle, the tests require internet access,
31 # which is not available in the current environment.
32 '';
···83 # tectonic caches in the $HOME directory, so set it to $PWD
84 export HOME=$PWD
85 tectonic -X compile ./test.tex
0000086 '';
87}
···34{ lib
5, fetchFromGitHub
6+, writeText
7, runCommand
8, tectonic
9, curl
···27 };
28 testfiles = "${biber-dev-source}/testfiles";
2930+ noNetNotice = writeText "tectonic-offline-notice" ''
31 # To fetch tectonic's web bundle, the tests require internet access,
32 # which is not available in the current environment.
33 '';
···84 # tectonic caches in the $HOME directory, so set it to $PWD
85 export HOME=$PWD
86 tectonic -X compile ./test.tex
87+ '';
88+89+ workspace = ''
90+ tectonic -X new
91+ cat Tectonic.toml | grep "${tectonic.bundleUrl}"
92 '';
93}
+18-19
pkgs/tools/typesetting/tectonic/wrapper.nix
···1{ lib
2, symlinkJoin
03, tectonic-unwrapped
4, biber-for-tectonic
5-, makeWrapper
6, callPackage
7}:
8···10 name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}";
11 paths = [ tectonic-unwrapped ];
1213- nativeBuildInputs = [ makeWrapper ];
1415 passthru = {
16 unwrapped = tectonic-unwrapped;
17 biber = biber-for-tectonic;
18 tests = callPackage ./tests.nix { };
000000019 };
2021 # Replace the unwrapped tectonic with the one wrapping it with biber
22 postBuild = ''
23 rm $out/bin/{tectonic,nextonic}
24 ''
25- # Ideally, we would have liked to also pin the version of the online TeX
26- # bundle that Tectonic's developer distribute, so that the `biber` version
27- # and the `biblatex` version distributed from there are compatible.
28- # However, that is not currently possible, due to lack of upstream support
29- # for specifying this in runtime, there were 2 suggestions sent upstream
30- # that suggested a way of improving the situation:
31 #
32- # - https://github.com/tectonic-typesetting/tectonic/pull/1132
33- # - https://github.com/tectonic-typesetting/tectonic/pull/1131
34- #
35- # The 1st suggestion seems more promising as it'd allow us to simply use
36- # makeWrapper's --add-flags option. However, the PR linked above is not
37- # complete, and as of currently, upstream hasn't even reviewed it, or
38- # commented on the idea.
39- #
40- # Note also that upstream has announced that they will put less time and
41- # energy for the project:
42 #
43 # https://github.com/tectonic-typesetting/tectonic/discussions/1122
44 #
···47 # won't require a higher version of biber.
48 + ''
49 makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \
50- --prefix PATH : "${lib.getBin biber-for-tectonic}/bin"
051 ln -s $out/bin/tectonic $out/bin/nextonic
52 '';
53
···1{ lib
2, symlinkJoin
3+, tectonic
4, tectonic-unwrapped
5, biber-for-tectonic
6+, makeBinaryWrapper
7, callPackage
8}:
9···11 name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}";
12 paths = [ tectonic-unwrapped ];
1314+ nativeBuildInputs = [ makeBinaryWrapper ];
1516 passthru = {
17 unwrapped = tectonic-unwrapped;
18 biber = biber-for-tectonic;
19 tests = callPackage ./tests.nix { };
20+21+ # The version locked tectonic web bundle, redirected from:
22+ # https://relay.fullyjustified.net/default_bundle_v33.tar
23+ # To check for updates, see:
24+ # https://github.com/tectonic-typesetting/tectonic/blob/master/crates/bundles/src/lib.rs
25+ # ... and look up `get_fallback_bundle_url`.
26+ bundleUrl = "https://data1.fullyjustified.net/tlextras-2022.0r0.tar";
27 };
2829 # Replace the unwrapped tectonic with the one wrapping it with biber
30 postBuild = ''
31 rm $out/bin/{tectonic,nextonic}
32 ''
33+ # Pin the version of the online TeX bundle that Tectonic's developer
34+ # distribute, so that the `biber` version and the `biblatex` version
35+ # distributed from there are compatible.
00036 #
37+ # Upstream is updating it's online TeX bundle slower then
38+ # https://github.com/plk/biber. That's why we match here the `bundleURL`
39+ # version with that of `biber-for-tectonic`. See also upstream discussion:
000000040 #
41 # https://github.com/tectonic-typesetting/tectonic/discussions/1122
42 #
···45 # won't require a higher version of biber.
46 + ''
47 makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \
48+ --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \
49+ --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}"
50 ln -s $out/bin/tectonic $out/bin/nextonic
51 '';
52