···235 ln -sf fmtutil "$out/bin/mktexfmt"
236237 texlinks "$out/bin" && wrapBin
238- FORCE_SOURCE_DATE=1 fmtutil --sys --all | grep '^fmtutil' # too verbose
239- #texlinks "$out/bin" && wrapBin # do we need to regenerate format links?
240241- # tex intentionally ignores SOURCE_DATE_EPOCH even when FORCE_SOURCE_DATE=1
242- # https://salsa.debian.org/live-team/live-build/-/blob/master/examples/hooks/reproducible/0139-reproducible-texlive-binaries-fmt-files.hook.chroot#L52
243- if [[ -f "$TEXMFSYSVAR"/web2c/tex/tex.fmt ]]
244- then
245- faketime $(date --utc -d@$SOURCE_DATE_EPOCH --iso-8601=seconds) tex -output-directory "$TEXMFSYSVAR"/web2c/tex -ini -jobname=tex -progname=tex tex.ini
246- fi
247- if [[ -f "$TEXMFSYSVAR"/web2c/luahbtex/lualatex.fmt ]]
248- then
249- faketime $(date --utc -d@$SOURCE_DATE_EPOCH --iso-8601=seconds) luahbtex --output-directory="$TEXMFSYSVAR"/web2c/luahbtex -ini -jobname=lualatex -progname=lualatex lualatex.ini
250- fi
251252 # Disable unavailable map files
253 echo y | updmap --sys --syncwithtrees --force
···298299 # MkIV uses its own lookup mechanism and we need to initialize
300 # caches for it.
00301 ''
302 if [[ -e "$out/bin/mtxrun" ]]; then
303- mtxrun --generate
000304 fi
305 ''
306 + bin.cleanBrokenLinks +
307 # Get rid of all log files. They are not needed, but take up space
308- # and render the build unreproducible by their embedded timestamps.
0309 ''
310 find "$TEXMFSYSVAR"/web2c -name '*.log' -delete
311 ''
···235 ln -sf fmtutil "$out/bin/mktexfmt"
236237 texlinks "$out/bin" && wrapBin
00238239+ # many formats still ignore SOURCE_DATE_EPOCH even when FORCE_SOURCE_DATE=1
240+ # libfaketime fixes non-determinism related to timestamps ignoring FORCE_SOURCE_DATE
241+ # we cannot fix further randomness caused by luatex; for further details, see
242+ # https://salsa.debian.org/live-team/live-build/-/blob/master/examples/hooks/reproducible/2006-reproducible-texlive-binaries-fmt-files.hook.chroot#L52
243+ FORCE_SOURCE_DATE=1 TZ= faketime -f '@1980-01-01 00:00:00 x0.001' fmtutil --sys --all | grep '^fmtutil' # too verbose
244+ #texlinks "$out/bin" && wrapBin # do we need to regenerate format links?
0000245246 # Disable unavailable map files
247 echo y | updmap --sys --syncwithtrees --force
···292293 # MkIV uses its own lookup mechanism and we need to initialize
294 # caches for it.
295+ # We use faketime to fix the embedded timestamps and patch the uuids
296+ # with some random but constant values.
297 ''
298 if [[ -e "$out/bin/mtxrun" ]]; then
299+ substitute "$TEXMFDIST"/scripts/context/lua/mtxrun.lua mtxrun.lua \
300+ --replace 'cache_uuid=osuuid()' 'cache_uuid="e2402e51-133d-4c73-a278-006ea4ed734f"' \
301+ --replace 'uuid=osuuid(),' 'uuid="242be807-d17e-4792-8e39-aa93326fc871",'
302+ FORCE_SOURCE_DATE=1 TZ= faketime -f '@1980-01-01 00:00:00 x0.001' luatex --luaonly mtxrun.lua --generate
303 fi
304 ''
305 + bin.cleanBrokenLinks +
306 # Get rid of all log files. They are not needed, but take up space
307+ # and render the build unreproducible by their embedded timestamps
308+ # and other non-deterministic diagnostics.
309 ''
310 find "$TEXMFSYSVAR"/web2c -name '*.log' -delete
311 ''
···216 # As the name says, this is broken, but I don't want to lose it since it's a direction we want to go in
217 # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { };
218219- darling = callPackage ../os-specific/darwin/darling/default.nix { };
220-221 libtapi = callPackage ../os-specific/darwin/libtapi {};
222223 ios-deploy = callPackage ../os-specific/darwin/ios-deploy {};
···216 # As the name says, this is broken, but I don't want to lose it since it's a direction we want to go in
217 # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { };
21800219 libtapi = callPackage ../os-specific/darwin/libtapi {};
220221 ios-deploy = callPackage ../os-specific/darwin/ios-deploy {};