push sheeet
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
{
lib,
symlinkJoin,
tectonic,
tectonic-unwrapped,
biber-for-tectonic,
makeBinaryWrapper,
callPackage,
}:
symlinkJoin {
name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}";
paths = [ tectonic-unwrapped ];
nativeBuildInputs = [ makeBinaryWrapper ];
passthru = {
unwrapped = tectonic-unwrapped;
biber = biber-for-tectonic;
tests = callPackage ./tests.nix { };
# The version locked tectonic web bundle, redirected from:
# https://relay.fullyjustified.net/default_bundle_v33.tar
# To check for updates, see:
# https://github.com/tectonic-typesetting/tectonic/blob/master/crates/bundles/src/lib.rs
# ... and look up `get_fallback_bundle_url`.
bundleUrl = "https://data1.fullyjustified.net/tlextras-2022.0r0.tar";
};
# Replace the unwrapped tectonic with the one wrapping it with biber
postBuild = ''
rm $out/bin/{tectonic,nextonic}
''
# Pin the version of the online TeX bundle that Tectonic's developer
# distribute, so that the `biber` version and the `biblatex` version
# distributed from there are compatible.
#
# Upstream is updating it's online TeX bundle slower then
# https://github.com/plk/biber. That's why we match here the `bundleURL`
# version with that of `biber-for-tectonic`. See also upstream discussion:
#
# https://github.com/tectonic-typesetting/tectonic/discussions/1122
#
# Hence, we can be rather confident that for the near future, the online
# TeX bundle won't be updated and hence the biblatex distributed there
# won't require a higher version of biber.
+ ''
makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \
--prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \
--add-flags "--web-bundle ${tectonic.passthru.bundleUrl}" \
--inherit-argv0 ## make sure binary name e.g. `nextonic` is passed along
ln -s $out/bin/tectonic $out/bin/nextonic
'';
meta = tectonic-unwrapped.meta // {
description = "TeX/LaTeX engine, wrapped with a compatible biber";
maintainers = with lib.maintainers; [
doronbehar
bryango
];
};
}
+107
View File
@@ -0,0 +1,107 @@
# This package provides `tectonic.passthru.tests`.
# It requires internet access to fetch tectonic's resource bundle on demand.
{
lib,
fetchFromGitHub,
writeText,
runCommand,
tectonic,
curl,
cacert,
emptyFile,
}:
let
/*
Currently, the test files are only fully available from the `dev` branch of
`biber`. When https://github.com/plk/biber/pull/467 is eventually released,
we can obtain the test files from `texlive.pkgs.biber.texsource`. For now,
i.e. biber<=2.19, we fetch the test files directly from GitHub.
*/
biber-dev-source = fetchFromGitHub {
owner = "plk";
repo = "biber";
# curl https://api.github.com/repos/plk/biber/pulls/467 | jq .merge_commit_sha
rev = "d43e352586f5c9f98f0331978ca9d0b908986e09";
hash = "sha256-Z5BdMteBouiDQasF6GZXkS//YzrZkcX1eLvKIQIBkBs=";
};
testfiles = "${biber-dev-source}/testfiles";
noNetNotice = writeText "tectonic-offline-notice" ''
# To fetch tectonic's web bundle, the tests require internet access,
# which is not available in the current environment.
'';
# `cacert` is required for tls connections
nativeBuildInputs = [
curl
cacert
tectonic
];
checkInternet = ''
if curl --head "bing.com"; then
set -e # continue to the tests defined below, fail on error
else
cat "${noNetNotice}"
cp "${emptyFile}" "$out"
exit # bail out gracefully when there is no internet, do not panic
fi
'';
networkRequiringTestPkg =
name: script:
runCommand
/*
Introduce dependence on `tectonic` in the test package name. Note that
adding `tectonic` to `nativeBuildInputs` is not enough to trigger
rebuilds for a fixed-output derivation. One must update its name or
output hash to induce a rebuild. This behavior is exactly the same as a
standard nixpkgs "fetcher" such as `fetchurl`.
*/
"test-${lib.removePrefix "${builtins.storeDir}/" tectonic.outPath}-${name}"
{
/*
Make a fixed-output derivation, return an `emptyFile` with fixed hash.
These derivations are allowed to access the internet from within a
sandbox, which allows us to test the automatic download of resource
files in tectonic, as a side effect. The `tectonic.outPath` is included
in `name` to induce rebuild of this fixed-output derivation whenever
the `tectonic` derivation is updated.
*/
inherit (emptyFile)
outputHashMode
outputHash
;
allowSubstitutes = false;
inherit nativeBuildInputs;
}
''
${checkInternet}
${script}
cp "${emptyFile}" "$out"
'';
in
lib.mapAttrs networkRequiringTestPkg {
biber-compatibility = ''
# import the test files
cp "${testfiles}"/* .
# tectonic caches in the $HOME directory, so set it to $PWD
export HOME=$PWD
tectonic -X compile ./test.tex
'';
workspace = ''
tectonic -X new
cat Tectonic.toml | grep "${tectonic.bundleUrl}"
'';
/**
test that the `nextonic -> tectonic` symlink is working as intended
*/
nextonic = ''
nextonic new 2>&1 \
| grep '"version 2" Tectonic command-line interface activated'
'';
}