mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
Merge pull request #296453 from xworld21/texlive-2023-final
texlive: 2023.20240114 -> 2023-final
This commit is contained in:
commit
08843b8113
@ -1,6 +1,6 @@
|
||||
{ lib, stdenv, fetchFromGitHub
|
||||
, autoreconfHook, bison, glm, flex, wrapQtAppsHook, cmake
|
||||
, freeglut, ghostscriptX, imagemagick, fftw
|
||||
{ lib, stdenv, fetchurl, fetchpatch
|
||||
, autoreconfHook, bison, glm, flex, wrapQtAppsHook, cmake, pkg-config
|
||||
, freeglut, ghostscriptX, imagemagick, fftw, eigen, libtirpc
|
||||
, boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv
|
||||
, python3, qtbase, qtsvg, boost
|
||||
, zlib, perl, curl
|
||||
@ -9,16 +9,25 @@
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.87";
|
||||
version = "2.88";
|
||||
pname = "asymptote";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vectorgraphics";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-xzRZ7NOWeu+uC5WeTxwh5MFm7psXMhxrxucT4PVtRxM=";
|
||||
outputs = [ "out" "man" "info" "doc" "tex" ];
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/asymptote/${version}/asymptote-${version}.src.tgz";
|
||||
hash = "sha256-DecadD+m7pORuH3Sdcs/5M3vUbN6rhSkFoNN0Soq9bs=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
# partial fix for macOS XDR/V3D support (LDFLAGS change seems like an unrelated bugfix)
|
||||
name = "restore-LDFLAGS-dont-look-for-tirpc-under-MacOS.patch";
|
||||
url = "https://github.com/vectorgraphics/asymptote/commit/7e17096b22d18d133d1bc5916b6e32c0cb24ad10.patch";
|
||||
hash = "sha256-olCFzqfZwWOAjqlB5lDPXYRHU9i3VQNgoR0cO5TmW98=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
bison
|
||||
@ -27,15 +36,16 @@ stdenv.mkDerivation rec {
|
||||
texinfo
|
||||
wrapQtAppsHook
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
ghostscriptX imagemagick fftw
|
||||
ghostscriptX imagemagick fftw eigen
|
||||
boehmgc ncurses readline gsl libsigsegv
|
||||
zlib perl curl qtbase qtsvg boost
|
||||
(texliveSmall.withPackages (ps: with ps; [ epsf cm-super ps.texinfo media9 ocgx2 collection-latexextra ]))
|
||||
(python3.withPackages (ps: with ps; [ cson numpy pyqt5 ]))
|
||||
];
|
||||
] ++ lib.optionals stdenv.isLinux [ libtirpc ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
glm
|
||||
@ -47,14 +57,18 @@ stdenv.mkDerivation rec {
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
||||
# Do not build $tex/ls-R which will be generated by texlive.combine
|
||||
preConfigure = ''
|
||||
HOME=$TMP
|
||||
substituteInPlace Makefile.in \
|
||||
--replace-fail 'install: install-notexhash install-texhash' 'install: install-notexhash install-asy'
|
||||
prependToVar configureFlags "--with-latex=$tex/tex/latex" "--with-context=$tex/tex/context/third"
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-latex=$out/share/texmf/tex/latex"
|
||||
"--with-context=$out/share/texmf/tex/context/third"
|
||||
];
|
||||
# do not use bundled libgc.so
|
||||
configureFlags = [ "--enable-gc=system" ]
|
||||
# TODO add open_memstream to enable XDR/V3D on Darwin (requires memstream or >=10.13 Apple SDK)
|
||||
++ lib.optional stdenv.isDarwin "--enable-xdr=no";
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc";
|
||||
|
||||
@ -62,12 +76,11 @@ stdenv.mkDerivation rec {
|
||||
rm "$out"/bin/xasy
|
||||
makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin
|
||||
|
||||
mv $out/share/info/asymptote/*.info $out/share/info/
|
||||
sed -i -e 's|(asymptote/asymptote)|(asymptote)|' $out/share/info/asymptote.info
|
||||
rmdir $out/share/info/asymptote
|
||||
rm -f $out/share/info/dir
|
||||
mv "$info"/share/info/asymptote/*.info "$info"/share/info/
|
||||
sed -i -e 's|(asymptote/asymptote)|(asymptote)|' "$info"/share/info/asymptote.info
|
||||
rmdir "$info"/share/info/asymptote
|
||||
rm -f "$info"/share/info/dir
|
||||
|
||||
rm -rf $out/share/texmf
|
||||
install -Dt $out/share/emacs/site-lisp/${pname} $out/share/asymptote/*.el
|
||||
'';
|
||||
|
||||
|
@ -308,11 +308,11 @@ chktex = stdenv.mkDerivation {
|
||||
# for details see https://wiki.contextgarden.net/Building_LuaMetaTeX_for_TeX_Live
|
||||
context = stdenv.mkDerivation rec {
|
||||
pname = "luametatex";
|
||||
version = "2.10.08";
|
||||
version = "2.11.02";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://tug.org/svn/texlive/trunk/Master/source/luametatex-${version}.tar.xz?revision=67034&view=co";
|
||||
hash = "sha256-3JeOUQ63jJOZWTxFCoyWjfcrspmdmC/yqgS1JaLfTWk=";
|
||||
url = "https://tug.org/svn/texlive/trunk/Master/source/luametatex-${version}.tar.xz?revision=70616&view=co";
|
||||
hash = "sha256-o7esoBBTTYEstkd7l34BWxew3fIRdVcFiGxrT1/KP1o=";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
@ -328,11 +328,11 @@ context = stdenv.mkDerivation rec {
|
||||
|
||||
dvisvgm = stdenv.mkDerivation rec {
|
||||
pname = "dvisvgm";
|
||||
version = "3.1.2";
|
||||
version = "3.2.2";
|
||||
|
||||
src = assert lib.assertMsg (version == texlive.pkgs.dvisvgm.version) "dvisvgm: TeX Live version (${texlive.pkgs.dvisvgm.version}) different from source (${version}), please update dvisvgm"; fetchurl {
|
||||
url = "https://github.com/mgieseki/dvisvgm/releases/download/${version}/dvisvgm-${version}.tar.gz";
|
||||
hash = "sha256-vqeDrf6TG3eUoMMNeQK4Kw1NmtaBbc2KCVqTHNM+rPY=";
|
||||
hash = "sha256-8GKL6lqjMUXXWwpqbdGPrYibdSc4y8AcGUGPNUc6HQA=";
|
||||
};
|
||||
|
||||
configureFlags = [
|
||||
@ -453,7 +453,7 @@ xdvi = stdenv.mkDerivation {
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace "$out/bin/xdvi" \
|
||||
--replace "exec xdvi-xaw" "exec '$out/bin/xdvi-xaw'"
|
||||
--replace-fail "exec xdvi-xaw" "exec '$out/bin/xdvi-xaw'"
|
||||
'';
|
||||
# TODO: it's suspicious that mktexpk generates fonts into ~/.texlive2014
|
||||
};
|
||||
@ -489,7 +489,7 @@ xindy = stdenv.mkDerivation {
|
||||
# hardcode clisp location
|
||||
postPatch = ''
|
||||
substituteInPlace xindy-*/user-commands/xindy.in \
|
||||
--replace "our \$clisp = ( \$is_windows ? 'clisp.exe' : 'clisp' ) ;" \
|
||||
--replace-fail "our \$clisp = ( \$is_windows ? 'clisp.exe' : 'clisp' ) ;" \
|
||||
"our \$clisp = '$(type -P clisp)';"
|
||||
'';
|
||||
|
||||
|
@ -378,7 +378,7 @@ let
|
||||
if [[ -e "$out/bin/mtxrun" ]]; then
|
||||
mv "$out"/bin/mtxrun.lua{,.orig}
|
||||
substitute "$TEXMFDIST"/scripts/context/lua/mtxrun.lua "$out"/bin/mtxrun.lua \
|
||||
--replace 'randomseed(math.initialseed)' "randomseed($SOURCE_DATE_EPOCH)"
|
||||
--replace-fail 'randomseed(math.initialseed)' "randomseed($SOURCE_DATE_EPOCH)"
|
||||
fi
|
||||
'' +
|
||||
# texlive postactions (see TeXLive::TLUtils::_do_postaction_script)
|
||||
@ -409,7 +409,7 @@ let
|
||||
# note that calling faketime and fmtutil is fragile (faketime uses LD_PRELOAD, fmtutil calls /bin/sh, causing potential glibc issues on non-NixOS)
|
||||
# so we patch fmtutil to use faketime, rather than calling faketime fmtutil
|
||||
substitute "$TEXMFDIST"/scripts/texlive/fmtutil.pl fmtutil \
|
||||
--replace 'my $cmdline = "$eng -ini ' 'my $cmdline = "faketime -f '"'"'\@1980-01-01 00:00:00 x0.001'"'"' $eng -ini '
|
||||
--replace-fail 'my $cmdline = "$eng -ini ' 'my $cmdline = "faketime -f '"'"'\@1980-01-01 00:00:00 x0.001'"'"' $eng -ini '
|
||||
FORCE_SOURCE_DATE=1 TZ= perl fmtutil --sys --all | grep '^fmtutil' # too verbose
|
||||
|
||||
# Disable unavailable map files
|
||||
|
@ -44,12 +44,12 @@ let
|
||||
version = {
|
||||
# day of the snapshot being taken
|
||||
year = "2024";
|
||||
month = "01";
|
||||
day = "14";
|
||||
month = "03";
|
||||
day = "16";
|
||||
# TeX Live version
|
||||
texliveYear = 2023;
|
||||
# final (historic) release or snapshot
|
||||
final = false;
|
||||
final = true;
|
||||
};
|
||||
|
||||
# The tarballs on CTAN mirrors for the current release are constantly
|
||||
@ -79,7 +79,7 @@ let
|
||||
# use last mirror for daily snapshots as texlive.tlpdb.xz changes every day
|
||||
# TODO make this less hacky
|
||||
(if version.final then mirrors else [ (lib.last mirrors) ]);
|
||||
hash = "sha256-eUG0KVfFPkjOczCsu2GAPRQcvcPrEIGqIsJNRc+AHDs=";
|
||||
hash = "sha256-w+04GBFDk/P/XvW7T9PotGD0nQslMkV9codca2urNK4=";
|
||||
};
|
||||
|
||||
tlpdbNix = runCommand "tlpdb.nix" {
|
||||
|
File diff suppressed because it is too large
Load Diff
91
pkgs/tools/typesetting/tex/texlive/mtxrun-local-vars.patch
Normal file
91
pkgs/tools/typesetting/tex/texlive/mtxrun-local-vars.patch
Normal file
@ -0,0 +1,91 @@
|
||||
--- a/scripts/context/lua/mtxrun.lua 1970-01-01 01:00:01
|
||||
+++ b/cont-lmt/scripts/context/lua/mtxrun.lua 2024-03-11 08:34:49
|
||||
@@ -2435,19 +2433,22 @@
|
||||
tables[t]=tcopy
|
||||
end
|
||||
for i,v in next,t do
|
||||
+ local k
|
||||
if type(i)=="table" then
|
||||
if tables[i] then
|
||||
- i=tables[i]
|
||||
+ k=tables[i]
|
||||
else
|
||||
- i=copy(i,tables)
|
||||
+ k=copy(i,tables)
|
||||
end
|
||||
+ else
|
||||
+ k=i
|
||||
end
|
||||
if type(v)~="table" then
|
||||
- tcopy[i]=v
|
||||
+ tcopy[k]=v
|
||||
elseif tables[v] then
|
||||
- tcopy[i]=tables[v]
|
||||
+ tcopy[k]=tables[v]
|
||||
else
|
||||
- tcopy[i]=copy(v,tables)
|
||||
+ tcopy[k]=copy(v,tables)
|
||||
end
|
||||
end
|
||||
local mt=getmetatable(t)
|
||||
@@ -12982,10 +13037,10 @@
|
||||
else
|
||||
value=is_boolean(value,value,true)
|
||||
end
|
||||
- w=topattern(w,true,true)
|
||||
+ local p=topattern(w,true,true)
|
||||
for name,functions in sortedhash(data) do
|
||||
if done[name] then
|
||||
- elseif find(name,w) then
|
||||
+ elseif find(name,p) then
|
||||
done[name]=true
|
||||
for i=1,#functions do
|
||||
functions[i](value)
|
||||
@@ -13554,9 +13610,9 @@
|
||||
if v then
|
||||
v.state=value
|
||||
else
|
||||
- c=topattern(c,true,true)
|
||||
+ local p=topattern(c,true,true)
|
||||
for k,v in next,data do
|
||||
- if find(k,c) then
|
||||
+ if find(k,p) then
|
||||
v.state=value
|
||||
end
|
||||
end
|
||||
@@ -14499,10 +14556,7 @@
|
||||
realtime=realtime+real
|
||||
end
|
||||
totaltime=totaltime+total
|
||||
- if line<0 then
|
||||
- line=0
|
||||
- end
|
||||
- dataset[#dataset+1]={ real,total,count,name,source,line }
|
||||
+ dataset[#dataset+1]={ real,total,count,name,source,line<0 and 0 or line }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -21135,10 +21251,10 @@
|
||||
str=lpegmatch(stripper_1,str)
|
||||
if validate then
|
||||
for s in gmatch(str,"[^,]+") do
|
||||
- s=validate(s)
|
||||
- if s then
|
||||
+ local v=validate(s)
|
||||
+ if v then
|
||||
n=n+1
|
||||
- t[n]=s
|
||||
+ t[n]=v
|
||||
end
|
||||
end
|
||||
else
|
||||
@@ -23552,7 +23690,8 @@
|
||||
local result={}
|
||||
local status={}
|
||||
local done={}
|
||||
- for k,r in next,results do
|
||||
+ for k=1,#results do
|
||||
+ local r=results[k]
|
||||
local method,list=r[1],r[2]
|
||||
if method and list then
|
||||
for i=1,#list do
|
@ -291,11 +291,6 @@ in lib.recursiveUpdate orig rec {
|
||||
'';
|
||||
|
||||
#### other script fixes
|
||||
# wrong $0 expectations
|
||||
bibcop.postFixup = ''
|
||||
substituteInPlace "$out"/bin/bibcop --replace "basename(\$0) eq 'bibcop.pl'" "basename(\$0) eq 'bibcop'"
|
||||
'';
|
||||
|
||||
# misc tab and python3 fixes
|
||||
ebong.postFixup = ''
|
||||
sed -Ei 's/import sre/import re/; s/file\(/open(/g; s/\t/ /g; s/print +(.*)$/print(\1)/g' "$out"/bin/ebong
|
||||
@ -305,12 +300,12 @@ in lib.recursiveUpdate orig rec {
|
||||
# add runtime dependencies to PATH
|
||||
epspdf.postFixup = ''
|
||||
sed -i '2ios.setenv("PATH","${lib.makeBinPath epspdf.extraBuildInputs}" .. (os.getenv("PATH") and ":" .. os.getenv("PATH") or ""))' "$out"/bin/epspdf
|
||||
substituteInPlace "$out"/bin/epspdftk --replace '[info script]' "\"$scriptsFolder/epspdftk.tcl\""
|
||||
substituteInPlace "$out"/bin/epspdftk --replace-fail '[info script]' "\"$scriptsFolder/epspdftk.tcl\""
|
||||
'';
|
||||
|
||||
# find files in script directory, not in binary directory
|
||||
latexindent.postFixup = ''
|
||||
substituteInPlace "$out"/bin/latexindent --replace 'use FindBin;' "BEGIN { \$0 = '$scriptsFolder' . '/latexindent.pl'; }; use FindBin;"
|
||||
substituteInPlace "$out"/bin/latexindent --replace-fail 'use FindBin;' "BEGIN { \$0 = '$scriptsFolder' . '/latexindent.pl'; }; use FindBin;"
|
||||
'';
|
||||
|
||||
# flag lua dependency
|
||||
@ -330,14 +325,14 @@ in lib.recursiveUpdate orig rec {
|
||||
|
||||
# patch interpreter
|
||||
texosquery.postFixup = ''
|
||||
substituteInPlace "$out"/bin/* --replace java "$interpJava"
|
||||
substituteInPlace "$out"/bin/* --replace-fail java "$interpJava"
|
||||
'';
|
||||
|
||||
# hardcode revision numbers (since texlive.infra, tlshell are not in either system or user texlive.tlpdb)
|
||||
tlshell.postFixup = ''
|
||||
substituteInPlace "$out"/bin/tlshell \
|
||||
--replace '[dict get $::pkgs texlive.infra localrev]' '${toString orig."texlive.infra".revision}' \
|
||||
--replace '[dict get $::pkgs tlshell localrev]' '${toString orig.tlshell.revision}'
|
||||
--replace-fail '[dict get $::pkgs texlive.infra localrev]' '${toString orig."texlive.infra".revision}' \
|
||||
--replace-fail '[dict get $::pkgs tlshell localrev]' '${toString orig.tlshell.revision}'
|
||||
'';
|
||||
|
||||
#### dependency changes
|
||||
@ -361,6 +356,14 @@ in lib.recursiveUpdate orig rec {
|
||||
# tlpdb lists license as "unknown", but the README says lppl13: http://mirrors.ctan.org/language/arabic/arabi-add/README
|
||||
arabi-add.license = [ "lppl13c" ];
|
||||
|
||||
# mtxrun.lua writes to const loop variables which is forbidden in recent LuaTeX
|
||||
# patch manually generated by diffing against a recent cont-lmt.zip
|
||||
context.postUnpack = ''
|
||||
if [[ -f "$out"/scripts/context/lua/mtxrun.lua ]] ; then
|
||||
patch -p1 -d "$out" < ${./mtxrun-local-vars.patch}
|
||||
fi
|
||||
'';
|
||||
|
||||
texdoc = {
|
||||
extraRevision = "-tlpdb${toString tlpdbVersion.revision}";
|
||||
extraVersion = "-tlpdb-${toString tlpdbVersion.revision}";
|
||||
@ -389,9 +392,9 @@ in lib.recursiveUpdate orig rec {
|
||||
TEXMFCNF="${tl.kpathsea.tex}"/web2c TEXMF="$scriptsFolder/../.." \
|
||||
texlua "$out"/bin/texdoc --print-completion zsh > "$TMPDIR"/_texdoc
|
||||
substituteInPlace "$TMPDIR"/_texdoc \
|
||||
--replace 'compdef __texdoc texdoc' '#compdef texdoc' \
|
||||
--replace '$(kpsewhich -var-value TEXMFROOT)/tlpkg/texlive.tlpdb' '$(kpsewhich Data.tlpdb.lua)' \
|
||||
--replace '/^name[^.]*$/ {print $2}' '/^ \["[^"]*"\] = {$/ { print substr($1,3,length($1)-4) }'
|
||||
--replace-fail 'compdef __texdoc texdoc' '#compdef texdoc' \
|
||||
--replace-fail '$(kpsewhich -var-value TEXMFROOT)/tlpkg/texlive.tlpdb' '$(kpsewhich Data.tlpdb.lua)' \
|
||||
--replace-fail '/^name[^.]*$/ {print $2}' '/^ \["[^"]*"\] = {$/ { print substr($1,3,length($1)-4) }'
|
||||
echo '__texdoc' >> "$TMPDIR"/_texdoc
|
||||
installShellCompletion --zsh "$TMPDIR"/_texdoc
|
||||
'';
|
||||
@ -410,7 +413,7 @@ in lib.recursiveUpdate orig rec {
|
||||
# make tlmgr believe it can use kpsewhich to evaluate TEXMFROOT
|
||||
postFixup = ''
|
||||
substituteInPlace "$out"/bin/tlmgr \
|
||||
--replace 'if (-r "$bindir/$kpsewhichname")' 'if (1)'
|
||||
--replace-fail 'if (-r "$bindir/$kpsewhichname")' 'if (1)'
|
||||
sed -i '2i$ENV{PATH}='"'"'${lib.makeBinPath [ gnupg ]}'"'"' . ($ENV{PATH} ? ":$ENV{PATH}" : '"'''"');' "$out"/bin/tlmgr
|
||||
sed -i '2iPATH="${lib.makeBinPath [ coreutils gnused tl.kpathsea ]}''${PATH:+:$PATH}"' "$out"/bin/mktexlsr
|
||||
'';
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user