Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkgs/tools/typesetting/tex/texlive/bin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ core-big = stdenv.mkDerivation { #TODO: upmendex

inherit (common) src prePatch;

patches = [
# improves reproducibility of fmt files. This patch has been proposed upstream,
# but they are considering some other approaches as well. This is fairly
# conservative so we can safely apply it until they make a decision
# https://mailman.ntg.nl/pipermail/dev-luatex/2022-April/006650.html
(fetchpatch {
name = "reproducible_exception_strings.patch";
url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1009196;filename=reproducible_exception_strings.patch;msg=5";
sha256 = "sha256-RNZoEeTcWnrLaltcYrhNIORh42fFdwMzBfxMRWVurbk=";
})
];

hardeningDisable = [ "format" ];

inherit (core) nativeBuildInputs;
Expand Down
17 changes: 16 additions & 1 deletion pkgs/tools/typesetting/tex/texlive/combine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ in (buildEnv {
"/tex/generic/config" # make it a real directory for scheme-infraonly
];

nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper libfaketime ];
buildInputs = pkgList.extraInputs;

# This is set primarily to help find-tarballs.nix to do its job
Expand Down Expand Up @@ -228,6 +228,21 @@ in (buildEnv {
FORCE_SOURCE_DATE=1 perl `type -P fmtutil.pl` --sys --all | grep '^fmtutil' # too verbose
#${bin.texlinks}/bin/texlinks "$out/bin" && wrapBin # do we need to regenerate format links?

# tex intentionally ignores SOURCE_DATE_EPOCH even when FORCE_SOURCE_DATE=1
# https://salsa.debian.org/live-team/live-build/-/blob/master/examples/hooks/reproducible/0139-reproducible-texlive-binaries-fmt-files.hook.chroot#L52
if [[ -d share/texmf-var/web2c/tex ]]
then
cd share/texmf-var/web2c/tex
faketime $(date --utc -d@$SOURCE_DATE_EPOCH --iso-8601=seconds) tex -ini -jobname=tex -progname=tex tex.ini
cd -
fi
if [[ -d share/texmf-var/web2c/luahbtex ]]
then
cd share/texmf-var/web2c/luahbtex
faketime $(date --utc -d@$SOURCE_DATE_EPOCH --iso-8601=seconds) luahbtex -ini -jobname=lualatex -progname=lualatex lualatex.ini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your link does not mention luahbtex, and the engines are supposed to be completely different. I assume you found an additional issue with it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, though I didn't manage to investigate it sufficiently to write up a useful upstream report yet.

cd -
fi

# Disable unavailable map files
echo y | perl `type -P updmap.pl` --sys --syncwithtrees --force
# Regenerate the map files (this is optional)
Expand Down
3 changes: 2 additions & 1 deletion pkgs/tools/typesetting/tex/texlive/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv
, callPackage, ghostscriptX, harfbuzz
, makeWrapper, python3, ruby, perl, gnused, gnugrep, coreutils
, libfaketime
, useFixedHashes ? true
, recurseIntoAttrs
}:
Expand All @@ -23,7 +24,7 @@ let
# function for creating a working environment from a set of TL packages
combine = import ./combine.nix {
inherit bin combinePkgs buildEnv lib makeWrapper writeText
stdenv python3 ruby perl gnused gnugrep coreutils;
stdenv python3 ruby perl gnused gnugrep coreutils libfaketime;
ghostscript = ghostscriptX; # could be without X, probably, but we use X above
};

Expand Down