mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 04:46:43 +00:00
texdoc: install zsh completion
This commit is contained in:
parent
7582e6fea6
commit
65923600fe
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv
|
{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv
|
||||||
, callPackage, ghostscript_headless, harfbuzz
|
, callPackage, ghostscript_headless, harfbuzz
|
||||||
, makeWrapper
|
, makeWrapper, installShellFiles
|
||||||
, python3, ruby, perl, tk, jdk, bash, snobol4
|
, python3, ruby, perl, tk, jdk, bash, snobol4
|
||||||
, coreutils, findutils, gawk, getopt, gnugrep, gnumake, gnupg, gnused, gzip, ncurses, zip
|
, coreutils, findutils, gawk, getopt, gnugrep, gnumake, gnupg, gnused, gzip, ncurses, zip
|
||||||
, libfaketime, asymptote, biber-ms, makeFontsConf
|
, libfaketime, asymptote, biber-ms, makeFontsConf
|
||||||
@ -376,6 +376,8 @@ let
|
|||||||
extraRevision = "-tlpdb${toString tlpdbVersion.revision}";
|
extraRevision = "-tlpdb${toString tlpdbVersion.revision}";
|
||||||
extraVersion = "-tlpdb-${toString tlpdbVersion.revision}";
|
extraVersion = "-tlpdb-${toString tlpdbVersion.revision}";
|
||||||
|
|
||||||
|
extraNativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
# build Data.tlpdb.lua (part of the 'tlType == "run"' package)
|
# build Data.tlpdb.lua (part of the 'tlType == "run"' package)
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
if [[ -f "$out"/scripts/texdoc/texdoc.tlu ]]; then
|
if [[ -f "$out"/scripts/texdoc/texdoc.tlu ]]; then
|
||||||
@ -392,6 +394,18 @@ let
|
|||||||
cp texdoc/cache-tlpdb.lua "$out"/scripts/texdoc/Data.tlpdb.lua
|
cp texdoc/cache-tlpdb.lua "$out"/scripts/texdoc/Data.tlpdb.lua
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# install zsh completion
|
||||||
|
postFixup = ''
|
||||||
|
TEXMFCNF="${bin.core}"/share/texmf-dist/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) }'
|
||||||
|
echo '__texdoc' >> "$TMPDIR"/_texdoc
|
||||||
|
installShellCompletion --zsh "$TMPDIR"/_texdoc
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
"texlive.infra" = {
|
"texlive.infra" = {
|
||||||
|
Loading…
Reference in New Issue
Block a user