uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
333
pkgs/tools/typesetting/asciidoc/default.nix
Normal file
333
pkgs/tools/typesetting/asciidoc/default.nix
Normal file
|
|
@ -0,0 +1,333 @@
|
|||
{ fetchurl, lib, stdenv, python3
|
||||
, fetchFromGitHub, autoreconfHook
|
||||
, enableStandardFeatures ? false
|
||||
, sourceHighlight ? null
|
||||
, highlight ? null
|
||||
, pygments ? null
|
||||
, graphviz ? null
|
||||
, texlive ? null
|
||||
, dblatexFull ? null
|
||||
, libxslt ? null
|
||||
, w3m ? null
|
||||
, lynx ? null
|
||||
, imagemagick ? null
|
||||
, lilypond ? null
|
||||
, libxml2 ? null
|
||||
, docbook_xml_dtd_45 ? null
|
||||
, docbook_xsl_ns ? null
|
||||
, docbook_xsl ? null
|
||||
, fop ? null
|
||||
# TODO: Package this:
|
||||
#, epubcheck ? null
|
||||
, gnused ? null
|
||||
, coreutils ? null
|
||||
|
||||
# if true, enable all the below filters and backends
|
||||
, enableExtraPlugins ? false
|
||||
|
||||
# unzip is needed to extract filter and backend plugins
|
||||
, unzip ? null
|
||||
# filters
|
||||
, enableDitaaFilter ? false, jre ? null
|
||||
, enableMscgenFilter ? false, mscgen ? null
|
||||
, enableDiagFilter ? false, blockdiag ? null, seqdiag ? null, actdiag ? null, nwdiag ? null
|
||||
, enableQrcodeFilter ? false, qrencode ? null
|
||||
, enableMatplotlibFilter ? false, matplotlib ? null, numpy ? null
|
||||
, enableAafigureFilter ? false, aafigure ? null, recursivePthLoader ? null
|
||||
# backends
|
||||
, enableDeckjsBackend ? false
|
||||
, enableOdfBackend ? false
|
||||
|
||||
# java is problematic on some platforms, where it is unfree
|
||||
, enableJava ? true
|
||||
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
assert enableStandardFeatures ->
|
||||
sourceHighlight != null &&
|
||||
highlight != null &&
|
||||
pygments != null &&
|
||||
graphviz != null &&
|
||||
texlive != null &&
|
||||
dblatexFull != null &&
|
||||
libxslt != null &&
|
||||
w3m != null &&
|
||||
lynx != null &&
|
||||
imagemagick != null &&
|
||||
lilypond != null &&
|
||||
libxml2 != null &&
|
||||
docbook_xml_dtd_45 != null &&
|
||||
docbook_xsl_ns != null &&
|
||||
docbook_xsl != null &&
|
||||
(fop != null || !enableJava) &&
|
||||
# TODO: Package this:
|
||||
# epubcheck != null &&
|
||||
gnused != null &&
|
||||
coreutils != null;
|
||||
|
||||
# filters
|
||||
assert enableExtraPlugins || enableDitaaFilter || enableMscgenFilter || enableDiagFilter || enableQrcodeFilter || enableAafigureFilter -> unzip != null;
|
||||
assert (enableExtraPlugins && enableJava) || enableDitaaFilter -> jre != null;
|
||||
assert enableExtraPlugins || enableMscgenFilter -> mscgen != null;
|
||||
assert enableExtraPlugins || enableDiagFilter -> blockdiag != null && seqdiag != null && actdiag != null && nwdiag != null;
|
||||
assert enableExtraPlugins || enableMatplotlibFilter -> matplotlib != null && numpy != null;
|
||||
assert enableExtraPlugins || enableAafigureFilter -> aafigure != null && recursivePthLoader != null;
|
||||
# backends
|
||||
assert enableExtraPlugins || enableDeckjsBackend || enableOdfBackend -> unzip != null;
|
||||
|
||||
let
|
||||
|
||||
_enableDitaaFilter = (enableExtraPlugins && enableJava) || enableDitaaFilter;
|
||||
_enableMscgenFilter = enableExtraPlugins || enableMscgenFilter;
|
||||
_enableDiagFilter = enableExtraPlugins || enableDiagFilter;
|
||||
_enableQrcodeFilter = enableExtraPlugins || enableQrcodeFilter;
|
||||
_enableMatplotlibFilter = enableExtraPlugins || enableMatplotlibFilter;
|
||||
_enableAafigureFilter = enableExtraPlugins || enableAafigureFilter;
|
||||
_enableDeckjsBackend = enableExtraPlugins || enableDeckjsBackend;
|
||||
_enableOdfBackend = enableExtraPlugins || enableOdfBackend;
|
||||
|
||||
#
|
||||
# filters
|
||||
#
|
||||
|
||||
ditaaFilterSrc = fetchurl {
|
||||
url = "https://asciidoc-ditaa-filter.googlecode.com/files/ditaa-filter-1.1.zip";
|
||||
sha256 = "0p7hm2a1xywx982ia3vg4c0lam5sz0xknsc10i2a5vswy026naf6";
|
||||
};
|
||||
|
||||
mscgenFilterSrc = fetchurl {
|
||||
url = "https://asciidoc-mscgen-filter.googlecode.com/files/mscgen-filter-1.2.zip";
|
||||
sha256 = "1nfwmj375gpv5dn9i770pjv59aihzy2kja0fflsk96xwnlqsqq61";
|
||||
};
|
||||
|
||||
diagFilterSrc = fetchurl {
|
||||
# unfortunately no version number
|
||||
url = "https://asciidoc-diag-filter.googlecode.com/files/diag_filter.zip";
|
||||
sha256 = "1qlqrdbqkdqqgfdhjsgdws1al0sacsyq6jmwxdfy7r8k7bv7n7mm";
|
||||
};
|
||||
|
||||
qrcodeFilterSrc = fetchurl {
|
||||
url = "https://asciidoc-qrencode-filter.googlecode.com/files/qrcode-filter-1.0.zip";
|
||||
sha256 = "0h4bql1nb4y4fmg2yvlpfjhvy22ln8jsaxdr10f8bfcg5lr0zkxs";
|
||||
};
|
||||
|
||||
# there are no archives or tags, using latest commit in master branch as per 2013-09-22
|
||||
matplotlibFilterSrc = let commit = "75f0d009629f93f33fab04b83faca20cc35dd358"; in fetchurl {
|
||||
name = "mplw-${commit}.tar.gz";
|
||||
url = "https://api.github.com/repos/lvv/mplw/tarball/${commit}";
|
||||
sha256 = "0yfhkm2dr8gnp0fcg25x89hwiymkri2m5cyqzmzragzwj0hbmcf1";
|
||||
};
|
||||
|
||||
aafigureFilterSrc = fetchurl {
|
||||
url = "https://asciidoc-aafigure-filter.googlecode.com/files/aafigure-filter-1.1.zip";
|
||||
sha256 = "1hq2s30dvmv5dqvj0xm1qwdwafhgm9w1iyr0lr0c40cyk8h00j8j";
|
||||
};
|
||||
|
||||
#
|
||||
# backends
|
||||
#
|
||||
|
||||
deckjsBackendSrc = fetchurl {
|
||||
url = "https://github.com/downloads/houqp/asciidoc-deckjs/deckjs-1.6.2.zip";
|
||||
sha256 = "1siy1j8naj5irrrrv5bfgl4d8nal6j9pyahy4f50wmrr9wv59s46";
|
||||
};
|
||||
|
||||
# the odf backend is actually two plugins: odt + odp
|
||||
odtBackendSrc = fetchurl {
|
||||
url = "https://github.com/downloads/dagwieers/asciidoc-odf/odt-backend-0.1.zip";
|
||||
sha256 = "1zaa97h9sx6ncxcdkl1x3ggydi7f8kjgvrnpjnkjiizi45k350kw";
|
||||
};
|
||||
|
||||
odpBackendSrc = fetchurl {
|
||||
url = "https://github.com/downloads/dagwieers/asciidoc-odf/odp-backend-0.1.zip";
|
||||
sha256 = "08ya4bskygzqkfqwjllpg31qc5k08xp2k78z9b2480g8y57bfy10";
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "asciidoc"
|
||||
+ lib.optionalString enableStandardFeatures "-full"
|
||||
+ lib.optionalString enableExtraPlugins "-with-plugins";
|
||||
version = "9.1.0";
|
||||
|
||||
# Note: a substitution to improve reproducibility should be updated once 10.0.0 is
|
||||
# released. See the comment in `patchPhase` for more information.
|
||||
src = fetchFromGitHub {
|
||||
owner = "asciidoc";
|
||||
repo = "asciidoc-py3";
|
||||
rev = version;
|
||||
sha256 = "1clf1axkns23wfmh48xfspzsnw04pjh4mq1pshpzvj0cwxhz0yaq";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ python3 unzip autoreconfHook ];
|
||||
buildInputs = [ python3 ];
|
||||
|
||||
# install filters early, so their shebangs are patched too
|
||||
postPatch = with lib; ''
|
||||
mkdir -p "$out/etc/asciidoc/filters"
|
||||
mkdir -p "$out/etc/asciidoc/backends"
|
||||
'' + optionalString _enableDitaaFilter ''
|
||||
echo "Extracting ditaa filter"
|
||||
unzip -d "$out/etc/asciidoc/filters/ditaa" "${ditaaFilterSrc}"
|
||||
sed -i -e "s|java -jar|${jre}/bin/java -jar|" \
|
||||
"$out/etc/asciidoc/filters/ditaa/ditaa2img.py"
|
||||
'' + optionalString _enableMscgenFilter ''
|
||||
echo "Extracting mscgen filter"
|
||||
unzip -d "$out/etc/asciidoc/filters/mscgen" "${mscgenFilterSrc}"
|
||||
sed -i -e "s|filter-wrapper.py mscgen|filter-wrapper.py ${mscgen}/bin/mscgen|" \
|
||||
"$out/etc/asciidoc/filters/mscgen/mscgen-filter.conf"
|
||||
'' + optionalString _enableDiagFilter ''
|
||||
echo "Extracting diag filter"
|
||||
unzip -d "$out/etc/asciidoc/filters/diag" "${diagFilterSrc}"
|
||||
sed -i \
|
||||
-e "s|filter='blockdiag|filter=\'${blockdiag}/bin/blockdiag|" \
|
||||
-e "s|filter='seqdiag|filter=\'${seqdiag}/bin/seqdiag|" \
|
||||
-e "s|filter='actdiag|filter=\'${actdiag}/bin/actdiag|" \
|
||||
-e "s|filter='nwdiag|filter=\'${nwdiag}/bin/nwdiag|" \
|
||||
-e "s|filter='packetdiag|filter=\'${nwdiag}/bin/packetdiag|" \
|
||||
"$out/etc/asciidoc/filters/diag/diag-filter.conf"
|
||||
'' + optionalString _enableQrcodeFilter ''
|
||||
echo "Extracting qrcode filter"
|
||||
unzip -d "$out/etc/asciidoc/filters/qrcode" "${qrcodeFilterSrc}"
|
||||
sed -i -e "s|systemcmd('qrencode|systemcmd('${qrencode}/bin/qrencode|" \
|
||||
"$out/etc/asciidoc/filters/qrcode/qrcode2img.py"
|
||||
'' + optionalString _enableMatplotlibFilter ''
|
||||
echo "Extracting mpl (matplotlib) filter"
|
||||
mkdir -p "$out/etc/asciidoc/filters/mpl"
|
||||
tar xvf "${matplotlibFilterSrc}" -C "$out/etc/asciidoc/filters/mpl" --strip-components=1
|
||||
# Stop asciidoc from loading mpl/.old/chart-filter.conf
|
||||
rm -rf "$out/etc/asciidoc/filters/mpl/.old"
|
||||
# Add matplotlib and numpy to sys.path
|
||||
matplotlib_path="$(toPythonPath ${matplotlib})"
|
||||
numpy_path="$(toPythonPath ${numpy})"
|
||||
sed -i "/^import.*sys/asys.path.append(\"$matplotlib_path\"); sys.path.append(\"$numpy_path\");" \
|
||||
"$out/etc/asciidoc/filters/mpl/mplw.py"
|
||||
'' + optionalString _enableAafigureFilter ''
|
||||
echo "Extracting aafigure filter"
|
||||
unzip -d "$out/etc/asciidoc/filters/aafigure" "${aafigureFilterSrc}"
|
||||
# Add aafigure to sys.path (and it needs recursive-pth-loader)
|
||||
pth_loader_path="$(toPythonPath ${recursivePthLoader})"
|
||||
aafigure_path="$(toPythonPath ${aafigure})"
|
||||
sed -i "/^import.*sys/asys.path.append(\"$pth_loader_path\"); sys.path.append(\"$aafigure_path\"); import sitecustomize" \
|
||||
"$out/etc/asciidoc/filters/aafigure/aafig2img.py"
|
||||
'' + optionalString _enableDeckjsBackend ''
|
||||
echo "Extracting deckjs backend"
|
||||
unzip -d "$out/etc/asciidoc/backends/deckjs" "${deckjsBackendSrc}"
|
||||
'' + optionalString _enableOdfBackend ''
|
||||
echo "Extracting odf backend (odt + odp)"
|
||||
unzip -d "$out/etc/asciidoc/backends/odt" "${odtBackendSrc}"
|
||||
unzip -d "$out/etc/asciidoc/backends/odp" "${odpBackendSrc}"
|
||||
# The odt backend has a TODO note about removing this hardcoded path, but
|
||||
# the odp backend already has that fix. Copy it here until fixed upstream.
|
||||
sed -i "s|'/etc/asciidoc/backends/odt/asciidoc.ott'|os.path.dirname(__file__),'asciidoc.ott'|" \
|
||||
"$out/etc/asciidoc/backends/odt/a2x-backend.py"
|
||||
'' + (if enableStandardFeatures then ''
|
||||
sed -e "s|dot|${graphviz}/bin/dot|g" \
|
||||
-e "s|neato|${graphviz}/bin/neato|g" \
|
||||
-e "s|twopi|${graphviz}/bin/twopi|g" \
|
||||
-e "s|circo|${graphviz}/bin/circo|g" \
|
||||
-e "s|fdp|${graphviz}/bin/fdp|g" \
|
||||
-i "filters/graphviz/graphviz2png.py"
|
||||
|
||||
sed -e "s|run('latex|run('${texlive}/bin/latex|g" \
|
||||
-e "s|cmd = 'dvipng'|cmd = '${texlive}/bin/dvipng'|g" \
|
||||
-e "s|cmd = 'dvisvgm'|cmd = '${texlive}/bin/dvisvgm'|g" \
|
||||
-i "filters/latex/latex2img.py"
|
||||
|
||||
sed -e "s|run('abc2ly|run('${lilypond}/bin/abc2ly|g" \
|
||||
-e "s|run('lilypond|run('${lilypond}/bin/lilypond|g" \
|
||||
-e "s|run('convert|run('${imagemagick.out}/bin/convert|g" \
|
||||
-i "filters/music/music2png.py"
|
||||
|
||||
sed -e 's|filter="source-highlight|filter="${sourceHighlight}/bin/source-highlight|' \
|
||||
-e 's|filter="highlight|filter="${highlight}/bin/highlight|' \
|
||||
-e 's|filter="pygmentize|filter="${pygments}/bin/pygmentize|' \
|
||||
-i "filters/source/source-highlight-filter.conf"
|
||||
|
||||
# ENV is custom environment passed to programs that a2x invokes. Here we
|
||||
# use it to work around an impurity in the tetex package; tetex tools
|
||||
# cannot find their neighbours (e.g. pdflatex doesn't find mktextfm).
|
||||
# We can remove PATH= when those impurities are fixed.
|
||||
# TODO: Is this still necessary when using texlive?
|
||||
sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml', PATH='${lib.makeBinPath [ texlive coreutils gnused ]}')|" \
|
||||
-e "s|^ASCIIDOC =.*|ASCIIDOC = '$out/bin/asciidoc'|" \
|
||||
-e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \
|
||||
-e "s|^DBLATEX =.*|DBLATEX = '${dblatexFull}/bin/dblatex'|" \
|
||||
${optionalString enableJava ''-e "s|^FOP =.*|FOP = '${fop}/bin/fop'|"''} \
|
||||
-e "s|^W3M =.*|W3M = '${w3m}/bin/w3m'|" \
|
||||
-e "s|^LYNX =.*|LYNX = '${lynx}/bin/lynx'|" \
|
||||
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \
|
||||
-e "s|^EPUBCHECK =.*|EPUBCHECK = 'nixpkgs_is_missing_epubcheck'|" \
|
||||
-i a2x.py
|
||||
'' else ''
|
||||
sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml')|" \
|
||||
-e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \
|
||||
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \
|
||||
-i a2x.py
|
||||
'') + ''
|
||||
patchShebangs --host \
|
||||
asciidoc.py \
|
||||
a2x.py \
|
||||
tests/testasciidoc.py \
|
||||
filters/code/code-filter.py \
|
||||
filters/latex/latex2img.py \
|
||||
filters/music/music2png.py \
|
||||
filters/unwraplatex.py \
|
||||
filters/graphviz/graphviz2png.py
|
||||
|
||||
# Hardcode the path to its own asciidoc.
|
||||
# This helps with cross-compilation.
|
||||
substituteInPlace a2x.py \
|
||||
--replace "find_executable(ASCIIDOC)" "'${placeholder "out"}/bin/asciidoc'"
|
||||
|
||||
# Note: this substitution will not work in the planned 10.0.0 release:
|
||||
#
|
||||
# https://github.com/asciidoc/asciidoc-py3/commit/dfffda23381014481cd13e8e9d8f131e1f93f08a
|
||||
#
|
||||
# Update this substitution to:
|
||||
#
|
||||
# --replace "python3 -m asciidoc.a2x" "python3 -m asciidoc.a2x -a revdate=01/01/1980"
|
||||
substituteInPlace Makefile.in \
|
||||
--replace "python3 a2x.py" "python3 a2x.py -a revdate=01/01/1980"
|
||||
|
||||
# Fix tests
|
||||
for f in $(grep -R --files-with-matches "2002-11-25") ; do
|
||||
substituteInPlace $f --replace "2002-11-25" "1970-01-01"
|
||||
substituteInPlace $f --replace "00:37:42" "00:00:01"
|
||||
done
|
||||
'' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
||||
# We want to use asciidoc from the build platform to build the documentation.
|
||||
substituteInPlace Makefile.in \
|
||||
--replace "python3 a2x.py" "python3 ${buildPackages.asciidoc}/bin/a2x.py"
|
||||
'';
|
||||
|
||||
preInstall = "mkdir -p $out/etc/vim";
|
||||
makeFlags = lib.optional stdenv.isCygwin "DESTDIR=/.";
|
||||
|
||||
checkInputs = [ sourceHighlight ];
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Text-based document generation system";
|
||||
longDescription = ''
|
||||
AsciiDoc is a text document format for writing notes, documentation,
|
||||
articles, books, ebooks, slideshows, web pages, man pages and blogs.
|
||||
AsciiDoc files can be translated to many formats including HTML, PDF,
|
||||
EPUB, man page.
|
||||
|
||||
AsciiDoc is highly configurable: both the AsciiDoc source file syntax and
|
||||
the backend output markups (which can be almost any type of SGML/XML
|
||||
markup) can be customized and extended by the user.
|
||||
'';
|
||||
sourceProvenance = with sourceTypes; [
|
||||
fromSource
|
||||
] ++ lib.optional _enableDitaaFilter binaryBytecode;
|
||||
homepage = "http://www.methods.co.nz/asciidoc/";
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ maintainers.bjornfor ];
|
||||
};
|
||||
}
|
||||
14
pkgs/tools/typesetting/asciidoctor-with-extensions/Gemfile
Normal file
14
pkgs/tools/typesetting/asciidoctor-with-extensions/Gemfile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
source 'https://rubygems.org'
|
||||
gem 'asciidoctor'
|
||||
gem 'asciidoctor-bibtex'
|
||||
gem 'asciidoctor-diagram'
|
||||
gem 'asciidoctor-epub3'
|
||||
gem 'asciidoctor-html5s'
|
||||
gem 'asciidoctor-mathematical'
|
||||
gem 'asciidoctor-multipage'
|
||||
gem 'asciidoctor-pdf'
|
||||
gem 'asciidoctor-revealjs'
|
||||
gem 'asciidoctor-rouge'
|
||||
gem 'coderay'
|
||||
gem 'pygments.rb'
|
||||
gem 'rouge'
|
||||
142
pkgs/tools/typesetting/asciidoctor-with-extensions/Gemfile.lock
Normal file
142
pkgs/tools/typesetting/asciidoctor-with-extensions/Gemfile.lock
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
Ascii85 (1.1.0)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
afm (0.2.2)
|
||||
asciidoctor (2.0.17)
|
||||
asciidoctor-bibtex (0.8.0)
|
||||
asciidoctor (~> 2.0)
|
||||
bibtex-ruby (~> 5.1)
|
||||
citeproc-ruby (~> 1)
|
||||
csl-styles (~> 1)
|
||||
latex-decode (~> 0.2)
|
||||
asciidoctor-diagram (2.2.1)
|
||||
asciidoctor (>= 1.5.7, < 3.x)
|
||||
asciidoctor-diagram-ditaamini (~> 1.0)
|
||||
asciidoctor-diagram-plantuml (~> 1.2021)
|
||||
rexml
|
||||
asciidoctor-diagram-ditaamini (1.0.1)
|
||||
asciidoctor-diagram-plantuml (1.2021.8)
|
||||
asciidoctor-epub3 (1.5.1)
|
||||
asciidoctor (>= 1.5.6, < 3.0.0)
|
||||
gepub (~> 1.0.0)
|
||||
mime-types (~> 3.0)
|
||||
asciidoctor-html5s (0.5.1)
|
||||
asciidoctor (>= 1.5.7, < 3.0)
|
||||
thread_safe (~> 0.3.4)
|
||||
asciidoctor-mathematical (0.3.5)
|
||||
asciidoctor (~> 2.0)
|
||||
asciimath (~> 2.0)
|
||||
mathematical (~> 1.6.0)
|
||||
asciidoctor-multipage (0.0.15)
|
||||
asciidoctor (>= 2.0.11, < 2.1)
|
||||
asciidoctor-pdf (1.6.2)
|
||||
asciidoctor (~> 2.0)
|
||||
concurrent-ruby (~> 1.1)
|
||||
prawn (~> 2.4.0)
|
||||
prawn-icon (~> 3.0.0)
|
||||
prawn-svg (~> 0.32.0)
|
||||
prawn-table (~> 0.2.0)
|
||||
prawn-templates (~> 0.1.0)
|
||||
safe_yaml (~> 1.0.0)
|
||||
treetop (~> 1.6.0)
|
||||
asciidoctor-revealjs (4.1.0)
|
||||
asciidoctor (>= 2.0.0, < 3.0.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
thread_safe (~> 0.3.5)
|
||||
asciidoctor-rouge (0.4.0)
|
||||
asciidoctor (>= 1.5.6, < 2.1)
|
||||
rouge (>= 2.2, < 4)
|
||||
asciimath (2.0.3)
|
||||
bibtex-ruby (5.1.6)
|
||||
latex-decode (~> 0.0)
|
||||
citeproc (1.0.10)
|
||||
namae (~> 1.0)
|
||||
citeproc-ruby (1.1.14)
|
||||
citeproc (~> 1.0, >= 1.0.9)
|
||||
csl (~> 1.6)
|
||||
coderay (1.1.3)
|
||||
concurrent-ruby (1.1.9)
|
||||
csl (1.6.0)
|
||||
namae (~> 1.0)
|
||||
rexml
|
||||
csl-styles (1.0.1.11)
|
||||
csl (~> 1.0)
|
||||
css_parser (1.11.0)
|
||||
addressable
|
||||
gepub (1.0.15)
|
||||
nokogiri (>= 1.8.2, < 2.0)
|
||||
rubyzip (> 1.1.1, < 2.4)
|
||||
hashery (2.1.2)
|
||||
i18n (1.8.11)
|
||||
concurrent-ruby (~> 1.0)
|
||||
latex-decode (0.3.2)
|
||||
mathematical (1.6.14)
|
||||
ruby-enum (~> 0.4)
|
||||
mime-types (3.4.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2022.0105)
|
||||
mini_portile2 (2.7.1)
|
||||
namae (1.1.1)
|
||||
nokogiri (1.13.1)
|
||||
mini_portile2 (~> 2.7.0)
|
||||
racc (~> 1.4)
|
||||
pdf-core (0.9.0)
|
||||
pdf-reader (2.8.0)
|
||||
Ascii85 (~> 1.0)
|
||||
afm (~> 0.2.1)
|
||||
hashery (~> 2.0)
|
||||
ruby-rc4
|
||||
ttfunk
|
||||
polyglot (0.3.5)
|
||||
prawn (2.4.0)
|
||||
pdf-core (~> 0.9.0)
|
||||
ttfunk (~> 1.7)
|
||||
prawn-icon (3.0.0)
|
||||
prawn (>= 1.1.0, < 3.0.0)
|
||||
prawn-svg (0.32.0)
|
||||
css_parser (~> 1.6)
|
||||
prawn (>= 0.11.1, < 3)
|
||||
rexml (~> 3.2)
|
||||
prawn-table (0.2.2)
|
||||
prawn (>= 1.3.0, < 3.0.0)
|
||||
prawn-templates (0.1.2)
|
||||
pdf-reader (~> 2.0)
|
||||
prawn (~> 2.2)
|
||||
public_suffix (4.0.6)
|
||||
pygments.rb (2.3.0)
|
||||
racc (1.6.0)
|
||||
rexml (3.2.5)
|
||||
rouge (3.27.0)
|
||||
ruby-enum (0.9.0)
|
||||
i18n
|
||||
ruby-rc4 (0.1.5)
|
||||
rubyzip (2.3.2)
|
||||
safe_yaml (1.0.5)
|
||||
thread_safe (0.3.6)
|
||||
treetop (1.6.11)
|
||||
polyglot (~> 0.3)
|
||||
ttfunk (1.7.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
asciidoctor
|
||||
asciidoctor-bibtex
|
||||
asciidoctor-diagram
|
||||
asciidoctor-epub3
|
||||
asciidoctor-html5s
|
||||
asciidoctor-mathematical
|
||||
asciidoctor-multipage
|
||||
asciidoctor-pdf
|
||||
asciidoctor-revealjs
|
||||
asciidoctor-rouge
|
||||
coderay
|
||||
pygments.rb
|
||||
rouge
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.24
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{ lib
|
||||
, bundlerApp
|
||||
, bundlerUpdateScript
|
||||
, makeWrapper
|
||||
}:
|
||||
|
||||
bundlerApp {
|
||||
pname = "asciidoctor";
|
||||
gemdir = ./.;
|
||||
|
||||
exes = [
|
||||
"asciidoctor"
|
||||
"asciidoctor-epub3"
|
||||
"asciidoctor-multipage"
|
||||
"asciidoctor-pdf"
|
||||
"asciidoctor-revealjs"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
updateScript = bundlerUpdateScript "asciidoctor-with-extensions";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A faster Asciidoc processor written in Ruby, with many extensions enabled";
|
||||
homepage = "https://asciidoctor.org/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ doronbehar ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
571
pkgs/tools/typesetting/asciidoctor-with-extensions/gemset.nix
Normal file
571
pkgs/tools/typesetting/asciidoctor-with-extensions/gemset.nix
Normal file
|
|
@ -0,0 +1,571 @@
|
|||
{
|
||||
addressable = {
|
||||
dependencies = ["public_suffix"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "022r3m9wdxljpbya69y2i3h9g3dhhfaqzidf95m6qjzms792jvgp";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.8.0";
|
||||
};
|
||||
afm = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "06kj9hgd0z8pj27bxp2diwqh6fv7qhwwm17z64rhdc4sfn76jgn8";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.2.2";
|
||||
};
|
||||
Ascii85 = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1ds4v9xgsyvijnlflak4dzf1qwmda9yd5bv8jwsb56nngd399rlw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.0";
|
||||
};
|
||||
asciidoctor = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0g8gn3g6qy4bzjv1b14sj283kqynjgwq62bgq569jr4dkqwmwnzd";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.0.17";
|
||||
};
|
||||
asciidoctor-bibtex = {
|
||||
dependencies = ["asciidoctor" "bibtex-ruby" "citeproc-ruby" "csl-styles" "latex-decode"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0fx80bpykixvnlscyz2c4dnjr1063r5ar7j1zn2977vsr8fi8ial";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.8.0";
|
||||
};
|
||||
asciidoctor-diagram = {
|
||||
dependencies = ["asciidoctor" "asciidoctor-diagram-ditaamini" "asciidoctor-diagram-plantuml" "rexml"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1z1ilpczjaydhcwpz3yygn03yrx2ljjj55xczwkrlb8rzgh03br3";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.2.1";
|
||||
};
|
||||
asciidoctor-diagram-ditaamini = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1nva5n6nyns0xp77d1dxng1rjhc8ma6gyd8hczjq3h9qqxcw2q4h";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.1";
|
||||
};
|
||||
asciidoctor-diagram-plantuml = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0n018kmqzapf5y1bacb5yyvb9jfwxdkfqnviwxivwz9322b9w6j7";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.2021.8";
|
||||
};
|
||||
asciidoctor-epub3 = {
|
||||
dependencies = ["asciidoctor" "gepub" "mime-types"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "05lylv2k18vcnf3647n47zdqxpa70bg16znzn252ymp8say25zzg";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.5.1";
|
||||
};
|
||||
asciidoctor-html5s = {
|
||||
dependencies = ["asciidoctor" "thread_safe"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1zfbfcqyrsk8bnd526ang3b4j3m5pbns7x3fdxarrm8vv1qplss1";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.5.1";
|
||||
};
|
||||
asciidoctor-mathematical = {
|
||||
dependencies = ["asciidoctor" "asciimath" "mathematical"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1lxfq7qn3ql642pva6jh3h1abm9j9daxg5icfn1h73k6cjsmcisp";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.3.5";
|
||||
};
|
||||
asciidoctor-multipage = {
|
||||
dependencies = ["asciidoctor"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1372213kxw1b9k120dmyackafzsk80h1y2n0r1hmfrri26kczgfb";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.0.15";
|
||||
};
|
||||
asciidoctor-pdf = {
|
||||
dependencies = ["asciidoctor" "concurrent-ruby" "prawn" "prawn-icon" "prawn-svg" "prawn-table" "prawn-templates" "safe_yaml" "treetop"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1inl7cykm542jb7a6kraxkgfqn4y3185wrabh5pd5m68rdv56f04";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.2";
|
||||
};
|
||||
asciidoctor-revealjs = {
|
||||
dependencies = ["asciidoctor" "concurrent-ruby" "thread_safe"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "03vmbcc3x059h17ry4qwk1p0yar9wgh87l2qssi307gy45cjw2mq";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.1.0";
|
||||
};
|
||||
asciidoctor-rouge = {
|
||||
dependencies = ["asciidoctor" "rouge"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "197sbzs9km58pgfqdnnglhqr7anhb0m330cv1vxfc3s2qz106zjz";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.4.0";
|
||||
};
|
||||
asciimath = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0h4fz93pf96y5syxwpv0vibjf7lidv2718ikpvyd2vy8c1am8zyn";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.0.3";
|
||||
};
|
||||
bibtex-ruby = {
|
||||
dependencies = ["latex-decode"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0adh2x935r69nm8qmns5fjsjw034xlyaqddzza2jr2npvf41g34r";
|
||||
type = "gem";
|
||||
};
|
||||
version = "5.1.6";
|
||||
};
|
||||
citeproc = {
|
||||
dependencies = ["namae"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "13vl5sjmksk5a8kjcqnjxh7kn9gn1n4f9p1rvqfgsfhs54p0m6l2";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.10";
|
||||
};
|
||||
citeproc-ruby = {
|
||||
dependencies = ["citeproc" "csl"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0a8ahyhhmdinl4kcyv51r74ipnclmfyz4zjv366dns8v49n5vkk3";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.14";
|
||||
};
|
||||
coderay = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0jvxqxzply1lwp7ysn94zjhh57vc14mcshw1ygw14ib8lhc00lyw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.3";
|
||||
};
|
||||
concurrent-ruby = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0nwad3211p7yv9sda31jmbyw6sdafzmdi2i2niaz6f0wk5nq9h0f";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.9";
|
||||
};
|
||||
csl = {
|
||||
dependencies = ["namae" "rexml"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0n8iqmzvvqy2b1wfr4c7yj28x4z3zgm36628y8ybl49dgnmjycrk";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.0";
|
||||
};
|
||||
csl-styles = {
|
||||
dependencies = ["csl"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0l29qlk7i74088fpba5iqhhgiqkj7glcmc42nbmvgqysx577nag8";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.1.11";
|
||||
};
|
||||
css_parser = {
|
||||
dependencies = ["addressable"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1qbdgp36dhcyljhmfxrvbgp1ha9yqxhxgyg3sdm48y9m371jd2an";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.11.0";
|
||||
};
|
||||
gepub = {
|
||||
dependencies = ["nokogiri" "rubyzip"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "08fny807zd4700f263ckc76bladjipsniyk3clv8a7x76x3fqshx";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.15";
|
||||
};
|
||||
hashery = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0qj8815bf7q6q7llm5rzdz279gzmpqmqqicxnzv066a020iwqffj";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.1.2";
|
||||
};
|
||||
i18n = {
|
||||
dependencies = ["concurrent-ruby"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0vdd1kii40qhbr9n8qx71k2gskq6rkl8ygy8hw5hfj8bb5a364xf";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.8.11";
|
||||
};
|
||||
latex-decode = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1wnxg82lfkb8bl5la9nmg1434rpkcygygm0ckixjn6ah2dy6i53m";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.3.2";
|
||||
};
|
||||
mathematical = {
|
||||
dependencies = ["ruby-enum"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "05mn68gxhfa37qsnzsmdqaa005hf511j5lga76qsrad2gcnhan1b";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.14";
|
||||
};
|
||||
mime-types = {
|
||||
dependencies = ["mime-types-data"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0ipw892jbksbxxcrlx9g5ljq60qx47pm24ywgfbyjskbcl78pkvb";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.4.1";
|
||||
};
|
||||
mime-types-data = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "003gd7mcay800k2q4pb2zn8lwwgci4bhi42v2jvlidm8ksx03i6q";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.2022.0105";
|
||||
};
|
||||
mini_portile2 = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0d3ga166pahsxavzwj19yjj4lr13rw1vsb36s2qs8blcxigrdp6z";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.7.1";
|
||||
};
|
||||
namae = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1j3nl1klkx3gymrdxfc1hlq4a8qlvhhl9aj5v1v08b9fz27sky0l";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.1";
|
||||
};
|
||||
nokogiri = {
|
||||
dependencies = ["mini_portile2" "racc"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1zqzawia52cdcmi55lp7v8jmiqyw7pcpwsksqlnirwfm3f7bnf11";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.13.1";
|
||||
};
|
||||
pdf-core = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1fz0yj4zrlii2j08kaw11j769s373ayz8jrdhxwwjzmm28pqndjg";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.9.0";
|
||||
};
|
||||
pdf-reader = {
|
||||
dependencies = ["Ascii85" "afm" "hashery" "ruby-rc4" "ttfunk"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "18vsmybpvyi0favlabjipznpc8hgprsm7jpw3s7xr01c3lpjli7y";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.8.0";
|
||||
};
|
||||
polyglot = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1bqnxwyip623d8pr29rg6m8r0hdg08fpr2yb74f46rn1wgsnxmjr";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.3.5";
|
||||
};
|
||||
prawn = {
|
||||
dependencies = ["pdf-core" "ttfunk"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1g9avv2rprsjisdk137s9ljr05r7ajhm78hxa1vjsv0jyx22f1l2";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.4.0";
|
||||
};
|
||||
prawn-icon = {
|
||||
dependencies = ["prawn"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1xdnjik5zinnkjavmybbh2s52wzcpb8hzaqckiv0mxp0vs0x9j6s";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.0.0";
|
||||
};
|
||||
prawn-svg = {
|
||||
dependencies = ["css_parser" "prawn" "rexml"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0mbxzw7r7hv43db9422flc24ib9d8bdy1nasbni2h998jc5a5lb6";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.32.0";
|
||||
};
|
||||
prawn-table = {
|
||||
dependencies = ["prawn"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1nxd6qmxqwl850icp18wjh5k0s3amxcajdrkjyzpfgq0kvilcv9k";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.2.2";
|
||||
};
|
||||
prawn-templates = {
|
||||
dependencies = ["pdf-reader" "prawn"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1w9irn3rllm992c6j7fsx81gg539i7yy8zfddyw7q53hnlys0yhi";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.1.2";
|
||||
};
|
||||
public_suffix = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1xqcgkl7bwws1qrlnmxgh8g4g9m10vg60bhlw40fplninb3ng6d9";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.0.6";
|
||||
};
|
||||
"pygments.rb" = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "047mjyzz8v4kkgi1ap6fsjf7kcp6dwirpnigif00ss0hxsxchhac";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.3.0";
|
||||
};
|
||||
racc = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0la56m0z26j3mfn1a9lf2l03qx1xifanndf9p3vx1azf6sqy7v9d";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.0";
|
||||
};
|
||||
rexml = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "08ximcyfjy94pm1rhcx04ny1vx2sk0x4y185gzn86yfsbzwkng53";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.2.5";
|
||||
};
|
||||
rouge = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0530ri0p60km0bg0ib6swkhfnas427cva7vcdmnwl8df52a10y1k";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.27.0";
|
||||
};
|
||||
ruby-enum = {
|
||||
dependencies = ["i18n"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1pys90hxylhyg969iw9lz3qai5lblf8xwbdg1g5aj52731a9k83p";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.9.0";
|
||||
};
|
||||
ruby-rc4 = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "00vci475258mmbvsdqkmqadlwn6gj9m01sp7b5a3zd90knil1k00";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.1.5";
|
||||
};
|
||||
rubyzip = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0grps9197qyxakbpw02pda59v45lfgbgiyw48i0mq9f2bn9y6mrz";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.3.2";
|
||||
};
|
||||
safe_yaml = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0j7qv63p0vqcd838i2iy2f76c3dgwzkiz1d1xkg7n0pbnxj2vb56";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.5";
|
||||
};
|
||||
thread_safe = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.3.6";
|
||||
};
|
||||
treetop = {
|
||||
dependencies = ["polyglot"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0697qz1akblf8r3wi0s2dsjh468hfsd57fb0mrp93z35y2ni6bhh";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.11";
|
||||
};
|
||||
ttfunk = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "15iaxz9iak5643bq2bc0jkbjv8w2zn649lxgvh5wg48q9d4blw13";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.7.0";
|
||||
};
|
||||
}
|
||||
6
pkgs/tools/typesetting/asciidoctor/Gemfile
Normal file
6
pkgs/tools/typesetting/asciidoctor/Gemfile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
source 'https://rubygems.org'
|
||||
gem 'asciidoctor'
|
||||
gem 'asciidoctor-pdf'
|
||||
gem 'coderay'
|
||||
gem 'pygments.rb'
|
||||
gem 'rouge'
|
||||
67
pkgs/tools/typesetting/asciidoctor/Gemfile.lock
Normal file
67
pkgs/tools/typesetting/asciidoctor/Gemfile.lock
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
Ascii85 (1.1.0)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
afm (0.2.2)
|
||||
asciidoctor (2.0.17)
|
||||
asciidoctor-pdf (1.6.2)
|
||||
asciidoctor (~> 2.0)
|
||||
concurrent-ruby (~> 1.1)
|
||||
prawn (~> 2.4.0)
|
||||
prawn-icon (~> 3.0.0)
|
||||
prawn-svg (~> 0.32.0)
|
||||
prawn-table (~> 0.2.0)
|
||||
prawn-templates (~> 0.1.0)
|
||||
safe_yaml (~> 1.0.0)
|
||||
treetop (~> 1.6.0)
|
||||
coderay (1.1.3)
|
||||
concurrent-ruby (1.1.9)
|
||||
css_parser (1.11.0)
|
||||
addressable
|
||||
hashery (2.1.2)
|
||||
pdf-core (0.9.0)
|
||||
pdf-reader (2.8.0)
|
||||
Ascii85 (~> 1.0)
|
||||
afm (~> 0.2.1)
|
||||
hashery (~> 2.0)
|
||||
ruby-rc4
|
||||
ttfunk
|
||||
polyglot (0.3.5)
|
||||
prawn (2.4.0)
|
||||
pdf-core (~> 0.9.0)
|
||||
ttfunk (~> 1.7)
|
||||
prawn-icon (3.0.0)
|
||||
prawn (>= 1.1.0, < 3.0.0)
|
||||
prawn-svg (0.32.0)
|
||||
css_parser (~> 1.6)
|
||||
prawn (>= 0.11.1, < 3)
|
||||
rexml (~> 3.2)
|
||||
prawn-table (0.2.2)
|
||||
prawn (>= 1.3.0, < 3.0.0)
|
||||
prawn-templates (0.1.2)
|
||||
pdf-reader (~> 2.0)
|
||||
prawn (~> 2.2)
|
||||
public_suffix (4.0.6)
|
||||
pygments.rb (2.3.0)
|
||||
rexml (3.2.5)
|
||||
rouge (3.27.0)
|
||||
ruby-rc4 (0.1.5)
|
||||
safe_yaml (1.0.5)
|
||||
treetop (1.6.11)
|
||||
polyglot (~> 0.3)
|
||||
ttfunk (1.7.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
asciidoctor
|
||||
asciidoctor-pdf
|
||||
coderay
|
||||
pygments.rb
|
||||
rouge
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.24
|
||||
26
pkgs/tools/typesetting/asciidoctor/default.nix
Normal file
26
pkgs/tools/typesetting/asciidoctor/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib
|
||||
, bundlerApp
|
||||
, bundlerUpdateScript
|
||||
}:
|
||||
|
||||
bundlerApp {
|
||||
pname = "asciidoctor";
|
||||
gemdir = ./.;
|
||||
|
||||
exes = [
|
||||
"asciidoctor"
|
||||
"asciidoctor-pdf"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
updateScript = bundlerUpdateScript "asciidoctor";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A faster Asciidoc processor written in Ruby";
|
||||
homepage = "https://asciidoctor.org/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ gpyh nicknovitski ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
262
pkgs/tools/typesetting/asciidoctor/gemset.nix
Normal file
262
pkgs/tools/typesetting/asciidoctor/gemset.nix
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
{
|
||||
addressable = {
|
||||
dependencies = ["public_suffix"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "022r3m9wdxljpbya69y2i3h9g3dhhfaqzidf95m6qjzms792jvgp";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.8.0";
|
||||
};
|
||||
afm = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "06kj9hgd0z8pj27bxp2diwqh6fv7qhwwm17z64rhdc4sfn76jgn8";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.2.2";
|
||||
};
|
||||
Ascii85 = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1ds4v9xgsyvijnlflak4dzf1qwmda9yd5bv8jwsb56nngd399rlw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.0";
|
||||
};
|
||||
asciidoctor = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0g8gn3g6qy4bzjv1b14sj283kqynjgwq62bgq569jr4dkqwmwnzd";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.0.17";
|
||||
};
|
||||
asciidoctor-pdf = {
|
||||
dependencies = ["asciidoctor" "concurrent-ruby" "prawn" "prawn-icon" "prawn-svg" "prawn-table" "prawn-templates" "safe_yaml" "treetop"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1inl7cykm542jb7a6kraxkgfqn4y3185wrabh5pd5m68rdv56f04";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.2";
|
||||
};
|
||||
coderay = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0jvxqxzply1lwp7ysn94zjhh57vc14mcshw1ygw14ib8lhc00lyw";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.3";
|
||||
};
|
||||
concurrent-ruby = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0nwad3211p7yv9sda31jmbyw6sdafzmdi2i2niaz6f0wk5nq9h0f";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.1.9";
|
||||
};
|
||||
css_parser = {
|
||||
dependencies = ["addressable"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1qbdgp36dhcyljhmfxrvbgp1ha9yqxhxgyg3sdm48y9m371jd2an";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.11.0";
|
||||
};
|
||||
hashery = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0qj8815bf7q6q7llm5rzdz279gzmpqmqqicxnzv066a020iwqffj";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.1.2";
|
||||
};
|
||||
pdf-core = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1fz0yj4zrlii2j08kaw11j769s373ayz8jrdhxwwjzmm28pqndjg";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.9.0";
|
||||
};
|
||||
pdf-reader = {
|
||||
dependencies = ["Ascii85" "afm" "hashery" "ruby-rc4" "ttfunk"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "18vsmybpvyi0favlabjipznpc8hgprsm7jpw3s7xr01c3lpjli7y";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.8.0";
|
||||
};
|
||||
polyglot = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1bqnxwyip623d8pr29rg6m8r0hdg08fpr2yb74f46rn1wgsnxmjr";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.3.5";
|
||||
};
|
||||
prawn = {
|
||||
dependencies = ["pdf-core" "ttfunk"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1g9avv2rprsjisdk137s9ljr05r7ajhm78hxa1vjsv0jyx22f1l2";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.4.0";
|
||||
};
|
||||
prawn-icon = {
|
||||
dependencies = ["prawn"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1xdnjik5zinnkjavmybbh2s52wzcpb8hzaqckiv0mxp0vs0x9j6s";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.0.0";
|
||||
};
|
||||
prawn-svg = {
|
||||
dependencies = ["css_parser" "prawn" "rexml"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0mbxzw7r7hv43db9422flc24ib9d8bdy1nasbni2h998jc5a5lb6";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.32.0";
|
||||
};
|
||||
prawn-table = {
|
||||
dependencies = ["prawn"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1nxd6qmxqwl850icp18wjh5k0s3amxcajdrkjyzpfgq0kvilcv9k";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.2.2";
|
||||
};
|
||||
prawn-templates = {
|
||||
dependencies = ["pdf-reader" "prawn"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1w9irn3rllm992c6j7fsx81gg539i7yy8zfddyw7q53hnlys0yhi";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.1.2";
|
||||
};
|
||||
public_suffix = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1xqcgkl7bwws1qrlnmxgh8g4g9m10vg60bhlw40fplninb3ng6d9";
|
||||
type = "gem";
|
||||
};
|
||||
version = "4.0.6";
|
||||
};
|
||||
"pygments.rb" = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "047mjyzz8v4kkgi1ap6fsjf7kcp6dwirpnigif00ss0hxsxchhac";
|
||||
type = "gem";
|
||||
};
|
||||
version = "2.3.0";
|
||||
};
|
||||
rexml = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "08ximcyfjy94pm1rhcx04ny1vx2sk0x4y185gzn86yfsbzwkng53";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.2.5";
|
||||
};
|
||||
rouge = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0530ri0p60km0bg0ib6swkhfnas427cva7vcdmnwl8df52a10y1k";
|
||||
type = "gem";
|
||||
};
|
||||
version = "3.27.0";
|
||||
};
|
||||
ruby-rc4 = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "00vci475258mmbvsdqkmqadlwn6gj9m01sp7b5a3zd90knil1k00";
|
||||
type = "gem";
|
||||
};
|
||||
version = "0.1.5";
|
||||
};
|
||||
safe_yaml = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0j7qv63p0vqcd838i2iy2f76c3dgwzkiz1d1xkg7n0pbnxj2vb56";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.5";
|
||||
};
|
||||
treetop = {
|
||||
dependencies = ["polyglot"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "0697qz1akblf8r3wi0s2dsjh468hfsd57fb0mrp93z35y2ni6bhh";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.6.11";
|
||||
};
|
||||
ttfunk = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "15iaxz9iak5643bq2bc0jkbjv8w2zn649lxgvh5wg48q9d4blw13";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.7.0";
|
||||
};
|
||||
}
|
||||
34
pkgs/tools/typesetting/asciidoctorj/default.nix
Normal file
34
pkgs/tools/typesetting/asciidoctorj/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, stdenv, fetchzip, jdk, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "asciidoctorj";
|
||||
version = "2.4.2";
|
||||
|
||||
src = fetchzip {
|
||||
url = "http://dl.bintray.com/asciidoctor/maven/org/asciidoctor/${pname}/${version}/${pname}-${version}-bin.zip";
|
||||
sha256 = "1b4ivyzpg9p3idk48nfvgpz18qlxyycswkaab31j3dp1mniwvjla";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
rm bin/asciidoctorj.bat
|
||||
cp -r . $out
|
||||
wrapProgram $out/bin/asciidoctorj \
|
||||
--prefix JAVA_HOME : ${jdk}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Official library for running Asciidoctor on the JVM";
|
||||
longDescription = ''
|
||||
AsciidoctorJ is the official library for running Asciidoctor on the JVM.
|
||||
Using AsciidoctorJ, you can convert AsciiDoc content or analyze the
|
||||
structure of a parsed AsciiDoc document from Java and other JVM
|
||||
languages.
|
||||
'';
|
||||
homepage = "https://asciidoctor.org/docs/asciidoctorj/";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ moaxcp ];
|
||||
};
|
||||
}
|
||||
27
pkgs/tools/typesetting/bibclean/default.nix
Normal file
27
pkgs/tools/typesetting/bibclean/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "bibclean";
|
||||
version = "3.06";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://ftp.math.utah.edu/pub/bibclean/bibclean-${version}.tar.xz";
|
||||
sha256 = "sha256-ZXT5uAQrqPoF6uVBazc4o1w40Sn0jnM+JYeOz7qq3kM=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile.in --replace man/man1 share/man/man1
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/bin $out/share/man/man1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prettyprint and syntax check BibTeX and Scribe bibliography data base files";
|
||||
homepage = "http://ftp.math.utah.edu/pub/bibclean";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ dtzWill ];
|
||||
};
|
||||
}
|
||||
50
pkgs/tools/typesetting/biber/default.nix
Normal file
50
pkgs/tools/typesetting/biber/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ lib, stdenv, fetchurl, fetchpatch, perlPackages, shortenPerlShebang, texlive }:
|
||||
|
||||
let
|
||||
biberSource = lib.head (builtins.filter (p: p.tlType == "source") texlive.biber.pkgs);
|
||||
|
||||
# perl 5.32.0 ships with U:C 1.27
|
||||
UnicodeCollate_1_29 = perlPackages.buildPerlPackage rec {
|
||||
pname = "Unicode-Collate";
|
||||
version = "1.29";
|
||||
src = fetchurl {
|
||||
url = "mirror://cpan/authors/id/S/SA/SADAHIRO/${pname}-${version}.tar.gz";
|
||||
sha256 = "0dr4k10fgbsczh4sz7w8d0nnba38r6jrg87cm3gw4xxgn55fzj7l";
|
||||
};
|
||||
meta = {
|
||||
description = "Unicode Collation Algorithm";
|
||||
license = perlPackages.perl.meta.license;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
perlPackages.buildPerlModule {
|
||||
pname = "biber";
|
||||
inherit (biberSource) version;
|
||||
|
||||
src = "${biberSource}/source/bibtex/biber/biblatex-biber.tar.gz";
|
||||
|
||||
buildInputs = with perlPackages; [
|
||||
autovivification BusinessISBN BusinessISMN BusinessISSN ConfigAutoConf
|
||||
DataCompare DataDump DateSimple EncodeEUCJPASCII EncodeHanExtra EncodeJIS2K
|
||||
DateTime DateTimeFormatBuilder DateTimeCalendarJulian
|
||||
ExtUtilsLibBuilder FileSlurper FileWhich IPCRun3 LogLog4perl LWPProtocolHttps ListAllUtils
|
||||
ListMoreUtils MozillaCA ParseRecDescent IOString ReadonlyXS RegexpCommon TextBibTeX
|
||||
UnicodeCollate_1_29 UnicodeLineBreak URI XMLLibXMLSimple XMLLibXSLT XMLWriter
|
||||
ClassAccessor TextCSV TextCSV_XS TextRoman DataUniqid LinguaTranslit SortKey
|
||||
TestDifferences
|
||||
PerlIOutf8_strict
|
||||
];
|
||||
nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
|
||||
|
||||
postInstall = lib.optionalString stdenv.isDarwin ''
|
||||
shortenPerlShebang $out/bin/biber
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Backend for BibLaTeX";
|
||||
license = with licenses; [ artistic1 gpl1Plus ];
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ maintainers.ttuegel ];
|
||||
};
|
||||
}
|
||||
28
pkgs/tools/typesetting/biblatex-check/default.nix
Normal file
28
pkgs/tools/typesetting/biblatex-check/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ lib, stdenv, fetchFromGitHub, python3 }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "biblatex-check";
|
||||
version = "1.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Pezmc";
|
||||
repo = "BibLatex-Check";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-Pe6Ume7vH8WJG2EqOw31g3VYilfFsDBmNHtHcUXxqf0=";
|
||||
};
|
||||
|
||||
buildInputs = [ python3 ];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 biblatex_check.py $out/bin/biblatex-check
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python2/3 script for checking BibLatex .bib files";
|
||||
homepage = "https://github.com/Pezmc/BibLatex-Check";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ dtzWill ];
|
||||
};
|
||||
}
|
||||
36
pkgs/tools/typesetting/coq2html/default.nix
Normal file
36
pkgs/tools/typesetting/coq2html/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ocaml }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "coq2html";
|
||||
version = "1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xavierleroy";
|
||||
repo = "coq2html";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-2J9uETDt+P+t4E9KhTIypA4MQpTCCxYmR6FYF30RqKk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ocaml ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp coq2html $out/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "HTML documentation generator for Coq source files";
|
||||
longDescription = ''
|
||||
coq2html is an HTML documentation generator for Coq source files. It is
|
||||
an alternative to the standard coqdoc documentation generator
|
||||
distributed along with Coq. The major feature of coq2html is its ability
|
||||
to fold proof scripts: in the generated HTML, proof scripts are
|
||||
initially hidden, but can be revealed one by one by clicking on the
|
||||
"Proof" keyword.
|
||||
'';
|
||||
homepage = "https://github.com/xavierleroy/coq2html";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ jwiegley siraben ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
29
pkgs/tools/typesetting/djvu2pdf/default.nix
Normal file
29
pkgs/tools/typesetting/djvu2pdf/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, stdenv, makeWrapper, fetchurl, djvulibre, ghostscript, which }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.9.2";
|
||||
pname = "djvu2pdf";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://0x2a.at/site/projects/djvu2pdf/djvu2pdf-${version}.tar.gz";
|
||||
sha256 = "0v2ax30m7j1yi4m02nzn9rc4sn4vzqh5vywdh96r64j4pwvn5s5g";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp -p djvu2pdf $out/bin
|
||||
wrapProgram $out/bin/djvu2pdf --prefix PATH : ${lib.makeBinPath [ ghostscript djvulibre which ]}
|
||||
|
||||
mkdir -p $out/man/man1
|
||||
cp -p djvu2pdf.1.gz $out/man/man1
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Convert DjVu files to PDF files";
|
||||
homepage = "https://0x2a.at/site/projects/djvu2pdf/";
|
||||
license = lib.licenses.gpl1Only;
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
49
pkgs/tools/typesetting/docbook2odf/default.nix
Normal file
49
pkgs/tools/typesetting/docbook2odf/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ lib, stdenv, fetchurl, perlPackages, makeWrapper, zip, libxslt }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "docbook2odf";
|
||||
version = "0.244";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://open.comsultia.com/docbook2odf/dwn/docbook2odf-${version}.tar.gz";
|
||||
sha256 = "10k44g0qqa37k30pfj8vz95j6zdzz0nmnqjq1lyahfs2h4glzgwb";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ perlPackages.perl ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin/"
|
||||
mkdir -p "$out/share/docbook2odf/"
|
||||
mkdir -p "$out/share/doc/docbook2odf/"
|
||||
mkdir -p "$out/share/man/man1/"
|
||||
mkdir -p "$out/share/applications/"
|
||||
|
||||
cp utils/docbook2odf "$out/bin/"
|
||||
cp docs/docbook2odf.1 "$out/share/man/man1/"
|
||||
cp -r examples/ "$out/share/doc/docbook2odf/"
|
||||
cp -r xsl/ "$out/share/docbook2odf/"
|
||||
cp bindings/desktop/docbook2odf.desktop "$out/share/applications/"
|
||||
|
||||
sed -i "s|/usr/share/docbook2odf|$out/share/docbook2odf|" "$out/bin/docbook2odf"
|
||||
|
||||
wrapProgram "$out/bin/docbook2odf" \
|
||||
--prefix PATH : "${lib.makeBinPath [ zip libxslt ]}" \
|
||||
--prefix PERL5PATH : "${perlPackages.makePerlPath [ perlPackages.ImageMagick ]}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Convert DocBook to OpenDocument Format (ODF)";
|
||||
longDescription = ''
|
||||
Docbook2odf is a toolkit that automaticaly converts DocBook to OASIS
|
||||
OpenDocument (ODF, the ISO standardized format used for texts,
|
||||
spreadsheets and presentations). Conversion is based on a XSLT which
|
||||
makes it easy to convert DocBook->ODF, ODT, ODS and ODP as all these
|
||||
documents are XML based.
|
||||
'';
|
||||
homepage = "http://open.comsultia.com/docbook2odf/";
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.bjornfor ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
--- docbook2X-0.8.8/perl/db2x_texixml.pl 2006-04-20 05:02:31.000000000 +0200
|
||||
+++ docbook2X-0.8.8/perl/db2x_texixml.pl 2008-03-12 15:36:55.000000000 +0100
|
||||
@@ -432,8 +432,12 @@ sub texi_openfile {
|
||||
$openstr = '>-';
|
||||
}
|
||||
} else {
|
||||
+ if(not $self->{options}->{'to-stdout'}) {
|
||||
$openstr .= '> ' . shell_quote($filename);
|
||||
print "$filename\n"
|
||||
if $self->{options}->{'list-files'};
|
||||
+ } else {
|
||||
+ $openstr = '>-';
|
||||
+ }
|
||||
}
|
||||
}
|
||||
59
pkgs/tools/typesetting/docbook2x/default.nix
Normal file
59
pkgs/tools/typesetting/docbook2x/default.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{ fetchurl, lib, stdenv, texinfo, perlPackages
|
||||
, groff, libxml2, libxslt, gnused, libiconv, opensp
|
||||
, docbook_xml_dtd_43, bash
|
||||
, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "docbook2X";
|
||||
version = "0.8.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/docbook2x/docbook2X-${version}.tar.gz";
|
||||
sha256 = "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0";
|
||||
};
|
||||
|
||||
# This patch makes sure that `docbook2texi --to-stdout' actually
|
||||
# writes its output to stdout instead of creating a file.
|
||||
patches = [ ./db2x_texixml-to-stdout.patch ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper perlPackages.perl texinfo libxslt ];
|
||||
buildInputs = [ groff libxml2 opensp libiconv bash ]
|
||||
++ (with perlPackages; [ perl XMLSAX XMLParser XMLNamespaceSupport ]);
|
||||
|
||||
postConfigure = ''
|
||||
# Broken substitution is used for `perl/config.pl', which leaves literal
|
||||
# `$prefix' in it.
|
||||
substituteInPlace "perl/config.pl" \
|
||||
--replace '${"\$" + "{prefix}"}' "$out"
|
||||
'';
|
||||
|
||||
doCheck = false; # fails a lot of tests
|
||||
|
||||
postInstall = ''
|
||||
perlPrograms="db2x_manxml db2x_texixml db2x_xsltproc
|
||||
docbook2man docbook2texi";
|
||||
for i in $perlPrograms
|
||||
do
|
||||
# XXX: We work around the fact that `wrapProgram' doesn't support
|
||||
# spaces below by inserting escaped backslashes.
|
||||
wrapProgram $out/bin/$i \
|
||||
--prefix PERL5LIB : ${with perlPackages; makeFullPerlPath [XMLSAX XMLParser XMLNamespaceSupport]} \
|
||||
--prefix XML_CATALOG_FILES "\ " \
|
||||
"$out/share/docbook2X/dtd/catalog.xml\ $out/share/docbook2X/xslt/catalog.xml\ ${docbook_xml_dtd_43}/xml/dtd/docbook/catalog.xml"
|
||||
done
|
||||
|
||||
wrapProgram $out/bin/sgml2xml-isoent --prefix PATH : \
|
||||
"${gnused}/bin"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
longDescription = ''
|
||||
docbook2X is a software package that converts DocBook documents
|
||||
into the traditional Unix man page format and the GNU Texinfo
|
||||
format.
|
||||
'';
|
||||
license = licenses.mit;
|
||||
homepage = "http://docbook2x.sourceforge.net/";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
58
pkgs/tools/typesetting/fop/default.nix
Normal file
58
pkgs/tools/typesetting/fop/default.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{ fetchurl, lib, stdenv, ant, jdk, runtimeShell }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fop";
|
||||
version = "2.7";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://apache/xmlgraphics/fop/source/${pname}-${version}-src.tar.gz";
|
||||
sha256 = "sha256-tPGlISmJzrx9F8cnX70j3nPMVyWdkojAFDZVYlSthtQ=";
|
||||
};
|
||||
|
||||
buildInputs = [ ant jdk ];
|
||||
|
||||
# build only the "package" target, which generates the fop command.
|
||||
buildPhase = ''
|
||||
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
|
||||
ant -f fop/build.xml package
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/lib $out/share/doc/fop
|
||||
cp fop/build/*.jar fop/lib/*.jar $out/lib/
|
||||
cp -r README fop/examples/ $out/share/doc/fop/
|
||||
|
||||
# There is a fop script in the source archive, but it has many impurities.
|
||||
# Instead of patching out 90 % of the script, we write our own.
|
||||
cat > "$out/bin/fop" <<EOF
|
||||
#!${runtimeShell}
|
||||
java_exec_args="-Djava.awt.headless=true"
|
||||
exec ${jdk.jre}/bin/java \$java_exec_args -classpath "$out/lib/*" org.apache.fop.cli.Main "\$@"
|
||||
EOF
|
||||
chmod a+x $out/bin/fop
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "XML formatter driven by XSL Formatting Objects (XSL-FO)";
|
||||
longDescription = ''
|
||||
FOP is a Java application that reads a formatting object tree and then
|
||||
turns it into a wide variety of output presentations (including AFP, PCL,
|
||||
PDF, PNG, PostScript, RTF, TIFF, and plain text), or displays the result
|
||||
on-screen.
|
||||
|
||||
The formatting object tree can be in the form of an XML document (output
|
||||
by an XSLT engine like xalan) or can be passed in memory as a DOM
|
||||
Document or (in the case of xalan) SAX events.
|
||||
|
||||
This package contains the fop command line tool.
|
||||
'';
|
||||
homepage = "https://xmlgraphics.apache.org/fop/";
|
||||
license = licenses.asl20;
|
||||
sourceProvenance = with sourceTypes; [
|
||||
fromSource
|
||||
binaryBytecode # source bundles dependencies as jars
|
||||
];
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ bjornfor ];
|
||||
};
|
||||
}
|
||||
39
pkgs/tools/typesetting/git-latexdiff/default.nix
Normal file
39
pkgs/tools/typesetting/git-latexdiff/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, stdenv, fetchFromGitLab, git, bash }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.3.0";
|
||||
pname = "git-latexdiff";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
sha256 = "05fnhr1pqvj8l25vi9hdccwfk4mv2f0pfhn05whbdvf66gyl4fs9";
|
||||
rev = "v${version}";
|
||||
repo = "git-latexdiff";
|
||||
owner = "git-latexdiff";
|
||||
};
|
||||
|
||||
buildInputs = [ git bash ];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
patches = [ ./version-test.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace git-latexdiff \
|
||||
--replace "@GIT_LATEXDIFF_VERSION@" "v${version}"
|
||||
patchShebangs git-latexdiff
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $prefix/bin
|
||||
mv git-latexdiff $prefix/bin
|
||||
chmod +x $prefix/bin/git-latexdiff
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "View diff on LaTeX source files on the generated PDF files";
|
||||
homepage = "https://gitlab.com/git-latexdiff/git-latexdiff";
|
||||
maintainers = [ ];
|
||||
license = licenses.bsd3; # https://gitlab.com/git-latexdiff/git-latexdiff/issues/9
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
17
pkgs/tools/typesetting/git-latexdiff/version-test.patch
Normal file
17
pkgs/tools/typesetting/git-latexdiff/version-test.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Fix for https://gitlab.com/git-latexdiff/git-latexdiff/issues/7
|
||||
---
|
||||
--- src/git-latexdiff 2016-01-26 14:04:54.338568955 +0100
|
||||
+++ src/git-latexdiff 2016-01-26 14:40:23.700381943 +0100
|
||||
@@ -44,11 +44,7 @@
|
||||
git_latexdiff_version='@GIT_LATEXDIFF_VERSION@'
|
||||
|
||||
git_latexdiff_compute_version () {
|
||||
- if [ "$git_latexdiff_version" = '@GIT_LATEXDIFF''_VERSION@' ]; then
|
||||
- (cd "$(dirname "$0")" && git describe --tags HEAD 2>/dev/null || echo 'Unknown version')
|
||||
- else
|
||||
- echo "$git_latexdiff_version"
|
||||
- fi
|
||||
+ echo "$git_latexdiff_version"
|
||||
}
|
||||
|
||||
usage () {
|
||||
21
pkgs/tools/typesetting/halibut/default.nix
Normal file
21
pkgs/tools/typesetting/halibut/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{lib, stdenv, fetchurl, cmake, perl}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "halibut";
|
||||
version = "1.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.chiark.greenend.org.uk/~sgtatham/halibut/halibut-${version}/halibut-${version}.tar.gz";
|
||||
sha256 = "0ciikn878vivs4ayvwvr63nnhpcg12m8023xv514zxqpdxlzg85a";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake perl ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Documentation production system for software manuals";
|
||||
homepage = "https://www.chiark.greenend.org.uk/~sgtatham/halibut/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ pSub ];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
23
pkgs/tools/typesetting/hevea/default.nix
Normal file
23
pkgs/tools/typesetting/hevea/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ lib, stdenv, fetchurl, ocamlPackages }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "hevea";
|
||||
version = "2.35";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://pauillac.inria.fr/~maranget/hevea/distri/hevea-${version}.tar.gz";
|
||||
sha256 = "sha256-8Ym62l0+WzWFXf39tbJwyZT8eiNmsBJQ12E1mtZsnss=";
|
||||
};
|
||||
|
||||
buildInputs = with ocamlPackages; [ ocaml ocamlbuild ];
|
||||
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A quite complete and fast LATEX to HTML translator";
|
||||
homepage = "http://pauillac.inria.fr/~maranget/hevea/";
|
||||
license = licenses.qpl;
|
||||
maintainers = with maintainers; [ pSub ];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
32
pkgs/tools/typesetting/htmldoc/default.nix
Normal file
32
pkgs/tools/typesetting/htmldoc/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, stdenv, fetchFromGitHub, zlib, libpng, libjpeg, SystemConfiguration, Foundation, pkg-config }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "htmldoc";
|
||||
version = "1.9.15";
|
||||
src = fetchFromGitHub {
|
||||
owner = "michaelrsweet";
|
||||
repo = "htmldoc";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-WNsYJacZBYoZ8Bxj+InQ9ePvelqhU5y9nY7aikUNxEk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ zlib libpng libjpeg ]
|
||||
++ lib.optionals stdenv.isDarwin [ Foundation SystemConfiguration ];
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
description = "Converts HTML files to PostScript and PDF";
|
||||
homepage = "https://michaelrsweet.github.io/htmldoc";
|
||||
changelog = "https://github.com/michaelrsweet/htmldoc/releases/tag/v${version}";
|
||||
license = licenses.gpl2Only;
|
||||
maintainers = with maintainers; [ shanemikel ];
|
||||
platforms = platforms.unix;
|
||||
|
||||
longDescription = ''
|
||||
HTMLDOC is a program that reads HTML source files or web pages and
|
||||
generates corresponding HTML, PostScript, or PDF files with an optional
|
||||
table of contents.
|
||||
'';
|
||||
};
|
||||
}
|
||||
2
pkgs/tools/typesetting/kramdown-asciidoc/Gemfile
Normal file
2
pkgs/tools/typesetting/kramdown-asciidoc/Gemfile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
source 'https://rubygems.org'
|
||||
gem 'kramdown-asciidoc'
|
||||
15
pkgs/tools/typesetting/kramdown-asciidoc/Gemfile.lock
Normal file
15
pkgs/tools/typesetting/kramdown-asciidoc/Gemfile.lock
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
kramdown (1.17.0)
|
||||
kramdown-asciidoc (1.0.1)
|
||||
kramdown (~> 1.17.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
kramdown-asciidoc
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
36
pkgs/tools/typesetting/kramdown-asciidoc/default.nix
Normal file
36
pkgs/tools/typesetting/kramdown-asciidoc/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, bundlerApp, makeWrapper,
|
||||
# Optional dependencies, can be null
|
||||
epubcheck,
|
||||
bundlerUpdateScript
|
||||
}:
|
||||
|
||||
let
|
||||
app = bundlerApp {
|
||||
pname = "kramdown-asciidoc";
|
||||
gemdir = ./.;
|
||||
|
||||
exes = [
|
||||
"kramdoc"
|
||||
];
|
||||
|
||||
# buildInputs = [ makeWrapper ];
|
||||
|
||||
# postBuild = ''
|
||||
# wrapProgram "$out/bin/asciidoctor-epub3" \
|
||||
# ${lib.optionalString (epubcheck != null) "--set EPUBCHECK ${epubcheck}/bin/epubcheck"}
|
||||
# '';
|
||||
|
||||
# passthru = {
|
||||
# updateScript = bundlerUpdateScript "kramdown-asciidoc";
|
||||
# };
|
||||
|
||||
meta = with lib; {
|
||||
description = "A kramdown extension for converting Markdown documents to AsciiDoc";
|
||||
homepage = "https://asciidoctor.org/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
in
|
||||
app
|
||||
23
pkgs/tools/typesetting/kramdown-asciidoc/gemset.nix
Normal file
23
pkgs/tools/typesetting/kramdown-asciidoc/gemset.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
kramdown = {
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1n1c4jmrh5ig8iv1rw81s4mw4xsp4v97hvf8zkigv4hn5h542qjq";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.17.0";
|
||||
};
|
||||
kramdown-asciidoc = {
|
||||
dependencies = ["kramdown"];
|
||||
groups = ["default"];
|
||||
platforms = [];
|
||||
source = {
|
||||
remotes = ["https://rubygems.org"];
|
||||
sha256 = "1nr4hss1byhchwkqy2w0dgc7s83n0s5xm0pjms2cmckc4sbrryxi";
|
||||
type = "gem";
|
||||
};
|
||||
version = "1.0.1";
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
--- a/externs.h
|
||||
+++ b/externs.h
|
||||
@@ -260,6 +260,9 @@ If you're compiling this, you've got the
|
||||
/* that can appear correctly on one page. Can be */
|
||||
/* increased to any small positive integer. */
|
||||
/* */
|
||||
+/* MAX_FORMAT The maximum number of characters for sscanf formats */
|
||||
+/* for splitting strings with tab-delimited fields. */
|
||||
+/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
#define MAX_FULL_LENGTH 8388607 /* 2**23 - 1, about 148 metres */
|
||||
@@ -275,6 +278,7 @@ If you're compiling this, you've got the
|
||||
#define MAX_LEX_STACK 20
|
||||
#define MAX_CHARS 256
|
||||
#define MAX_HCOPIES 3
|
||||
+#define MAX_FORMAT 100
|
||||
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
--- a/z02.c
|
||||
+++ b/z02.c
|
||||
@@ -378,7 +378,7 @@ static void srcnext(void)
|
||||
if( blksize != 0 && chpt < limit )
|
||||
{ debugcond0(DLA, DD, stack_free <= 1, "srcnext: transferring.");
|
||||
col = buf;
|
||||
- while( chtbl[(*--col = *--limit)] != NEWLINE );
|
||||
+ while( col > mem_block && chtbl[(*--col = *--limit)] != NEWLINE );
|
||||
frst = col + 1; limit++; blksize = 0;
|
||||
}
|
||||
|
||||
--- a/z33.c
|
||||
+++ b/z33.c
|
||||
@@ -847,6 +847,7 @@ BOOLEAN DbRetrieve(OBJECT db, BOOLEAN ga
|
||||
BOOLEAN DbRetrieveNext(OBJECT db, BOOLEAN *gall, OBJECT *sym, FULL_CHAR *tag,
|
||||
FULL_CHAR *seq, FILE_NUM *dfnum, long *dfpos, int *dlnum, long *cont)
|
||||
{ FULL_CHAR line[MAX_BUFF], *cline, fname[MAX_BUFF]; int symnum;
|
||||
+ char format[MAX_FORMAT];
|
||||
ifdebug(DPP, D, ProfileOn("DbRetrieveNext"));
|
||||
debug2(DBS, DD, "DbRetrieveNext( %s, %ld )", string(db), *cont);
|
||||
assert(reading(db), "DbRetrieveNext: not reading");
|
||||
@@ -858,6 +859,8 @@ BOOLEAN DbRetrieveNext(OBJECT db, BOOLEA
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ sprintf(format, "%%d&%%%d[^\t]\t%%%d[^\t]\t%%*[^\t]\t%%ld\t%%d\t%%%d[^\n\f]", MAX_BUFF-1, MAX_BUFF-1, MAX_BUFF-1);
|
||||
+
|
||||
if( in_memory(db) )
|
||||
{
|
||||
/* get next entry from internal database */
|
||||
@@ -868,7 +871,7 @@ BOOLEAN DbRetrieveNext(OBJECT db, BOOLEA
|
||||
}
|
||||
cline = (FULL_CHAR *) db_lines(db)[*cont];
|
||||
*gall = (cline[0] == '0' ? 1 : 0);
|
||||
- sscanf((char *)&cline[*gall], "%d&%[^\t]\t%[^\t]\t%*[^\t]\t%ld\t%d\t%[^\n\f]",
|
||||
+ sscanf((char *)&cline[*gall], format,
|
||||
&symnum, tag, seq, dfpos, dlnum, fname);
|
||||
*cont = *cont + 1;
|
||||
}
|
||||
@@ -882,7 +885,7 @@ BOOLEAN DbRetrieveNext(OBJECT db, BOOLEA
|
||||
return FALSE;
|
||||
}
|
||||
*gall = (line[0] == '0' ? 1 : 0);
|
||||
- sscanf((char *)&line[*gall], "%d&%[^\t]\t%[^\t]\t%*[^\t]\t%ld\t%d\t%[^\n\f]",
|
||||
+ sscanf((char *)&line[*gall], format,
|
||||
&symnum, tag, seq, dfpos, dlnum, fname);
|
||||
*cont = ftell(db_filep(db));
|
||||
}
|
||||
--- a/z39.c
|
||||
+++ b/z39.c
|
||||
@@ -79,11 +79,13 @@ int strcollcmp(char *a, char *b)
|
||||
int strcollcmp(char *a, char *b)
|
||||
{ char a1[MAX_BUFF], a2[MAX_BUFF], a3[MAX_BUFF];
|
||||
char b1[MAX_BUFF], b2[MAX_BUFF], b3[MAX_BUFF];
|
||||
+ char format[MAX_FORMAT];
|
||||
int order;
|
||||
+ sprintf(format, "%%%d[^\t]\t%%%d[^\t]\t%%%d[^\t]", MAX_BUFF-1, MAX_BUFF-1, MAX_BUFF-1);
|
||||
a1[0] = a2[0] = a3[0] = '\0';
|
||||
- sscanf(a, "%[^\t]\t%[^\t]\t%[^\t]", a1, a2, a3);
|
||||
+ sscanf(a, format, a1, a2, a3);
|
||||
b1[0] = b2[0] = b3[0] = '\0';
|
||||
- sscanf(b, "%[^\t]\t%[^\t]\t%[^\t]", b1, b2, b3);
|
||||
+ sscanf(b, format, b1, b2, b3);
|
||||
order = strcoll(a1, b1);
|
||||
if( order == 0 )
|
||||
{
|
||||
@@ -251,7 +253,7 @@ FULL_CHAR *StringQuotedWord(OBJECT x)
|
||||
*q++ = CH_QUOTE;
|
||||
for( p = string(x); *p != '\0'; p++ )
|
||||
{
|
||||
- for( r = (FULL_CHAR *) quoted_string[*p]; *r != '\0'; *q++ = *r++ );
|
||||
+ for( r = (FULL_CHAR *) quoted_string[*p]; *r != '\0' && q < &buff[MAX_BUFF-2]; *q++ = *r++ );
|
||||
}
|
||||
*q++ = CH_QUOTE;
|
||||
*q++ = '\0';
|
||||
42
pkgs/tools/typesetting/lout/builder.sh
Executable file
42
pkgs/tools/typesetting/lout/builder.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
# Prepare a makefile specifying the appropriate output directories.
|
||||
#
|
||||
# Written by Ludovic Courtès <ludo@gnu.org>.
|
||||
|
||||
source "$stdenv/setup" || exit 1
|
||||
|
||||
nixMakefile="nix-makefile"
|
||||
|
||||
# Build and install documentation, PS and PDF.
|
||||
installDoc ()
|
||||
{
|
||||
echo "building and installing documentation..."
|
||||
for doc in design expert slides user
|
||||
do
|
||||
echo "building \`$doc' document..."
|
||||
if [ ! -f "doc/$doc/outfile.ps" ]
|
||||
then
|
||||
( PATH="$PWD:$PATH" ; \
|
||||
cd "doc/$doc" && lout -r4 -o outfile.ps all ) \
|
||||
|| return 1
|
||||
fi
|
||||
cp "doc/$doc/outfile.ps" "$out/doc/lout/$doc.ps" && \
|
||||
ps2pdf -dPDFSETTINGS=/prepress -sPAPERSIZE=a4 \
|
||||
"doc/$doc/outfile.ps" "$out/doc/lout/$doc.pdf"
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
unpackPhase && \
|
||||
cd lout-*.* && \
|
||||
cat makefile | \
|
||||
sed -e "s|^PREFIX[[:blank:]]*=.*\$|PREFIX = $out|g ; \
|
||||
s|^LOUTLIBDIR[[:blank:]]*=.*$|LOUTLIBDIR = \$(PREFIX)/lib/lout|g ; \
|
||||
s|^LOUTDOCDIR[[:blank:]]*=.*$|LOUTDOCDIR = \$(PREFIX)/doc/lout|g ; \
|
||||
s|^MANDIR[[:blank:]]*=.*$|MANDIR = \$(PREFIX)/man|g" \
|
||||
> "$nixMakefile" && \
|
||||
mkdir -p "$out/bin" && mkdir -p "$out/lib" \
|
||||
mkdir -p "$out/man" && mkdir -p "$out/doc/lout" && \
|
||||
make -f "$nixMakefile" CC=cc install installman && \
|
||||
installDoc && \
|
||||
fixupPhase
|
||||
58
pkgs/tools/typesetting/lout/default.nix
Normal file
58
pkgs/tools/typesetting/lout/default.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{lib, stdenv, fetchurl, ghostscript}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lout";
|
||||
version = "3.40";
|
||||
|
||||
src = fetchurl {
|
||||
urls = [
|
||||
"ftp://ftp.cs.usyd.edu.au/jeff/lout/${pname}-${version}.tar.gz"
|
||||
"mirror://savannah/lout/${pname}-${version}.tar.gz" # new!
|
||||
"mirror://sourceforge/lout/${pname}-${version}.tar.gz" # to be phased out
|
||||
# XXX: We could add the CTAN mirrors
|
||||
# (see https://www.ctan.org/tex-archive/support/lout/).
|
||||
];
|
||||
sha256 = "1gb8vb1wl7ikn269dd1c7ihqhkyrwk19jwx5kd0rdvbk6g7g25ix";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# https://build.opensuse.org/request/show/843612
|
||||
./CVE-2019-19917-and-CVE-2019-19918.patch
|
||||
];
|
||||
|
||||
buildInputs = [ ghostscript ];
|
||||
builder = ./builder.sh;
|
||||
|
||||
meta = {
|
||||
description = "Document layout system similar in style to LaTeX";
|
||||
|
||||
longDescription = ''
|
||||
The Lout document formatting system is now reads a high-level
|
||||
description of a document similar in style to LaTeX and produces
|
||||
a PostScript or plain text output file.
|
||||
|
||||
Lout offers an unprecedented range of advanced features,
|
||||
including optimal paragraph and page breaking, automatic
|
||||
hyphenation, PostScript EPS file inclusion and generation,
|
||||
equation formatting, tables, diagrams, rotation and scaling,
|
||||
sorted indexes, bibliographic databases, running headers and
|
||||
odd-even pages, automatic cross referencing, multilingual
|
||||
documents including hyphenation (most European languages are
|
||||
supported), formatting of computer programs, and much more, all
|
||||
ready to use. Furthermore, Lout is easily extended with
|
||||
definitions which are very much easier to write than troff of
|
||||
TeX macros because Lout is a high-level, purely functional
|
||||
language, the outcome of an eight-year research project that
|
||||
went back to the beginning.
|
||||
'';
|
||||
|
||||
# Author's page: http://jeffreykingston.id.au/lout/
|
||||
# Wiki: https://sourceforge.net/p/lout/wiki/
|
||||
homepage = "https://savannah.nongnu.org/projects/lout/";
|
||||
|
||||
license = lib.licenses.gpl3Plus;
|
||||
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
83
pkgs/tools/typesetting/lowdown/default.nix
Normal file
83
pkgs/tools/typesetting/lowdown/default.nix
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
{ lib, stdenv, fetchurl, fixDarwinDylibNames, which
|
||||
, enableShared ? !(stdenv.hostPlatform.isStatic)
|
||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lowdown";
|
||||
version = "0.11.1";
|
||||
|
||||
outputs = [ "out" "lib" "dev" "man" ];
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz";
|
||||
sha512 = "1l0055g8v0dygyxvk5rchp4sn1g2lakbf6hhq0wkj6nxkfpl43mkyc4vpb02r7v6iqfdwq4461dmdi78blsb3nj8b1gcjx75v7x9pa1";
|
||||
};
|
||||
|
||||
# Upstream always passes GNU-style "soname", but cctools expects "install_name".
|
||||
# Whatever name is inserted will be replaced by fixDarwinDylibNames.
|
||||
# https://github.com/kristapsdz/lowdown/issues/87
|
||||
postPatch = lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace Makefile --replace soname install_name
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ which ]
|
||||
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
|
||||
|
||||
preConfigure = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
||||
echo 'HAVE_SANDBOX_INIT=0' > configure.local
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
./configure PREFIX=''${!outputDev} \
|
||||
BINDIR=''${!outputBin}/bin \
|
||||
LIBDIR=''${!outputLib}/lib \
|
||||
MANDIR=''${!outputMan}/share/man
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"bins" # prevents shared object from being built unnecessarily
|
||||
];
|
||||
|
||||
installTargets = [
|
||||
"install"
|
||||
] ++ lib.optionals enableShared [
|
||||
"install_shared"
|
||||
] ++ lib.optionals enableStatic [
|
||||
"install_static"
|
||||
];
|
||||
|
||||
# Fix lib extension so that fixDarwinDylibNames detects it
|
||||
# Symlink liblowdown.so to liblowdown.so.1 (or equivalent)
|
||||
postInstall =
|
||||
let
|
||||
inherit (stdenv.hostPlatform.extensions) sharedLibrary;
|
||||
in
|
||||
|
||||
lib.optionalString (enableShared && stdenv.isDarwin) ''
|
||||
mv $lib/lib/liblowdown.{so.1,1.dylib}
|
||||
'' + lib.optionalString enableShared ''
|
||||
ln -s $lib/lib/liblowdown*${sharedLibrary}* $lib/lib/liblowdown${sharedLibrary}
|
||||
'';
|
||||
|
||||
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
echo '# TEST' > test.md
|
||||
$out/bin/lowdown test.md
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
||||
checkTarget = "regress";
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://kristaps.bsd.lv/lowdown/";
|
||||
description = "Simple markdown translator";
|
||||
license = licenses.isc;
|
||||
maintainers = [ maintainers.sternenseemann ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
29
pkgs/tools/typesetting/mmark/default.nix
Normal file
29
pkgs/tools/typesetting/mmark/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub, testers, mmark }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "mmark";
|
||||
version = "2.2.25";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mmarkdown";
|
||||
repo = "mmark";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-9XjNTbsB4kh7YpjUnTzSXypw9r4ZyR7GALTrYebRKAg=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-uHphMy9OVnLD6IBqfMTyRlDyyTabzZC4Vn0628P+0F4=";
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = mmark;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A powerful markdown processor in Go geared towards the IETF";
|
||||
homepage = "https://github.com/mmarkdown/mmark";
|
||||
license = with lib.licenses; bsd2;
|
||||
maintainers = with lib.maintainers; [ yrashk ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
58
pkgs/tools/typesetting/multimarkdown/default.nix
Normal file
58
pkgs/tools/typesetting/multimarkdown/default.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, perl
|
||||
, pkg-config
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "multimarkdown";
|
||||
version = "6.6.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fletcher";
|
||||
repo = "MultiMarkdown-6";
|
||||
rev = version;
|
||||
hash = "sha256-emJbY0wucoc/GdjlILoeqjwuwuPpTjXTqZN0gUKOyLg=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs tools/enumsToPerl.pl
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
perl
|
||||
pkg-config
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://fletcher.github.io/MultiMarkdown-6/introduction.html";
|
||||
description = "A derivative of Markdown that adds new syntax features";
|
||||
longDescription = ''
|
||||
MultiMarkdown is a lightweight markup language created by
|
||||
Fletcher T. Penney and based on Markdown, which supports
|
||||
more export-formats (html, latex, beamer, memoir, odf, opml,
|
||||
lyx, mmd) and implements some added features currently not
|
||||
available with plain Markdown syntax.
|
||||
|
||||
It adds the following features to Markdown:
|
||||
|
||||
- footnotes
|
||||
- tables
|
||||
- citations and bibliography (works best in LaTeX using BibTeX)
|
||||
- math support
|
||||
- automatic cross-referencing ability
|
||||
- smart typography, with support for multiple languages
|
||||
- image attributes
|
||||
- table and image captions
|
||||
- definition lists
|
||||
- glossary entries (LaTeX only)
|
||||
- document metadata (e.g. title, author, date, etc.)
|
||||
'';
|
||||
license = with licenses; [ mit ];
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ AndersonTorres ];
|
||||
};
|
||||
}
|
||||
90
pkgs/tools/typesetting/pdf2djvu/default.nix
Normal file
90
pkgs/tools/typesetting/pdf2djvu/default.nix
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, autoreconfHook
|
||||
, gettext
|
||||
, libtool
|
||||
, pkg-config
|
||||
, djvulibre
|
||||
, exiv2
|
||||
, fontconfig
|
||||
, graphicsmagick
|
||||
, libjpeg
|
||||
, libuuid
|
||||
, poppler
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.9.18.2";
|
||||
pname = "pdf2djvu";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jwilk";
|
||||
repo = "pdf2djvu";
|
||||
rev = version;
|
||||
sha256 = "s6n7nDO15DZSJ1EOPoNvjdFv/QtOoGiUa2b/k3kzWe8=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix build with Poppler 22.03.
|
||||
(fetchpatch {
|
||||
url = "https://github.com/jwilk/pdf2djvu/commit/e170ad557d5f13daeeac047dfaa79347bbe5062f.patch";
|
||||
sha256 = "OPK2UWVs+E2uOEaxPtLWmVL28yCxaeJKscY9ziAbS7E=";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/jwilk/pdf2djvu/commit/956fedc7e0831126b9006efedad5519c14201c52.patch";
|
||||
sha256 = "JF1xvvL2WyMu6GjdrPLlRC6eC6vGLbVurQcNy3AOOXA=";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/jwilk/pdf2djvu/commit/dca43e8182174bc04e107eaefcafcfdfdf9bcd61.patch";
|
||||
sha256 = "0JcfDaVZpuv6VfUJ2HuxRqgntZ/t8AzU0RG/E83BWGY=";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/jwilk/pdf2djvu/commit/81b635e014ebd0240a8719cc39b6a1b759cc6a98.patch";
|
||||
sha256 = "LBmT4eflLd23X7gg7IbqGe3PfTGldEGFLEKImV4nbB0=";
|
||||
postFetch = ''
|
||||
# The file was renamed after the release.
|
||||
sed -i "s/main.cc/pdf2djvu.cc/g" "$out"
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
djvulibre
|
||||
exiv2
|
||||
fontconfig
|
||||
graphicsmagick
|
||||
libjpeg
|
||||
libuuid
|
||||
poppler
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace private/autogen \
|
||||
--replace /usr/share/gettext ${gettext}/share/gettext \
|
||||
--replace /usr/share/libtool ${libtool}/share/libtool
|
||||
|
||||
substituteInPlace configure.ac \
|
||||
--replace '$djvulibre_bin_path' ${djvulibre.bin}/bin
|
||||
'';
|
||||
|
||||
preAutoreconf = ''
|
||||
private/autogen
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# Required by Poppler
|
||||
# https://github.com/jwilk/pdf2djvu/commit/373e065faf2f0d868a3700788d20a96e9528bb12
|
||||
CXXFLAGS = "-std=c++17";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Creates djvu files from PDF files";
|
||||
homepage = "https://jwilk.net/software/pdf2djvu";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ pSub ];
|
||||
};
|
||||
}
|
||||
60
pkgs/tools/typesetting/pdf2odt/default.nix
Normal file
60
pkgs/tools/typesetting/pdf2odt/default.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ lib
|
||||
, resholve
|
||||
, fetchFromGitHub
|
||||
, bc
|
||||
, coreutils
|
||||
, file
|
||||
, gawk
|
||||
, ghostscript
|
||||
, gnused
|
||||
, imagemagick
|
||||
, zip
|
||||
, bash
|
||||
, findutils
|
||||
}:
|
||||
|
||||
resholve.mkDerivation rec {
|
||||
pname = "pdf2odt";
|
||||
version = "20170207";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gutschke";
|
||||
repo = "pdf2odt";
|
||||
rev = "4533bd14306c30c085001db59dbb8114ea09c360";
|
||||
sha256 = "14f9r5f0g6jzanl54jv86ls0frvspka1p9c8dy3fnriqpm584j0r";
|
||||
};
|
||||
|
||||
patches = [ ./use_mktemp.patch ];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm0755 pdf2odt -t $out/bin
|
||||
install -Dm0644 README.md LICENSE -t $out/share/doc/pdf2odt
|
||||
|
||||
ln -rs $out/bin/pdf2odt $out/bin/pdf2ods
|
||||
'';
|
||||
solutions = {
|
||||
default = {
|
||||
scripts = [ "bin/pdf2odt" ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
inputs = [
|
||||
coreutils
|
||||
bc
|
||||
file
|
||||
imagemagick
|
||||
gawk
|
||||
gnused
|
||||
ghostscript
|
||||
zip
|
||||
findutils
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "PDF to ODT format converter";
|
||||
homepage = "https://github.com/gutschke/pdf2odt";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
19
pkgs/tools/typesetting/pdf2odt/use_mktemp.patch
Normal file
19
pkgs/tools/typesetting/pdf2odt/use_mktemp.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
diff --git a/pdf2odt b/pdf2odt
|
||||
index d38bb07..e1ddf05 100755
|
||||
--- a/pdf2odt
|
||||
+++ b/pdf2odt
|
||||
@@ -173,13 +173,7 @@ if [ -e "${out}" ] &&
|
||||
fi
|
||||
|
||||
# Set up temporary staging directory
|
||||
-TMPDIR="/tmp/pdf2odt.$$"
|
||||
-[ \! -e "${TMPDIR}" ] || {
|
||||
- echo "Staging directory ${TMPDIR} already exists" >&2
|
||||
- exit 1
|
||||
-}
|
||||
-trap 'rm -rf "${TMPDIR}"' EXIT INT TERM QUIT HUP
|
||||
-mkdir -p "${TMPDIR}"
|
||||
+TMPDIR=$(mktemp -d)
|
||||
|
||||
# Adjust DPI so that the image fits on a letter- or a4-sized page.
|
||||
function scale() {
|
||||
56
pkgs/tools/typesetting/pdfchain/default.nix
Normal file
56
pkgs/tools/typesetting/pdfchain/default.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{ lib, stdenv, fetchurl, fetchpatch
|
||||
, autoconf, gtkmm3, glib, pdftk, pkg-config, wrapGAppsHook
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pdfchain";
|
||||
version = "0.4.4.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/${pname}/${pname}-${version}/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config wrapGAppsHook autoconf
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gtkmm3 pdftk glib
|
||||
];
|
||||
|
||||
patches = let
|
||||
fetchDebianPatch = {name, sha256}: fetchpatch {
|
||||
url = "https://salsa.debian.org/debian/pdfchain/raw/2d29107756a3194fb522bdea8e9b9e393b15a8f3/debian/patches/${name}";
|
||||
inherit name sha256;
|
||||
};
|
||||
in
|
||||
[
|
||||
(fetchDebianPatch {
|
||||
name = "fix_crash_on_startup";
|
||||
sha256 = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw=";
|
||||
})
|
||||
(fetchDebianPatch {
|
||||
name = "fix_desktop_file";
|
||||
sha256 = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw=";
|
||||
})
|
||||
(fetchDebianPatch {
|
||||
name = "fix_spelling";
|
||||
sha256 = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/constant.h \
|
||||
--replace '"pdftk"' '"${pdftk}/bin/pdftk"' \
|
||||
--replace "/usr/share" "$out/share"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A graphical user interface for the PDF Toolkit (PDFtk)";
|
||||
homepage = "https://pdfchain.sourceforge.io";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ hqurve ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
28
pkgs/tools/typesetting/pdfgrep/default.nix
Normal file
28
pkgs/tools/typesetting/pdfgrep/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ lib, stdenv, fetchurl, pkg-config, poppler, libgcrypt, pcre, asciidoc }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pdfgrep";
|
||||
version = "2.1.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://pdfgrep.org/download/${pname}-${version}.tar.gz";
|
||||
sha256 = "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
for i in ./src/search.h ./src/pdfgrep.cc ./src/search.cc; do
|
||||
substituteInPlace $i --replace '<cpp/' '<'
|
||||
done
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ pkg-config asciidoc ];
|
||||
buildInputs = [ poppler libgcrypt pcre ];
|
||||
|
||||
meta = {
|
||||
description = "Commandline utility to search text in PDF files";
|
||||
homepage = "https://pdfgrep.org/";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = with lib.maintainers; [ qknight fpletz ];
|
||||
platforms = with lib.platforms; unix;
|
||||
};
|
||||
}
|
||||
31
pkgs/tools/typesetting/pdfsandwich/default.nix
Normal file
31
pkgs/tools/typesetting/pdfsandwich/default.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ lib, stdenv, ocaml, makeWrapper, fetchsvn, ghostscript, imagemagick, perl, poppler_utils, tesseract, unpaper }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
version = "0.1.7";
|
||||
pname = "pdfsandwich";
|
||||
|
||||
src = fetchsvn {
|
||||
url = "svn://svn.code.sf.net/p/pdfsandwich/code/trunk/src";
|
||||
rev = "75";
|
||||
sha256 = "1420c33divch087xrr61lvyf975bapqkgjqaighl581i69nlzsm6";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ ocaml perl ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp -p pdfsandwich $out/bin
|
||||
wrapProgram $out/bin/pdfsandwich --prefix PATH : ${lib.makeBinPath [ imagemagick ghostscript poppler_utils unpaper tesseract ]}
|
||||
|
||||
mkdir -p $out/man/man1
|
||||
cp -p pdfsandwich.1.gz $out/man/man1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "OCR tool for scanned PDFs";
|
||||
homepage = "http://www.tobias-elze.de/pdfsandwich/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = [ maintainers.rps ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
99
pkgs/tools/typesetting/pdftk/default.nix
Normal file
99
pkgs/tools/typesetting/pdftk/default.nix
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
{ lib, stdenv, fetchFromGitLab, gradle, jre, perl, writeText, runtimeShell }:
|
||||
|
||||
let
|
||||
pname = "pdftk";
|
||||
version = "3.3.2";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "pdftk-java";
|
||||
repo = "pdftk";
|
||||
rev = "v${version}";
|
||||
sha256 = "1gji1a06g3p6r4v5dx6h9kbvnf95d0lsjvp0c7daw5l8xhsrvijx";
|
||||
};
|
||||
|
||||
deps = stdenv.mkDerivation {
|
||||
pname = "${pname}-deps";
|
||||
inherit src version;
|
||||
|
||||
nativeBuildInputs = [ gradle perl ];
|
||||
|
||||
buildPhase = ''
|
||||
export GRADLE_USER_HOME=$(mktemp -d)
|
||||
gradle -Dfile.encoding=utf-8 shadowJar;
|
||||
'';
|
||||
|
||||
# Mavenize dependency paths
|
||||
# e.g. org.codehaus.groovy/groovy/2.4.0/{hash}/groovy-2.4.0.jar -> org/codehaus/groovy/groovy/2.4.0/groovy-2.4.0.jar
|
||||
installPhase = ''
|
||||
find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
|
||||
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
|
||||
| sh
|
||||
'';
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = "sha256-IlHuvFfkqM3O+3PPVBqUJzQXJELKGKHrmI1tdxsBpSk=";
|
||||
};
|
||||
|
||||
# Point to our local deps repo
|
||||
gradleInit = writeText "init.gradle" ''
|
||||
logger.lifecycle 'Replacing Maven repositories with ${deps}...'
|
||||
gradle.projectsLoaded {
|
||||
rootProject.allprojects {
|
||||
buildscript {
|
||||
repositories {
|
||||
clear()
|
||||
maven { url '${deps}' }
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
clear()
|
||||
maven { url '${deps}' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settingsEvaluated { settings ->
|
||||
settings.pluginManagement {
|
||||
repositories {
|
||||
maven { url '${deps}' }
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit pname version src;
|
||||
|
||||
nativeBuildInputs = [ gradle ];
|
||||
|
||||
buildPhase = ''
|
||||
export GRADLE_USER_HOME=$(mktemp -d)
|
||||
gradle --offline --no-daemon --info --init-script ${gradleInit} shadowJar
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{bin,share/pdftk,share/man/man1}
|
||||
cp build/libs/pdftk-all.jar $out/share/pdftk
|
||||
|
||||
cat << EOF > $out/bin/pdftk
|
||||
#!${runtimeShell}
|
||||
exec ${jre}/bin/java -jar "$out/share/pdftk/pdftk-all.jar" "\$@"
|
||||
EOF
|
||||
chmod a+x "$out/bin/pdftk"
|
||||
|
||||
cp ${src}/pdftk.1 $out/share/man/man1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Command-line tool for working with PDFs";
|
||||
homepage = "https://gitlab.com/pdftk-java/pdftk";
|
||||
sourceProvenance = with sourceTypes; [
|
||||
fromSource
|
||||
binaryBytecode # deps
|
||||
];
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ raskin averelld ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
27
pkgs/tools/typesetting/psutils/default.nix
Normal file
27
pkgs/tools/typesetting/psutils/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib, stdenv, fetchurl, perl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "psutils";
|
||||
version = "17";
|
||||
|
||||
src = fetchurl {
|
||||
url = "ftp://ftp.knackered.org/pub/psutils/psutils-p${version}.tar.gz";
|
||||
sha256 = "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq";
|
||||
};
|
||||
|
||||
configurePhase = ''
|
||||
sed -e 's,/usr/local/bin/perl,${perl}/bin/perl,' \
|
||||
-e "s,/usr/local,$out," \
|
||||
Makefile.unix > Makefile
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/bin $out/share/man/man1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Collection of useful utilities for manipulating PS documents";
|
||||
homepage = "http://knackered.knackered.org/angus/psutils/";
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
}
|
||||
43
pkgs/tools/typesetting/rubber/default.nix
Normal file
43
pkgs/tools/typesetting/rubber/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ fetchurl, lib, stdenv, python3Packages, texinfo }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "rubber";
|
||||
version = "1.5.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://launchpad.net/rubber/trunk/${version}/+download/${pname}-${version}.tar.gz";
|
||||
sha256 = "178dmrp0mza5gqjiqgk6dqs0c10s0c517pk6k9pjbam86vf47a1p";
|
||||
};
|
||||
|
||||
# I'm sure there is a better way to pass these parameters to the build script...
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace 'pdf = True' 'pdf = False' \
|
||||
--replace '$base/man' 'share/man' \
|
||||
--replace '$base/info' 'share/info' \
|
||||
--replace '$base/share' 'share'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ texinfo ];
|
||||
|
||||
checkPhase = ''
|
||||
cd tests && ${stdenv.shell} run.sh
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Wrapper for LaTeX and friends";
|
||||
longDescription = ''
|
||||
Rubber is a program whose purpose is to handle all tasks related
|
||||
to the compilation of LaTeX documents. This includes compiling
|
||||
the document itself, of course, enough times so that all
|
||||
references are defined, and running BibTeX to manage
|
||||
bibliographic references. Automatic execution of dvips to
|
||||
produce PostScript documents is also included, as well as usage
|
||||
of pdfLaTeX to produce PDF documents.
|
||||
'';
|
||||
license = licenses.gpl2Plus;
|
||||
homepage = "https://launchpad.net/rubber";
|
||||
maintainers = with maintainers; [ ttuegel peterhoeg ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
78
pkgs/tools/typesetting/satysfi/default.nix
Normal file
78
pkgs/tools/typesetting/satysfi/default.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ruby, dune_2, ocamlPackages
|
||||
, ipaexfont, junicode, lmodern, lmmath
|
||||
}:
|
||||
let
|
||||
camlpdf = ocamlPackages.camlpdf.overrideAttrs (o: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "gfngfn";
|
||||
repo = "camlpdf";
|
||||
rev = "v2.3.1+satysfi";
|
||||
sha256 = "1s8wcqdkl1alvfcj67lhn3qdz8ikvd1v64f4q6bi4c0qj9lmp30k";
|
||||
};
|
||||
});
|
||||
otfm = ocamlPackages.otfm.overrideAttrs (o: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "gfngfn";
|
||||
repo = "otfm";
|
||||
rev = "v0.3.7+satysfi";
|
||||
sha256 = "0y8s0ij1vp1s4h5y1hn3ns76fzki2ba5ysqdib33akdav9krbj8p";
|
||||
};
|
||||
});
|
||||
yojson-with-position = ocamlPackages.buildDunePackage {
|
||||
pname = "yojson-with-position";
|
||||
version = "1.4.2";
|
||||
src = fetchFromGitHub {
|
||||
owner = "gfngfn";
|
||||
repo = "yojson-with-position";
|
||||
rev = "v1.4.2+satysfi";
|
||||
sha256 = "17s5xrnpim54d1apy972b5l08bph4c0m5kzbndk600fl0vnlirnl";
|
||||
};
|
||||
useDune2 = true;
|
||||
nativeBuildInputs = [ ocamlPackages.cppo ];
|
||||
propagatedBuildInputs = [ ocamlPackages.biniou ];
|
||||
inherit (ocamlPackages.yojson) meta;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "satysfi";
|
||||
version = "0.0.7";
|
||||
src = fetchFromGitHub {
|
||||
owner = "gfngfn";
|
||||
repo = "SATySFi";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-BmnOIplC24JMb0LSgGPh/j01rXvtl0wni3Chb347eR8=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace src/frontend/main.ml --replace \
|
||||
'/usr/local/share/satysfi"; "/usr/share/satysfi' \
|
||||
$out/share/satysfi
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ ruby dune_2 ];
|
||||
|
||||
buildInputs = [ camlpdf otfm yojson-with-position ] ++ (with ocamlPackages; [
|
||||
ocaml findlib menhir menhirLib
|
||||
batteries camlimages core_kernel ppx_deriving uutf omd cppo re
|
||||
]);
|
||||
|
||||
installPhase = ''
|
||||
cp -r ${ipaexfont}/share/fonts/opentype/* lib-satysfi/dist/fonts/
|
||||
cp -r ${junicode}/share/fonts/junicode-ttf/* lib-satysfi/dist/fonts/
|
||||
cp -r ${lmodern}/share/fonts/opentype/public/lm/* lib-satysfi/dist/fonts/
|
||||
cp -r ${lmmath}/share/fonts/opentype/latinmodern-math.otf lib-satysfi/dist/fonts/
|
||||
make install PREFIX=$out LIBDIR=$out/share/satysfi
|
||||
mkdir -p $out/share/satysfi/
|
||||
cp -r lib-satysfi/dist/ $out/share/satysfi/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/gfngfn/SATySFi";
|
||||
description = "A statically-typed, functional typesetting system";
|
||||
changelog = "https://github.com/gfngfn/SATySFi/blob/v${version}/CHANGELOG.md";
|
||||
license = licenses.lgpl3Only;
|
||||
maintainers = [ maintainers.mt-caret maintainers.marsam ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
34
pkgs/tools/typesetting/scdoc/default.nix
Normal file
34
pkgs/tools/typesetting/scdoc/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, stdenv, fetchFromSourcehut }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "scdoc";
|
||||
version = "1.11.2";
|
||||
|
||||
src = fetchFromSourcehut {
|
||||
owner = "~sircmpwn";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "07c2vmdgqifbynm19zjnrk7h102pzrriv73izmx8pmd7b3xl5mfq";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "-static" "" \
|
||||
--replace "/usr/local" "$out"
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A simple man page generator";
|
||||
longDescription = ''
|
||||
scdoc is a simple man page generator written for POSIX systems written in
|
||||
C99.
|
||||
'';
|
||||
homepage = "https://git.sr.ht/~sircmpwn/scdoc";
|
||||
changelog = "https://git.sr.ht/~sircmpwn/scdoc/refs/${version}";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ primeos ];
|
||||
};
|
||||
}
|
||||
125
pkgs/tools/typesetting/sile/default.nix
Normal file
125
pkgs/tools/typesetting/sile/default.nix
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
{ lib, stdenv
|
||||
, darwin
|
||||
, fetchurl
|
||||
, makeWrapper
|
||||
, pkg-config
|
||||
, poppler_utils
|
||||
, gitMinimal
|
||||
, harfbuzz
|
||||
, icu
|
||||
, fontconfig
|
||||
, lua
|
||||
, libiconv
|
||||
, makeFontsConf
|
||||
, gentium
|
||||
}:
|
||||
|
||||
let
|
||||
luaEnv = lua.withPackages(ps: with ps; [
|
||||
cassowary
|
||||
cosmo
|
||||
linenoise
|
||||
lpeg
|
||||
lua-zlib
|
||||
lua_cliargs
|
||||
luaepnf
|
||||
luaexpat
|
||||
luafilesystem
|
||||
luarepl
|
||||
luasec
|
||||
luasocket
|
||||
luautf8
|
||||
penlight
|
||||
stdlib
|
||||
vstruct
|
||||
] ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [
|
||||
bit32
|
||||
] ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [
|
||||
compat53
|
||||
]);
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sile";
|
||||
version = "0.12.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/sile-typesetter/sile/releases/download/v${version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "0z9wdiqwarysh3lhxss3w53vq58ml46bdi9ymr853kfl7m4gz5yy";
|
||||
};
|
||||
|
||||
configureFlags = [
|
||||
"--with-system-luarocks"
|
||||
"--with-manual"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
gitMinimal
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [
|
||||
luaEnv
|
||||
harfbuzz
|
||||
icu
|
||||
fontconfig
|
||||
libiconv
|
||||
]
|
||||
++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AppKit
|
||||
;
|
||||
checkInputs = [
|
||||
poppler_utils
|
||||
];
|
||||
passthru = {
|
||||
# So it will be easier to inspect this environment, in comparison to others
|
||||
inherit luaEnv;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs build-aux/*.sh
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
sed -i -e 's|@import AppKit;|#import <AppKit/AppKit.h>|' src/macfonts.m
|
||||
'';
|
||||
|
||||
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework AppKit";
|
||||
|
||||
FONTCONFIG_FILE = makeFontsConf {
|
||||
fontDirectories = [
|
||||
gentium
|
||||
];
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
preBuild = lib.optionalString stdenv.cc.isClang ''
|
||||
substituteInPlace libtexpdf/dpxutil.c \
|
||||
--replace "ASSERT(ht && ht->table && iter);" "ASSERT(ht && iter);"
|
||||
'';
|
||||
|
||||
# Hack to avoid TMPDIR in RPATHs.
|
||||
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
||||
|
||||
outputs = [ "out" "doc" "man" "dev" ];
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
description = "A typesetting system";
|
||||
longDescription = ''
|
||||
SILE is a typesetting system; its job is to produce beautiful
|
||||
printed documents. Conceptually, SILE is similar to TeX—from
|
||||
which it borrows some concepts and even syntax and
|
||||
algorithms—but the similarities end there. Rather than being a
|
||||
derivative of the TeX family SILE is a new typesetting and
|
||||
layout engine written from the ground up using modern
|
||||
technologies and borrowing some ideas from graphical systems
|
||||
such as InDesign.
|
||||
'';
|
||||
homepage = "https://sile-typesetter.org";
|
||||
changelog = "https://github.com/sile-typesetter/sile/raw/v${version}/CHANGELOG.md";
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ doronbehar alerque ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
78
pkgs/tools/typesetting/skribilo/default.nix
Normal file
78
pkgs/tools/typesetting/skribilo/default.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, gettext
|
||||
, ghostscript
|
||||
, guile
|
||||
, guile-lib
|
||||
, guile-reader
|
||||
, imagemagick
|
||||
, makeWrapper
|
||||
, pkg-config
|
||||
, ploticus
|
||||
, fig2dev
|
||||
, enableEmacs ? false, emacs
|
||||
, enableLout ? true, lout
|
||||
, enableTex ? true, tex
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) optional;
|
||||
in stdenv.mkDerivation rec{
|
||||
pname = "skribilo";
|
||||
version = "0.9.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.savannah.nongnu.org/releases/skribilo/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-AIJqIcRjT7C0EO6J60gGjERdgAglh0ZU49U9XKPwvwk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [
|
||||
gettext
|
||||
ghostscript
|
||||
guile
|
||||
guile-lib
|
||||
guile-reader
|
||||
imagemagick
|
||||
ploticus
|
||||
fig2dev
|
||||
]
|
||||
++ optional enableEmacs emacs
|
||||
++ optional enableLout lout
|
||||
++ optional enableTex tex;
|
||||
|
||||
postInstall =
|
||||
let
|
||||
guileVersion = lib.versions.majorMinor guile.version;
|
||||
in
|
||||
''
|
||||
wrapProgram $out/bin/skribilo \
|
||||
--prefix GUILE_LOAD_PATH : "$out/share/guile/site/${guileVersion}:$GUILE_LOAD_PATH" \
|
||||
--prefix GUILE_LOAD_COMPILED_PATH : "$out/lib/guile/${guileVersion}/site-ccache:$GUILE_LOAD_COMPILED_PATH"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.nongnu.org/skribilo/";
|
||||
description = "The Ultimate Document Programming Framework";
|
||||
longDescription = ''
|
||||
Skribilo is a free document production tool that takes a structured
|
||||
document representation as its input and renders that document in a
|
||||
variety of output formats: HTML and Info for on-line browsing, and Lout
|
||||
and LaTeX for high-quality hard copies.
|
||||
|
||||
The input document can use Skribilo's markup language to provide
|
||||
information about the document's structure, which is similar to HTML or
|
||||
LaTeX and does not require expertise. Alternatively, it can use a simpler,
|
||||
"markup-less" format that borrows from Emacs' outline mode and from other
|
||||
conventions used in emails, Usenet and text.
|
||||
'';
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ AndersonTorres ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
# TODO: Better Emacs and TeX integration
|
||||
47
pkgs/tools/typesetting/soupault/default.nix
Normal file
47
pkgs/tools/typesetting/soupault/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ lib
|
||||
, fetchFromGitea
|
||||
, ocamlPackages
|
||||
}:
|
||||
|
||||
ocamlPackages.buildDunePackage rec {
|
||||
pname = "soupault";
|
||||
version = "4.0.1";
|
||||
|
||||
minimalOCamlVersion = "4.08";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "codeberg.org";
|
||||
owner = "PataphysicalSociety";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-Ojsup/BgXsqhRUsU6JevvuLnMtVs2Kd5kTeDvVO5BOk=";
|
||||
};
|
||||
|
||||
buildInputs = with ocamlPackages; [
|
||||
base64
|
||||
camomile
|
||||
containers
|
||||
ezjsonm
|
||||
fileutils
|
||||
fmt
|
||||
jingoo
|
||||
lambdasoup
|
||||
lua-ml
|
||||
logs
|
||||
markup
|
||||
odate
|
||||
otoml
|
||||
re
|
||||
spelll
|
||||
tsort
|
||||
yaml
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "A tool that helps you create and manage static websites";
|
||||
homepage = "https://soupault.app/";
|
||||
changelog = "https://codeberg.org/PataphysicalSociety/soupault/src/branch/main/CHANGELOG.md";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ toastal ];
|
||||
};
|
||||
}
|
||||
38
pkgs/tools/typesetting/sshlatex/default.nix
Normal file
38
pkgs/tools/typesetting/sshlatex/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, stdenv, fetchFromGitHub, inotify-tools, openssh, perl, gnutar, bash, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sshlatex";
|
||||
version = "0.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "iblech";
|
||||
repo = "sshlatex";
|
||||
rev = version;
|
||||
sha256 = "0kaah8is74zba9373xccmsxmnnn6kh0isr4qpg21x3qhdzhlxl7q";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = let
|
||||
binPath = lib.makeBinPath [ openssh perl gnutar bash inotify-tools ];
|
||||
in ''
|
||||
mkdir -p $out/bin
|
||||
cp sshlatex $out/bin
|
||||
wrapProgram $out/bin/sshlatex --prefix PATH : "${binPath}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A collection of hacks to efficiently run LaTeX via ssh";
|
||||
longDescription = ''
|
||||
sshlatex is a tool which uploads LaTeX source files to a remote, runs
|
||||
LaTeX there, and streams the resulting PDF file to the local host.
|
||||
Because sshlatex prestarts LaTeX with the previous run's preamble,
|
||||
thereby preloading the required LaTeX packages, it is also useful in a
|
||||
purely local setting.
|
||||
'';
|
||||
homepage = "https://github.com/iblech/sshlatex";
|
||||
license = lib.licenses.gpl3Plus; # actually dual-licensed gpl3Plus | lppl13cplus
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = [ maintainers.iblech ];
|
||||
};
|
||||
}
|
||||
57
pkgs/tools/typesetting/tectonic/default.nix
Normal file
57
pkgs/tools/typesetting/tectonic/default.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rustPlatform
|
||||
, darwin
|
||||
, fontconfig
|
||||
, harfbuzz
|
||||
, openssl
|
||||
, pkg-config
|
||||
, makeWrapper
|
||||
, biber
|
||||
, icu
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "tectonic";
|
||||
version = "0.9.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tectonic-typesetting";
|
||||
repo = "tectonic";
|
||||
rev = "tectonic@${version}";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "mfIEfue64kG4NmIEdTPRAqt6y22XfcgH6GtvJxuH6TU=";
|
||||
};
|
||||
|
||||
cargoSha256 = "CH1FdZ7cPrE0V0yjauOjDKrRNioC3MjtcnZaOTkMptc=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config makeWrapper ];
|
||||
|
||||
buildInputs = [ icu fontconfig harfbuzz openssl ]
|
||||
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices Cocoa Foundation ]);
|
||||
|
||||
# Tectonic runs biber when it detects it needs to run it, see:
|
||||
# https://github.com/tectonic-typesetting/tectonic/releases/tag/tectonic%400.7.0
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/tectonic \
|
||||
--prefix PATH "${lib.getBin biber}/bin"
|
||||
'' + lib.optionalString stdenv.isLinux ''
|
||||
substituteInPlace dist/appimage/tectonic.desktop \
|
||||
--replace Exec=tectonic Exec=$out/bin/tectonic
|
||||
install -D dist/appimage/tectonic.desktop -t $out/share/applications/
|
||||
install -D dist/appimage/tectonic.svg -t $out/share/icons/hicolor/scalable/apps/
|
||||
|
||||
ln -s $out/bin/tectonic $out/bin/nextonic
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive";
|
||||
homepage = "https://tectonic-typesetting.github.io/";
|
||||
changelog = "https://github.com/tectonic-typesetting/tectonic/blob/tectonic@${version}/CHANGELOG.md";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = with maintainers; [ lluchs doronbehar ];
|
||||
};
|
||||
}
|
||||
84
pkgs/tools/typesetting/ted/default.nix
Normal file
84
pkgs/tools/typesetting/ted/default.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{ lib, stdenv, fetchurl, pkg-config, zlib, pcre, xorg, libjpeg, libtiff, libpng, gtk2, libpaper, makeWrapper, ghostscript }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ted";
|
||||
version = "2.23";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://ftp.nluug.nl/pub/editors/${pname}/${pname}-${version}.src.tar.gz";
|
||||
sha256 = "0v1ipynyjklb3chd1vq26a21sjjg66sir57gi2kkrbwnpk195a9z";
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
mkdir pkgconfig-append
|
||||
pushd pkgconfig-append
|
||||
|
||||
# ted looks for libtiff, not libtiff-4 in its pkg-config invokations
|
||||
cp ${libtiff.dev}/lib/pkgconfig/libtiff-4.pc libtiff.pc
|
||||
|
||||
# ted needs a libpaper pkg-config file
|
||||
cat > libpaper.pc << EOF
|
||||
prefix=${libpaper}
|
||||
libdir=${libpaper}/lib
|
||||
includedir=${libpaper}/include
|
||||
exec_prefix=\''${prefix}
|
||||
|
||||
Name: libpaper
|
||||
Version: ${libpaper.version}
|
||||
Description: ${libpaper.meta.description}
|
||||
Libs: -L\''${libdir} -lpaper
|
||||
Cflags: -I\''${includedir}
|
||||
EOF
|
||||
|
||||
export PKG_CONFIG_PATH="$PWD:$PKG_CONFIG_PATH"
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
makeFlags = [ "CONFIGURE_OPTIONS=--with-GTK" "CONFIGURE_OPTIONS+=--prefix=$(out)" "compile.shared" ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
make tedPackage/makefile
|
||||
pushd tedPackage
|
||||
substituteInPlace makefile --replace /usr ""
|
||||
make PKGDESTDIR=$out datadir
|
||||
popd
|
||||
|
||||
pushd $out/share/Ted/examples
|
||||
for f in rtf2*.sh
|
||||
do
|
||||
makeWrapper "$PWD/$f" "$out/bin/$f" --prefix PATH : $out/bin:${lib.makeBinPath [ ghostscript ]}
|
||||
done
|
||||
popd
|
||||
|
||||
cp -v Ted/Ted $out/bin
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ pkg-config makeWrapper ];
|
||||
buildInputs = [ zlib pcre xorg.xlibsWrapper xorg.libXpm libjpeg libtiff libpng gtk2 libpaper ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "An easy rich text processor";
|
||||
longDescription = ''
|
||||
Ted is a text processor running under X Windows on Unix/Linux systems.
|
||||
Ted was developed as a standard easy light weight word processor, having
|
||||
the role of Wordpad on MS-Windows. Since then, Ted has evolved to a real
|
||||
word processor. It still has the same easy appearance and the same speed
|
||||
as the original. The possibility to type a letter, a note or a report
|
||||
with a simple light weight program on a Unix/Linux machine is clearly
|
||||
missing. Ted was made to make it possible to edit rich text documents on
|
||||
Unix/Linux in a wysiwyg way. RTF files from Ted are fully compatible with
|
||||
MS-Word. Additionally, Ted also is an RTF to PostScript and an RTF to
|
||||
Acrobat PDF converter.
|
||||
'';
|
||||
homepage = "https://nllgg.nl/Ted/";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.all;
|
||||
broken = stdenv.isDarwin;
|
||||
maintainers = with maintainers; [ obadz ];
|
||||
};
|
||||
}
|
||||
40
pkgs/tools/typesetting/tex/auctex/default.nix
Normal file
40
pkgs/tools/typesetting/tex/auctex/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, stdenv, fetchurl, emacs, texlive, ghostscript }:
|
||||
|
||||
let auctex = stdenv.mkDerivation ( rec {
|
||||
# Make this a valid tex(live-new) package;
|
||||
# the pkgs attribute is provided with a hack below.
|
||||
pname = "auctex";
|
||||
version = "12.3";
|
||||
tlType = "run";
|
||||
|
||||
outputs = [ "out" "tex" ];
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
|
||||
hash = "sha256-L9T+MLaUV8knf+IE0+g8hHK89QDI/kqBDXREBhdMqd0=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
emacs
|
||||
ghostscript
|
||||
texlive.combined.scheme-basic
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
mkdir -p "$tex"
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-lispdir=\${out}/share/emacs/site-lisp"
|
||||
"--with-texmf-dir=\${tex}"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.gnu.org/software/auctex";
|
||||
description = "Extensible package for writing and formatting TeX files in GNU Emacs and XEmacs";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
});
|
||||
|
||||
in auctex // { pkgs = [ auctex.tex ]; }
|
||||
48
pkgs/tools/typesetting/tex/blahtexml/default.nix
Normal file
48
pkgs/tools/typesetting/tex/blahtexml/default.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ fetchFromGitHub, lib, stdenv, libiconv, texlive, xercesc }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "blahtexml";
|
||||
version = "0.9+date=2020-05-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gvanas";
|
||||
repo = "blahtexml";
|
||||
rev = "92f2c5ff1f2b00a541b2222facc51ec72e5f6559";
|
||||
hash = "sha256-ts+2gWsp7+rQu1US2/qEdbttB2Ps12efTSrcioZYsmE=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
nativeBuildInputs = [ texlive.combined.scheme-full ];
|
||||
buildInputs = [ xercesc ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
|
||||
|
||||
buildFlags =
|
||||
[ "doc" ] ++
|
||||
(if stdenv.isDarwin
|
||||
then [ "blahtex-mac" "blahtexml-mac" ]
|
||||
else [ "blahtex-linux" "blahtexml-linux" ]);
|
||||
|
||||
installPhase = ''
|
||||
install -D -t "$out/bin" blahtex blahtexml
|
||||
install -m644 -D -t "$doc/share/doc/blahtexml" Documentation/manual.pdf
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://gva.noekeon.org/blahtexml/";
|
||||
description = "A TeX to MathML converter";
|
||||
longDescription = ''
|
||||
Blahtex is a program written in C++, which converts an equation given in
|
||||
a syntax close to TeX into MathML. It is designed by David Harvey and is
|
||||
aimed at supporting equations in MediaWiki.
|
||||
|
||||
Blahtexml is a simple extension of blahtex, written by Gilles Van Assche.
|
||||
In addition to the functionality of blahtex, blahtexml has XML processing
|
||||
in mind and is able to process a whole XML document into another XML
|
||||
document. Instead of converting only one formula at a time, blahtexml can
|
||||
convert all the formulas of the given XML file into MathML.
|
||||
'';
|
||||
license = licenses.bsd3;
|
||||
maintainers = [ maintainers.xworld21 ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
66
pkgs/tools/typesetting/tex/dblatex/default.nix
Normal file
66
pkgs/tools/typesetting/tex/dblatex/default.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ lib, stdenv, fetchurl, python3, libxslt, texlive
|
||||
, enableAllFeatures ? false, imagemagick, fig2dev, inkscape, fontconfig, ghostscript
|
||||
|
||||
, tex ? texlive.combine { # satisfy all packages that ./configure mentions
|
||||
inherit (texlive) scheme-basic epstopdf anysize appendix changebar
|
||||
fancybox fancyvrb float footmisc listings jknapltx/*for mathrsfs.sty*/
|
||||
multirow overpic pdfpages pdflscape graphics stmaryrd subfigure titlesec wasysym
|
||||
# pkgs below don't seem requested by dblatex, but our manual fails without them
|
||||
ec zapfding symbol eepic times rsfs cs tex4ht courier helvetic ly1;
|
||||
}
|
||||
}:
|
||||
|
||||
# NOTE: enableAllFeatures just purifies the expression, it doesn't actually
|
||||
# enable any extra features.
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dblatex${lib.optionalString enableAllFeatures "-full"}";
|
||||
version = "0.3.12";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/dblatex/${pname}3-${version}.tar.bz2";
|
||||
sha256 = "0yd09nypswy3q4scri1dg7dr99d7gd6r2dwx0xm81l9f4y32gs0n";
|
||||
};
|
||||
|
||||
buildInputs = [ python3 libxslt tex ]
|
||||
++ lib.optionals enableAllFeatures [ imagemagick fig2dev ];
|
||||
|
||||
# TODO: dblatex tries to execute texindy command, but nixpkgs doesn't have
|
||||
# that yet. In Ubuntu, texindy is a part of the xindy package.
|
||||
preConfigure = ''
|
||||
sed -i 's|self.install_layout == "deb"|False|' setup.py
|
||||
'' + lib.optionalString enableAllFeatures ''
|
||||
for file in $(find -name "*.py"); do
|
||||
sed -e 's|cmd = \["xsltproc|cmd = \["${libxslt.bin}/bin/xsltproc|g' \
|
||||
-e 's|Popen(\["xsltproc|Popen(\["${libxslt.bin}/bin/xsltproc|g' \
|
||||
-e 's|cmd = \["texindy|cmd = ["nixpkgs_is_missing_texindy|g' \
|
||||
-e 's|cmd = "epstopdf|cmd = "${tex}/bin/epstopdf|g' \
|
||||
-e 's|cmd = \["makeindex|cmd = ["${tex}/bin/makeindex|g' \
|
||||
-e 's|doc.program = "pdflatex"|doc.program = "${tex}/bin/pdflatex"|g' \
|
||||
-e 's|self.program = "latex"|self.program = "${tex}/bin/latex"|g' \
|
||||
-e 's|Popen("pdflatex|Popen("${tex}/bin/pdflatex|g' \
|
||||
-e 's|"fc-match"|"${fontconfig.bin}/bin/fc-match"|g' \
|
||||
-e 's|"fc-list"|"${fontconfig.bin}/bin/fc-list"|g' \
|
||||
-e 's|cmd = "inkscape|cmd = "${inkscape}/bin/inkscape|g' \
|
||||
-e 's|cmd = "fig2dev|cmd = "${fig2dev}/bin/fig2dev|g' \
|
||||
-e 's|cmd = \["ps2pdf|cmd = ["${ghostscript}/bin/ps2pdf|g' \
|
||||
-e 's|cmd = "convert|cmd = "${imagemagick.out}/bin/convert|g' \
|
||||
-i "$file"
|
||||
done
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
${python3.interpreter} ./setup.py install --prefix="$out" --use-python-path --verbose
|
||||
'';
|
||||
|
||||
passthru = { inherit tex; };
|
||||
|
||||
meta = {
|
||||
description = "A program to convert DocBook to DVI, PostScript or PDF via LaTeX or ConTeXt";
|
||||
homepage = "http://dblatex.sourceforge.net/";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
29
pkgs/tools/typesetting/tex/latexrun/default.nix
Normal file
29
pkgs/tools/typesetting/tex/latexrun/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, stdenvNoCC, fetchFromGitHub, python3 }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "latexrun";
|
||||
version = "unstable-2015-11-18";
|
||||
src = fetchFromGitHub {
|
||||
owner = "aclements";
|
||||
repo = "latexrun";
|
||||
rev = "38ff6ec2815654513c91f64bdf2a5760c85da26e";
|
||||
sha256 = "0xdl94kn0dbp6r7jk82cwxybglm9wp5qwrjqjxmvadrqix11a48w";
|
||||
};
|
||||
|
||||
buildInputs = [ python3 ];
|
||||
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp latexrun $out/bin/latexrun
|
||||
chmod +x $out/bin/latexrun
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A 21st century LaTeX wrapper";
|
||||
homepage = "https://github.com/aclements/latexrun";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.lucus16 ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
23
pkgs/tools/typesetting/tex/lkproof/default.nix
Normal file
23
pkgs/tools/typesetting/tex/lkproof/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{lib, stdenv, fetchurl, unzip}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "lkproof";
|
||||
version = "3.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://mirror.ctan.org/macros/latex/contrib/lkproof.zip";
|
||||
sha256 = "1qjkjhpc4rm62qxn18r83zdlwnj1wvnkcpdiqlv7w4bakh0gvjly";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
installPhase = "
|
||||
mkdir -p $out/share/texmf-nix/tex/generic/lkproof
|
||||
cp -prd *.sty $out/share/texmf-nix/tex/generic/lkproof
|
||||
";
|
||||
|
||||
meta = with lib; {
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl1Plus;
|
||||
};
|
||||
}
|
||||
63
pkgs/tools/typesetting/tex/mftrace/default.nix
Normal file
63
pkgs/tools/typesetting/tex/mftrace/default.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, lib
|
||||
, makeWrapper
|
||||
, autoreconfHook
|
||||
, buildEnv
|
||||
, python3
|
||||
, fontforge
|
||||
, potrace
|
||||
, texlive
|
||||
}:
|
||||
|
||||
/*
|
||||
To use with a texlive distribution, ensure that the desired fonts and
|
||||
the packages kpathsea, t1utils, metafont are available at runtime.
|
||||
|
||||
Possible overrides:
|
||||
- potrace = autotrace
|
||||
- fontforge = ghostscript (limited functionality)
|
||||
- fontforge = null (limited functionality)
|
||||
*/
|
||||
|
||||
let self = stdenv.mkDerivation rec {
|
||||
pname = "mftrace";
|
||||
version = "1.2.20";
|
||||
|
||||
# https://lilypond.org/download/sources/mftrace/mftrace-1.2.20.tar.gz
|
||||
# is incomplete, fetch repo and use autoconf instead
|
||||
# see https://github.com/hanwen/mftrace/issues/13
|
||||
src = fetchFromGitHub {
|
||||
owner = "hanwen";
|
||||
repo = "mftrace";
|
||||
rev = "release/${version}";
|
||||
sha256 = "02ik25aczkbi10jrjlnxby3fmixxrwm2k5r4fkfif3bjfym7nqbc";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper autoreconfHook python3 potrace ];
|
||||
|
||||
buildInputs = [ fontforge potrace ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/mftrace --prefix PATH : ${lib.makeBinPath buildInputs}
|
||||
'';
|
||||
|
||||
# experimental texlive.combine support
|
||||
# (note that only the bin/ folder will be combined into texlive)
|
||||
passthru.tlType = "bin";
|
||||
passthru.pkgs = [ self ] ++
|
||||
(with texlive; kpathsea.pkgs ++ t1utils.pkgs ++ metafont.pkgs);
|
||||
|
||||
meta = with lib; {
|
||||
description = "Scalable PostScript Fonts for MetaFont";
|
||||
longDescription = ''
|
||||
mftrace is a small Python program that lets you trace a TeX bitmap
|
||||
font into a PFA or PFB font (A PostScript Type1 Scalable Font) or
|
||||
TTF (TrueType) font.
|
||||
'';
|
||||
homepage = "https://lilypond.org/mftrace/";
|
||||
license = with licenses; [ gpl2Only mit ];
|
||||
maintainers = with maintainers; [ xworld21 ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}; in self
|
||||
9
pkgs/tools/typesetting/tex/nix/animatedot.sh
Normal file
9
pkgs/tools/typesetting/tex/nix/animatedot.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
source $stdenv/setup
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
for ((i = 1; i <= $nrFrames; i++)); do
|
||||
echo "producing frame $i...";
|
||||
targetName=$out/$(basename $(stripHash $dotGraph) .dot)-f-$i.dot
|
||||
cpp -DFRAME=$i < $dotGraph > $targetName
|
||||
done
|
||||
43
pkgs/tools/typesetting/tex/nix/copy-includes.pl
Normal file
43
pkgs/tools/typesetting/tex/nix/copy-includes.pl
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
use strict;
|
||||
use File::Basename;
|
||||
|
||||
sub createDirs;
|
||||
sub createDirs {
|
||||
my $path = shift;
|
||||
return unless $path =~ /^(.*)\/([^\/]*)$/;
|
||||
my $dir = $1;
|
||||
return if -d $dir;
|
||||
return if -e $dir;
|
||||
createDirs $dir;
|
||||
mkdir $dir or die "cannot create directory `$dir'";
|
||||
}
|
||||
|
||||
my $maxParents = 0;
|
||||
for (my $n = 0; $n < @ARGV; $n += 2) {
|
||||
my $fullPath = $ARGV[$n];
|
||||
my $relPath = $ARGV[$n + 1];
|
||||
my $parents = 0;
|
||||
foreach my $comp (split /\//, $relPath) {
|
||||
$parents++ if ($comp eq "..")
|
||||
}
|
||||
$maxParents = $parents if $parents > $maxParents;
|
||||
}
|
||||
|
||||
my $startDir = "./";
|
||||
for (my $n = 0; $n < $maxParents; $n++) {
|
||||
$startDir .= "dotdot/";
|
||||
mkdir "$startDir" or die "cannot create directory `$startDir': $!";
|
||||
}
|
||||
|
||||
chdir $startDir or die;
|
||||
|
||||
for (my $n = 0; $n < @ARGV; $n += 2) {
|
||||
my $fullPath = $ARGV[$n];
|
||||
my $relPath = $ARGV[$n + 1];
|
||||
|
||||
createDirs $relPath;
|
||||
|
||||
symlink $fullPath, $relPath or die "cannot create symlink `$relPath'";
|
||||
}
|
||||
|
||||
print "$startDir\n";
|
||||
249
pkgs/tools/typesetting/tex/nix/default.nix
Normal file
249
pkgs/tools/typesetting/tex/nix/default.nix
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
pkgs:
|
||||
|
||||
rec {
|
||||
|
||||
|
||||
runLaTeX =
|
||||
{ rootFile
|
||||
, generatePDF ? true # generate PDF, not DVI
|
||||
, generatePS ? false # generate PS in addition to DVI
|
||||
, extraFiles ? []
|
||||
, compressBlanksInIndex ? true
|
||||
, packages ? []
|
||||
, texPackages ? {}
|
||||
, copySources ? false
|
||||
}:
|
||||
|
||||
assert generatePDF -> !generatePS;
|
||||
|
||||
let
|
||||
tex = pkgs.texlive.combine
|
||||
# always include basic stuff you need for LaTeX
|
||||
({inherit (pkgs.texlive) scheme-basic;} // texPackages);
|
||||
in
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "doc";
|
||||
|
||||
builder = ./run-latex.sh;
|
||||
copyIncludes = ./copy-includes.pl;
|
||||
|
||||
inherit rootFile generatePDF generatePS extraFiles
|
||||
compressBlanksInIndex copySources;
|
||||
|
||||
includes = map (x: [x.key (baseNameOf (toString x.key))])
|
||||
(findLaTeXIncludes {inherit rootFile;});
|
||||
|
||||
buildInputs = [ tex pkgs.perl ] ++ packages;
|
||||
};
|
||||
|
||||
|
||||
# Returns the closure of the "dependencies" of a LaTeX source file.
|
||||
# Dependencies are other LaTeX source files (e.g. included using
|
||||
# \input{}), images (e.g. \includegraphics{}), bibliographies, and
|
||||
# so on.
|
||||
findLaTeXIncludes =
|
||||
{ rootFile
|
||||
}:
|
||||
|
||||
builtins.genericClosure {
|
||||
startSet = [{key = rootFile;}];
|
||||
|
||||
operator =
|
||||
{key, ...}:
|
||||
|
||||
let
|
||||
|
||||
# `find-includes.pl' returns the dependencies of the current
|
||||
# source file (`key') as a list, e.g. [{type = "tex"; name =
|
||||
# "introduction.tex";} {type = "img"; name = "example"}].
|
||||
# The type denotes the kind of dependency, which determines
|
||||
# what extensions we use to look for it.
|
||||
deps = import (pkgs.runCommand "latex-includes"
|
||||
{ rootFile = baseNameOf (toString rootFile); src = key; }
|
||||
"${pkgs.perl}/bin/perl ${./find-includes.pl}");
|
||||
|
||||
# Look for the dependencies of `key', trying various
|
||||
# extensions determined by the type of each dependency.
|
||||
# TODO: support a search path.
|
||||
foundDeps = dep: xs:
|
||||
let
|
||||
exts =
|
||||
if dep.type == "img" then [".pdf" ".png" ".ps" ".jpg"]
|
||||
else if dep.type == "tex" then [".tex" ""]
|
||||
else [""];
|
||||
fn = pkgs.lib.findFirst (fn: builtins.pathExists fn) null
|
||||
(map (ext: dirOf key + ("/" + dep.name + ext)) exts);
|
||||
in if fn != null then [{key = fn;}] ++ xs
|
||||
else xs;
|
||||
|
||||
in pkgs.lib.foldr foundDeps [] deps;
|
||||
};
|
||||
|
||||
|
||||
findLhs2TeXIncludes =
|
||||
{ rootFile
|
||||
}:
|
||||
|
||||
builtins.genericClosure {
|
||||
startSet = [{key = rootFile;}];
|
||||
|
||||
operator =
|
||||
{key, ...}:
|
||||
|
||||
let
|
||||
|
||||
deps = import (pkgs.runCommand "lhs2tex-includes"
|
||||
{ src = key; }
|
||||
"${pkgs.stdenv.bash}/bin/bash ${./find-lhs2tex-includes.sh}");
|
||||
|
||||
in pkgs.lib.concatMap (x: if builtins.pathExists x then [{key = x;}] else [])
|
||||
(map (x: dirOf key + ("/" + x)) deps);
|
||||
};
|
||||
|
||||
dot2pdf =
|
||||
{ dotGraph
|
||||
}:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "pdf";
|
||||
builder = ./dot2pdf.sh;
|
||||
inherit dotGraph fontsConf;
|
||||
buildInputs = [
|
||||
pkgs.perl pkgs.graphviz
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
dot2ps =
|
||||
{ dotGraph
|
||||
}:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "ps";
|
||||
builder = ./dot2ps.sh;
|
||||
inherit dotGraph;
|
||||
buildInputs = [
|
||||
pkgs.perl pkgs.graphviz pkgs.ghostscript
|
||||
];
|
||||
};
|
||||
|
||||
lhs2tex =
|
||||
{ source, flags ? null } :
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "tex";
|
||||
builder = ./lhs2tex.sh;
|
||||
inherit source flags;
|
||||
buildInputs = [ pkgs.lhs2tex pkgs.perl ];
|
||||
copyIncludes = ./copy-includes.pl;
|
||||
includes = map (x: [x.key (baseNameOf (toString x.key))])
|
||||
(findLhs2TeXIncludes {rootFile = source;});
|
||||
};
|
||||
|
||||
animateDot = dotGraph: nrFrames: pkgs.stdenv.mkDerivation {
|
||||
name = "dot-frames";
|
||||
builder = ./animatedot.sh;
|
||||
inherit dotGraph nrFrames;
|
||||
};
|
||||
|
||||
|
||||
# Wrap a piece of TeX code in a document. Useful when generating
|
||||
# inline images from TeX code.
|
||||
wrapSimpleTeX =
|
||||
{ preamble ? null
|
||||
, body
|
||||
, name ? baseNameOf (toString body)
|
||||
}:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit name preamble body;
|
||||
buildCommand = ''
|
||||
touch $out
|
||||
echo '\documentclass{article}' >> $out
|
||||
echo '\pagestyle{empty}' >> $out
|
||||
if test -n "$preamble"; then cat $preamble >> $out; fi
|
||||
echo '\begin{document}' >> $out
|
||||
cat $body >> $out
|
||||
echo '\end{document}' >> $out
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
# Convert a Postscript file to a PNG image, trimming it so that
|
||||
# there is no unnecessary surrounding whitespace.
|
||||
postscriptToPNG =
|
||||
{ postscript
|
||||
}:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "png";
|
||||
inherit postscript;
|
||||
|
||||
buildInputs = [pkgs.imagemagick pkgs.ghostscript];
|
||||
|
||||
buildCommand = ''
|
||||
if test -d $postscript; then
|
||||
input=$(ls $postscript/*.ps)
|
||||
else
|
||||
input=$(stripHash $postscript)
|
||||
ln -s $postscript $input
|
||||
fi
|
||||
|
||||
mkdir -p $out
|
||||
convert -units PixelsPerInch \
|
||||
-density 600 \
|
||||
-trim \
|
||||
-matte \
|
||||
-transparent '#ffffff' \
|
||||
-type PaletteMatte \
|
||||
+repage \
|
||||
$input \
|
||||
"$out/$(basename $input .ps).png"
|
||||
''; # */
|
||||
};
|
||||
|
||||
|
||||
# Convert a piece of TeX code to a PNG image.
|
||||
simpleTeXToPNG =
|
||||
{ preamble ? null
|
||||
, body
|
||||
, packages ? []
|
||||
}:
|
||||
|
||||
postscriptToPNG {
|
||||
postscript = runLaTeX {
|
||||
rootFile = wrapSimpleTeX {
|
||||
inherit body preamble;
|
||||
};
|
||||
inherit packages;
|
||||
generatePDF = false;
|
||||
generatePS = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# Convert a piece of TeX code to a PDF.
|
||||
simpleTeXToPDF =
|
||||
{ preamble ? null
|
||||
, body
|
||||
, packages ? []
|
||||
}:
|
||||
|
||||
runLaTeX {
|
||||
rootFile = wrapSimpleTeX {
|
||||
inherit body preamble;
|
||||
};
|
||||
inherit packages;
|
||||
};
|
||||
|
||||
|
||||
# Some tools (like dot) need a fontconfig configuration file.
|
||||
# This should be extended to allow the called to add additional
|
||||
# fonts.
|
||||
fontsConf = pkgs.makeFontsConf {
|
||||
fontDirectories = [
|
||||
"${pkgs.ghostscript}/share/ghostscript/fonts"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
20
pkgs/tools/typesetting/tex/nix/dot2pdf.sh
Normal file
20
pkgs/tools/typesetting/tex/nix/dot2pdf.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
source $stdenv/setup
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
dot2pdf() {
|
||||
sourceFile=$1
|
||||
targetName=$out/$(basename $(stripHash $sourceFile) .dot).pdf
|
||||
echo "converting $sourceFile to $targetName..."
|
||||
export FONTCONFIG_FILE=$fontsConf
|
||||
dot -Tpdf $sourceFile > $targetName
|
||||
}
|
||||
|
||||
for i in $dotGraph; do
|
||||
if test -d $i; then
|
||||
for j in $i/*; do dot2pdf $j; done
|
||||
else
|
||||
dot2pdf $i
|
||||
fi
|
||||
done
|
||||
|
||||
19
pkgs/tools/typesetting/tex/nix/dot2ps.sh
Normal file
19
pkgs/tools/typesetting/tex/nix/dot2ps.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
source $stdenv/setup
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
dot2ps() {
|
||||
sourceFile=$1
|
||||
targetName=$out/$(basename $(stripHash $sourceFile) .dot).ps
|
||||
echo "converting $sourceFile to $targetName..."
|
||||
dot -Tps $sourceFile > $targetName
|
||||
}
|
||||
|
||||
for i in $dotGraph; do
|
||||
if test -d $i; then
|
||||
for j in $i/*; do dot2ps $j; done
|
||||
else
|
||||
dot2ps $i
|
||||
fi
|
||||
done
|
||||
|
||||
69
pkgs/tools/typesetting/tex/nix/find-includes.pl
Normal file
69
pkgs/tools/typesetting/tex/nix/find-includes.pl
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
use strict;
|
||||
use File::Basename;
|
||||
|
||||
my $src = $ENV{"src"};
|
||||
my $out = $ENV{"out"};
|
||||
my $path = $ENV{"searchRelativeTo"};
|
||||
|
||||
open OUT, ">$out" or die;
|
||||
print OUT "[\n";
|
||||
|
||||
open FILE, "< $src" or die;
|
||||
|
||||
sub addName {
|
||||
my ($type, $name) = @_;
|
||||
print OUT "{ type = \"$type\"; name = \"$name\"; }\n";
|
||||
}
|
||||
|
||||
while (<FILE>) {
|
||||
if (/\\input\{(.*)\}/) {
|
||||
my $fn2 = $1;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "tex", "$fn2";
|
||||
} elsif (/\\input (.*)$/) {
|
||||
my $fn2 = $1;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "tex", "$fn2";
|
||||
} elsif (/\\RequirePackage(\[.*\])?\{(.*)\}/) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "misc", "$fn2.sty";
|
||||
} elsif (/\\usepackage(\[.*\])?\{(.*)\}/) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "misc", "$fn2.sty";
|
||||
} elsif (/\\documentclass(\[.*\])?\{(.*)\}/) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "misc", "$fn2.cls";
|
||||
} elsif (/\\bibliographystyle\{(.*)\}/) {
|
||||
my $fn2 = $1;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "misc", "$fn2.bst";
|
||||
} elsif (/\\bibliography\{(.*)\}/) {
|
||||
foreach my $bib (split /,/, $1) {
|
||||
$bib =~ s/^\s+//; # remove leading / trailing whitespace
|
||||
$bib =~ s/\s+$//;
|
||||
addName "misc", "$bib.bib";
|
||||
addName "misc", (basename($ENV{"rootFile"}, ".tex", ".ltx") . ".bbl");
|
||||
}
|
||||
} elsif (/\\includegraphics(\[.*\])?\{(.*)\}/) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "img", "$fn2";
|
||||
} elsif (/\\pgfdeclareimage(\[.*\])?\{.*\}\{(.*)\}/) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "img", "$fn2";
|
||||
} elsif (/\\pgfimage(\[.*\])?\{(.*)\}/) {
|
||||
my $fn2 = $2;
|
||||
die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
|
||||
addName "img", "$fn2";
|
||||
}
|
||||
# !!! also support \usepackage
|
||||
}
|
||||
|
||||
close FILE;
|
||||
|
||||
print OUT "]\n";
|
||||
close OUT;
|
||||
3
pkgs/tools/typesetting/tex/nix/find-lhs2tex-includes.sh
Normal file
3
pkgs/tools/typesetting/tex/nix/find-lhs2tex-includes.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
echo '[' > $out
|
||||
grep '^%include ' $src | cut -d ' ' -f 2 | sed 's/^\(.*\)$/"\1"/' >> $out
|
||||
echo ']' >> $out
|
||||
19
pkgs/tools/typesetting/tex/nix/lhs2tex.sh
Normal file
19
pkgs/tools/typesetting/tex/nix/lhs2tex.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
source $stdenv/setup
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
mkdir root
|
||||
cd root
|
||||
|
||||
startDir=$(perl $copyIncludes $includes)
|
||||
cd $startDir
|
||||
|
||||
lhstex() {
|
||||
sourceFile=$1
|
||||
targetName=$out/$(basename $(stripHash $sourceFile) .lhs).tex
|
||||
echo "converting $sourceFile to $targetName..."
|
||||
lhs2TeX -o "$targetName" $flags "$sourceFile"
|
||||
}
|
||||
|
||||
lhstex $source
|
||||
|
||||
164
pkgs/tools/typesetting/tex/nix/run-latex.sh
Normal file
164
pkgs/tools/typesetting/tex/nix/run-latex.sh
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
source $stdenv/setup
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
export VARTEXFONTS=$TMPDIR/texfonts
|
||||
export TEXMFCNF=$TMPDIR:
|
||||
echo 'max_print_line = 8192' >> $TMPDIR/texmf.cnf
|
||||
|
||||
mkdir root
|
||||
cd root
|
||||
|
||||
startDir=$(perl $copyIncludes $includes)
|
||||
cd $startDir
|
||||
|
||||
for i in $extraFiles; do
|
||||
if test -d $i; then
|
||||
ln -s $i/* .
|
||||
else
|
||||
ln -s $i $(stripHash $i)
|
||||
fi
|
||||
done
|
||||
|
||||
rootName=$(basename $(stripHash "$rootFile"))
|
||||
|
||||
rootNameBase=$(echo "$rootName" | sed 's/\..*//')
|
||||
|
||||
if test -n "$generatePDF"; then
|
||||
latex=pdflatex
|
||||
else
|
||||
latex=latex
|
||||
fi
|
||||
|
||||
latexFlags="-file-line-error"
|
||||
tmpFile=$out/log
|
||||
|
||||
showError() {
|
||||
echo
|
||||
echo "LATEX ERROR (LAST LOG LINES SHOWN):"
|
||||
tail -n 20 $tmpFile
|
||||
bzip2 $tmpFile
|
||||
exit 1
|
||||
}
|
||||
|
||||
pass=0
|
||||
|
||||
runLaTeX() {
|
||||
((pass=pass+1))
|
||||
echo "PASS $pass..."
|
||||
if ! $latex $latexFlags $rootName >$tmpFile 2>&1; then showError; fi
|
||||
runNeeded=
|
||||
if fgrep -q \
|
||||
-e "LaTeX Warning: Label(s) may have changed." \
|
||||
-e "Rerun to get citations correct." \
|
||||
-e "Please rerun LaTeX." \
|
||||
"$tmpFile"; then
|
||||
runNeeded=1
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
echo
|
||||
|
||||
|
||||
if test -n "$copySources"; then
|
||||
cp -prd $TMPDIR/root $out/tex-srcs
|
||||
fi
|
||||
|
||||
|
||||
runLaTeX
|
||||
|
||||
for auxFile in $(find . -name "*.aux"); do
|
||||
# Run bibtex to process all bibliographies. There may be several
|
||||
# when we're using the multibib package.
|
||||
if grep -q '\\citation' $auxFile; then
|
||||
auxBase=$(basename $auxFile .aux)
|
||||
if [ -e $auxBase.bbl ]; then
|
||||
echo "SKIPPING BIBTEX ON $auxFile!"
|
||||
else
|
||||
echo "RUNNING BIBTEX ON $auxFile..."
|
||||
bibtex --terse $auxBase
|
||||
cp $auxBase.bbl $out
|
||||
runNeeded=1
|
||||
fi
|
||||
echo
|
||||
fi
|
||||
|
||||
# "\pgfsyspdfmark" in the aux file seems to indicate that PGF/TikZ
|
||||
# requires a second run (e.g. to resolve arrows between pictures).
|
||||
if grep -q pgfsyspdfmark $auxFile; then
|
||||
runNeeded=1
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$runNeeded"; then
|
||||
runLaTeX
|
||||
fi
|
||||
|
||||
|
||||
if test -f $rootNameBase.idx; then
|
||||
echo "MAKING INDEX..."
|
||||
if test -n "$compressBlanksInIndex"; then
|
||||
makeindexFlags="$makeindexFlags -c"
|
||||
fi
|
||||
makeindex $makeindexFlags $rootNameBase.idx
|
||||
runNeeded=1
|
||||
echo
|
||||
fi
|
||||
|
||||
# We check that pass is less than 2 to catch situations where the document is
|
||||
# simple enough (no bibtex, etc.) so that it would otherwise require only one
|
||||
# pass but also contains a ToC.
|
||||
# In essence this check ensures that we do at least two passes on all documents.
|
||||
if test "$runNeeded" = 1 -o "$pass" -lt 2 ; then
|
||||
runLaTeX
|
||||
fi
|
||||
|
||||
if test "$runNeeded"; then
|
||||
runLaTeX
|
||||
fi
|
||||
|
||||
|
||||
if test "$runNeeded"; then
|
||||
echo "Hm, still not done :-("
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
if test -n "$generatePDF"; then
|
||||
cp $rootNameBase.pdf $out
|
||||
else
|
||||
cp $rootNameBase.dvi $out
|
||||
if test -n "$generatePS"; then
|
||||
echo "CONVERTING TO POSTSCRIPT..."
|
||||
dvips $rootNameBase.dvi -o $out/$rootNameBase.ps
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "WARNINGS:"
|
||||
cat $tmpFile | grep "Warning:" | grep -v "Citation.*undefined" || true
|
||||
|
||||
echo
|
||||
echo "OVERFULL/UNDERFULL:"
|
||||
cat $tmpFile | egrep "Overfull|Underfull" || true
|
||||
|
||||
echo
|
||||
echo "UNDEFINED REFERENCES:"
|
||||
cat $tmpFile | grep "Reference.*undefined" || true
|
||||
|
||||
echo
|
||||
echo "UNDEFINED CITATIONS:"
|
||||
cat $tmpFile | grep "Citation.*undefined" || true
|
||||
|
||||
echo
|
||||
echo "STATS:"
|
||||
printf "%5d overfull/underfull h/vboxes\n" $(cat $tmpFile | egrep -c "Overfull|Underfull" || true)
|
||||
printf "%5d undefined references\n" $(cat $tmpFile | grep -c "Reference.*undefined" || true)
|
||||
printf "%5d undefined citations\n" $(cat $tmpFile | grep -c "Citation.*undefined" || true)
|
||||
printf "%5d pages\n" \
|
||||
$(cat $tmpFile | grep "Output written.*(.*pages" | sed "s/.*(\([0-9]*\) pages.*/\1/" || true)
|
||||
echo
|
||||
|
||||
bzip2 $tmpFile
|
||||
24
pkgs/tools/typesetting/tex/pgf/1.x.nix
Normal file
24
pkgs/tools/typesetting/tex/pgf/1.x.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pgf";
|
||||
version = "1.18";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/pgf/pgf-${version}.tar.gz";
|
||||
sha256 = "0s6b8rx9yfxcjjg18vx1mphnwbd28fl5lnq0dasjz40pp3ypwdjv";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = "
|
||||
mkdir -p $out/share/texmf-nix
|
||||
cp -prd * $out/share/texmf-nix
|
||||
";
|
||||
|
||||
meta = with lib; {
|
||||
branch = "1";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl2;
|
||||
};
|
||||
}
|
||||
24
pkgs/tools/typesetting/tex/pgf/2.x.nix
Normal file
24
pkgs/tools/typesetting/tex/pgf/2.x.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pgf";
|
||||
version = "2.00";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/pgf/pgf-${version}.tar.gz";
|
||||
sha256 = "0j57niag4jb2k0iyrvjsannxljc3vkx0iag7zd35ilhiy4dh6264";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = "
|
||||
mkdir -p $out/share/texmf-nix
|
||||
cp -prd * $out/share/texmf-nix
|
||||
";
|
||||
|
||||
meta = with lib; {
|
||||
branch = "2";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl2;
|
||||
};
|
||||
}
|
||||
33
pkgs/tools/typesetting/tex/pgf/3.x.nix
Normal file
33
pkgs/tools/typesetting/tex/pgf/3.x.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, stdenv, fetchurl, unzip }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pgf";
|
||||
version = "3.0.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/pgf/pgf/version%20${version}/pgf_${version}.tds.zip";
|
||||
sha256 = "0kj769hyp4z2zmdv3f8xv443wcfqn5nkkbzxzqgfxjizlz81aav7";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
# Multiple files problem
|
||||
unpackPhase = ''
|
||||
mkdir pgf
|
||||
cd pgf
|
||||
unzip $src
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = "
|
||||
mkdir -p $out/share/texmf-nix
|
||||
cp -prd * $out/share/texmf-nix
|
||||
";
|
||||
|
||||
meta = with lib; {
|
||||
branch = "3";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl2;
|
||||
};
|
||||
}
|
||||
29
pkgs/tools/typesetting/tex/pgfplots/default.nix
Normal file
29
pkgs/tools/typesetting/tex/pgfplots/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{lib, stdenv, fetchurl, unzip}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pgfplots";
|
||||
version = "1.5.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/pgfplots/pgfplots_${version}.tds.zip";
|
||||
sha256 = "1xajrmq35i0qlsfwydy5zzg6f1jg88hqqh5b3xsmglzrarnllbdi";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
unpackPhase = "unzip $src";
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = "
|
||||
mkdir -p $out/share/texmf-nix
|
||||
cp -prd * $out/share/texmf-nix
|
||||
";
|
||||
|
||||
meta = with lib; {
|
||||
description = "TeX package to draw plots directly in TeX in two and three dimensions";
|
||||
homepage = "http://pgfplots.sourceforge.net";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl3Plus;
|
||||
};
|
||||
}
|
||||
32
pkgs/tools/typesetting/tex/pplatex/default.nix
Normal file
32
pkgs/tools/typesetting/tex/pplatex/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, pcre }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "pplatex";
|
||||
version = "unstable-2015-09-14";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "stefanhepp";
|
||||
repo = "pplatex";
|
||||
rev = "5cec891ad6aec0115081cdd114ae1cc4f1ed7c06";
|
||||
sha256 = "0wrkkbz6b6x91650nm8gccz7xghlp7b1i31fxwalz9xw3py9xygb";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
|
||||
buildInputs = [ pcre ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm555 src/pplatex "$out"/bin/pplatex
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description =
|
||||
"A tool to reformat the output of latex and friends into readable messages";
|
||||
homepage = "https://github.com/stefanhepp/pplatex";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = [ maintainers.srgom ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
13
pkgs/tools/typesetting/tex/tetex/clang.patch
Normal file
13
pkgs/tools/typesetting/tex/tetex/clang.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/texk/ps2pkm/type1.c b/texk/ps2pkm/type1.c
|
||||
index 027bf1f..4dcbad0 100644
|
||||
--- a/texk/ps2pkm/type1.c
|
||||
+++ b/texk/ps2pkm/type1.c
|
||||
@@ -800,7 +800,7 @@ static void PSFakePush(Num)
|
||||
static DOUBLE PSFakePop ()
|
||||
{
|
||||
if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]);
|
||||
- else Error0("PSFakePop : Stack empty\n");
|
||||
+ else { CC; IfTrace0(TRUE, "PSFakePop : Stack empty\n"); errflag = TRUE; return 0; }
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
57
pkgs/tools/typesetting/tex/tetex/default.nix
Normal file
57
pkgs/tools/typesetting/tex/tetex/default.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ lib, stdenv, fetchurl, flex, bison, zlib, libpng, ncurses, ed, automake }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "tetex";
|
||||
version = "3.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://mirrors.ctan.org/obsolete/systems/unix/teTeX/${version}/distrib/tetex-src-${version}.tar.gz";
|
||||
sha256 = "16v44465ipd9yyqri9rgxp6rbgs194k4sh1kckvccvdsnnp7w3ww";
|
||||
};
|
||||
|
||||
texmf = fetchurl {
|
||||
url = "http://mirrors.ctan.org/obsolete/systems/unix/teTeX/${version}/distrib/tetex-texmf-${version}.tar.gz";
|
||||
sha256 = "1hj06qvm02a2hx1a67igp45kxlbkczjlg20gr8lbp73l36k8yfvc";
|
||||
};
|
||||
|
||||
buildInputs = [ flex bison zlib libpng ncurses ed ];
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
# fixes "error: conflicting types for 'calloc'", etc.
|
||||
preBuild = lib.optionalString stdenv.isDarwin ''
|
||||
sed -i 57d texk/kpathsea/c-std.h
|
||||
'';
|
||||
|
||||
preConfigure = if stdenv.isCygwin then ''
|
||||
find ./ -name "config.guess" -exec rm {} \; -exec ln -s ${automake}/share/automake-*/config.guess {} \;
|
||||
'' else null;
|
||||
|
||||
patches = [ ./environment.patch ./getline.patch ./clang.patch ./extramembot.patch ];
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
configureFlags =
|
||||
[ "--disable-multiplatform" "--without-x11" "--without-xdvik"
|
||||
"--without-oxdvik" "--without-texinfo" "--without-texi2html"
|
||||
"--with-system-zlib" "--with-system-pnglib" "--with-system-ncurses" ]
|
||||
# couldn't get gsftopk working on darwin
|
||||
++ lib.optional stdenv.isDarwin "--without-gsftopk";
|
||||
|
||||
postUnpack = ''
|
||||
mkdir -p $out/share/texmf
|
||||
mkdir -p $out/share/texmf-dist
|
||||
gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -)
|
||||
|
||||
substituteInPlace ./tetex-src-3.0/configure --replace /usr/bin/install $(type -P install)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A full-featured (La)TeX distribution";
|
||||
homepage = "http://www.tug.org/tetex/";
|
||||
maintainers = with maintainers; [ lovek323 ];
|
||||
platforms = platforms.unix;
|
||||
hydraPlatforms = [];
|
||||
};
|
||||
}
|
||||
|
||||
35
pkgs/tools/typesetting/tex/tetex/environment.patch
Normal file
35
pkgs/tools/typesetting/tex/tetex/environment.patch
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
diff -rc --exclude=texmf.in tetex-src-3.0.orig/texk/kpathsea/texmf.in-teTeX tetex-src-3.0/texk/kpathsea/texmf.in-teTeX
|
||||
*** tetex-src-3.0.orig/texk/kpathsea/texmf.in-teTeX 2006-01-27 17:33:11.000000000 +0100
|
||||
--- tetex-src-3.0/texk/kpathsea/texmf.in-teTeX 2006-01-27 17:38:35.000000000 +0100
|
||||
***************
|
||||
*** 104,109 ****
|
||||
--- 104,115 ----
|
||||
% TEXMFCONFIG = @texmf@-config
|
||||
TEXMFCONFIG = $HOME/.texmf-config
|
||||
|
||||
+ % TEXMFNIX is supposed to be unset. It's used by the Nix
|
||||
+ % system to add trees during the build of nix-expressions.
|
||||
+
|
||||
+ % TEXMFNIXHOME, for packages in the user environment.
|
||||
+ TEXMFNIXHOME = $HOME/.nix-profile/share/texmf-nix
|
||||
+
|
||||
% Now, list all the texmf trees. If you have multiple trees you can
|
||||
% use shell brace notation, like this:
|
||||
% TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
|
||||
***************
|
||||
*** 111,117 ****
|
||||
%
|
||||
% For texconfig to work properly, TEXMFCONGIG and TEXMFVAR should be named
|
||||
% explicitly and before all other trees.
|
||||
! TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}
|
||||
|
||||
% The system trees. These are the trees that are shared by all the users.
|
||||
SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
|
||||
--- 117,123 ----
|
||||
%
|
||||
% For texconfig to work properly, TEXMFCONGIG and TEXMFVAR should be named
|
||||
% explicitly and before all other trees.
|
||||
! TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFNIX,$TEXMFHOME,$TEXMFNIXHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}
|
||||
|
||||
% The system trees. These are the trees that are shared by all the users.
|
||||
SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
|
||||
12
pkgs/tools/typesetting/tex/tetex/extramembot.patch
Normal file
12
pkgs/tools/typesetting/tex/tetex/extramembot.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
diff -up texlive-2007/texk/web2c/tex.ch.extramembot texlive-2007/texk/web2c/tex.ch
|
||||
--- texlive-2007/texk/web2c/tex.ch.extramembot 2006-12-19 02:11:11.000000000 +0100
|
||||
+++ texlive-2007/texk/web2c/tex.ch 2011-11-30 12:03:32.052795763 +0100
|
||||
@@ -365,7 +365,7 @@ for i:=@'177 to @'377 do xchr[i]:=i;
|
||||
{Initialize enc\TeX\ data.}
|
||||
for i:=0 to 255 do mubyte_read[i]:=null;
|
||||
for i:=0 to 255 do mubyte_write[i]:=0;
|
||||
-for i:=0 to 128 do mubyte_cswrite[i]:=null;
|
||||
+for i:=0 to 127 do mubyte_cswrite[i]:=null;
|
||||
mubyte_keep := 0; mubyte_start := false;
|
||||
write_noexpanding := false; cs_converting := false;
|
||||
special_printing := false; message_printing := false;
|
||||
96
pkgs/tools/typesetting/tex/tetex/getline.patch
Normal file
96
pkgs/tools/typesetting/tex/tetex/getline.patch
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
Glibc 2.10 has a `getline' symbol that clashes with teTeX's.
|
||||
Taken from http://lists.ibiblio.org/pipermail/sm-commit/2009-July/024831.html
|
||||
|
||||
diff -rc -x '*~' tetex-src-3.0-orig/texk/dvipsk/afm2tfm.c tetex-src-3.0/texk/dvipsk/afm2tfm.c
|
||||
*** tetex-src-3.0-orig/texk/dvipsk/afm2tfm.c 2005-01-30 14:17:09.000000000 +0100
|
||||
--- tetex-src-3.0/texk/dvipsk/afm2tfm.c 2010-02-03 13:50:21.000000000 +0100
|
||||
***************
|
||||
*** 257,263 ****
|
||||
}
|
||||
|
||||
int
|
||||
! getline P1H(void) {
|
||||
register char *p ;
|
||||
register int c ;
|
||||
|
||||
--- 257,263 ----
|
||||
}
|
||||
|
||||
int
|
||||
! tetex_getline P1H(void) {
|
||||
register char *p ;
|
||||
register int c ;
|
||||
|
||||
***************
|
||||
*** 606,612 ****
|
||||
ai = newchar() ;
|
||||
ai->adobenum = -1 ;
|
||||
ai->adobename = "||" ; /* boundary character name */
|
||||
! while (getline()) {
|
||||
switch(interest(paramstring())) {
|
||||
case FontName:
|
||||
fontname = paramnewstring() ;
|
||||
--- 606,612 ----
|
||||
ai = newchar() ;
|
||||
ai->adobenum = -1 ;
|
||||
ai->adobename = "||" ; /* boundary character name */
|
||||
! while (tetex_getline()) {
|
||||
switch(interest(paramstring())) {
|
||||
case FontName:
|
||||
fontname = paramnewstring() ;
|
||||
***************
|
||||
*** 1882,1888 ****
|
||||
|
||||
while (1) {
|
||||
while (param == 0 || *param == 0) {
|
||||
! if (getline() == 0)
|
||||
error("! premature end in encoding file") ;
|
||||
for (p=buffer; *p; p++)
|
||||
if (*p == '%') {
|
||||
--- 1882,1888 ----
|
||||
|
||||
while (1) {
|
||||
while (param == 0 || *param == 0) {
|
||||
! if (tetex_getline() == 0)
|
||||
error("! premature end in encoding file") ;
|
||||
for (p=buffer; *p; p++)
|
||||
if (*p == '%') {
|
||||
***************
|
||||
*** 1973,1979 ****
|
||||
p = gettoken() ;
|
||||
if (strcmp(p, "]"))
|
||||
error("! token 258 in encoding must be make-array (])") ;
|
||||
! while (getline()) {
|
||||
for (p=buffer; *p; p++)
|
||||
if (*p == '%') {
|
||||
if (ignoreligkern == 0)
|
||||
--- 1973,1979 ----
|
||||
p = gettoken() ;
|
||||
if (strcmp(p, "]"))
|
||||
error("! token 258 in encoding must be make-array (])") ;
|
||||
! while (tetex_getline()) {
|
||||
for (p=buffer; *p; p++)
|
||||
if (*p == '%') {
|
||||
if (ignoreligkern == 0)
|
||||
diff -rc -x '*~' tetex-src-3.0-orig/texk/web2c/cpascal.h tetex-src-3.0/texk/web2c/cpascal.h
|
||||
*** tetex-src-3.0-orig/texk/web2c/cpascal.h 2004-08-28 22:49:59.000000000 +0200
|
||||
--- tetex-src-3.0/texk/web2c/cpascal.h 2010-02-03 13:51:04.000000000 +0100
|
||||
***************
|
||||
*** 240,245 ****
|
||||
--- 240,255 ----
|
||||
#undef getname
|
||||
#define getname vms_getname
|
||||
#endif
|
||||
+
|
||||
+ /* Apparently POSIX 2008 has getline and glibc 2.9.90 exports it.
|
||||
+ * tangle, weave, et al. use that symbol; try to define it away so
|
||||
+ * something that a standard won't usurp.
|
||||
+ * From http://tutimura.ath.cx/ptetex/?%C6%B0%BA%EE%CA%F3%B9%F0%2F134 */
|
||||
+ #ifdef getline
|
||||
+ #undef getline
|
||||
+ #endif
|
||||
+ #define getline web2c_getline
|
||||
+
|
||||
|
||||
/* Declarations for the routines we provide ourselves in lib/. */
|
||||
|
||||
7
pkgs/tools/typesetting/tex/tetex/setup-hook.sh
Normal file
7
pkgs/tools/typesetting/tex/tetex/setup-hook.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
addTeXMFPath () {
|
||||
if test -d "$1/share/texmf-nix"; then
|
||||
export TEXINPUTS="${TEXINPUTS}${TEXINPUTS:+:}$1/share/texmf-nix//:"
|
||||
fi
|
||||
}
|
||||
|
||||
addEnvHooks "$targetOffset" addTeXMFPath
|
||||
27
pkgs/tools/typesetting/tex/tex-match/default.nix
Normal file
27
pkgs/tools/typesetting/tex/tex-match/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ rustPlatform, fetchFromGitHub, gtk3, pkg-config, glib, lib }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "tex-match";
|
||||
version = "1.2.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zoeyfyi";
|
||||
repo = "TeX-Match";
|
||||
rev = "v${version}";
|
||||
sha256 = "1yb81j7mbqqb8jcn78dx4ydp7ncbzvaczkli6cqay5jf5j6dbk1z";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config glib ];
|
||||
|
||||
buildInputs = [ gtk3 ];
|
||||
|
||||
cargoSha256 = "13ihwrckpsb4j1ai923vh151frw0yriwg9yylj9lk0ycps51y1sn";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Search through over 1000 different LaTeX symbols by sketching. A desktop version of detexify";
|
||||
homepage = "https://tex-match.zoey.fyi/";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.bootstrap-prime ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
73
pkgs/tools/typesetting/tex/texlive/UPGRADING.md
Normal file
73
pkgs/tools/typesetting/tex/texlive/UPGRADING.md
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# Notes on maintaining/upgrading
|
||||
|
||||
## Upgrading texlive.bin
|
||||
|
||||
texlive contains a few binaries, defined in bin.nix and released once a year.
|
||||
|
||||
In order to reduce closure size for users who just need a few of them, we split it into
|
||||
packages such as core, core-big, xvdi, etc. This requires making assumptions
|
||||
about dependencies between the projects that may change between releases; if
|
||||
you upgrade you may have to do some work here.
|
||||
|
||||
|
||||
## Updating the package set
|
||||
|
||||
texlive contains several thousand packages from CTAN, defined in pkgs.nix.
|
||||
|
||||
The CTAN mirrors are not version-controlled and continuously moving,
|
||||
with more than 100 updates per month.
|
||||
|
||||
To create a consistent and reproducible package set in nixpkgs, we snapshot CTAN
|
||||
and generate nix expressions for all packages in texlive at that point.
|
||||
|
||||
We mirror CTAN sources of this snapshot on community-operated servers and on IPFS.
|
||||
|
||||
To upgrade the package snapshot, follow this process:
|
||||
|
||||
|
||||
### Snapshot sources and texlive package database
|
||||
|
||||
Mirror the current CTAN archive to our mirror(s) and IPFS (URLs in `default.nix`).
|
||||
See https://tug.org/texlive/acquire-mirror.html for instructions.
|
||||
|
||||
|
||||
### Upgrade package information from texlive package database
|
||||
|
||||
|
||||
```bash
|
||||
curl -L https://texlive.info/tlnet-archive/$YEAR/$MONTH/$DAY/tlnet/tlpkg/texlive.tlpdb.xz \
|
||||
| xzcat | sed -rn -f ./tl2nix.sed | uniq > ./pkgs.nix
|
||||
```
|
||||
|
||||
This will download the daily snapshot of the CTAN package database `texlive.tlpdb.xz`
|
||||
and regenerate all of the sha512 hashes for the current upstream distribution in `pkgs.nix`.
|
||||
|
||||
Use the url
|
||||
|
||||
https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/$YEAR/tlnet-final/tlpkg/texlive.tlpdb.xz
|
||||
|
||||
for the final TeX Live release.
|
||||
|
||||
### Build packages locally and generate fix hashes
|
||||
|
||||
To save disk space and prevent unnecessary rebuilds, texlive packages are built
|
||||
as fixed-output derivations whose hashes are contained in `fixedHashes.nix`.
|
||||
|
||||
Updating the list of fixed hashes requires a local build of *all* packages,
|
||||
which is a resource-intensive process:
|
||||
|
||||
|
||||
```bash
|
||||
# move fixedHashes away, otherwise build will fail on updated packages
|
||||
mv fixedHashes.nix fixedHashes-old.nix
|
||||
# start with empty fixedHashes
|
||||
echo '{}' > fixedHashes.nix
|
||||
|
||||
nix-build ../../../../.. -Q --no-out-link -A texlive.scheme-full.pkgs | ./fixHashes.awk > ./fixedHashes-new.nix
|
||||
|
||||
mv fixedHashes-new.nix fixedHashes.nix
|
||||
```
|
||||
|
||||
### Commit changes
|
||||
|
||||
Commit the updated `pkgs.nix` and `fixedHashes.nix` to the repository.
|
||||
468
pkgs/tools/typesetting/tex/texlive/bin.nix
Normal file
468
pkgs/tools/typesetting/tex/texlive/bin.nix
Normal file
|
|
@ -0,0 +1,468 @@
|
|||
{ lib, stdenv, fetchurl
|
||||
, texlive
|
||||
, zlib, libiconv, libpng, libX11
|
||||
, freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext
|
||||
, perl, perlPackages, python3Packages, pkg-config
|
||||
, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr
|
||||
, brotli, cairo, pixman, xorg, clisp, biber, woff2, xxHash
|
||||
, makeWrapper, shortenPerlShebang
|
||||
}:
|
||||
|
||||
# Useful resource covering build options:
|
||||
# http://tug.org/texlive/doc/tlbuild.html
|
||||
|
||||
let
|
||||
withSystemLibs = map (libname: "--with-system-${libname}");
|
||||
|
||||
year = "2021";
|
||||
version = year; # keep names simple for now
|
||||
|
||||
common = {
|
||||
src = fetchurl {
|
||||
urls = [
|
||||
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0325-source.tar.xz"
|
||||
"ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0325-source.tar.xz"
|
||||
];
|
||||
sha256 = "0jsq1p66l46k2qq0gbqmx25flj2nprsz4wrd1ybn286p11kdkvvs";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
for i in texk/kpathsea/mktex*; do
|
||||
sed -i '/^mydir=/d' "$i"
|
||||
done
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-banner-add=/nixos.org"
|
||||
"--disable-missing" "--disable-native-texlive-build"
|
||||
"--enable-shared" # "--enable-cxx-runtime-hack" # static runtime
|
||||
"--enable-tex-synctex"
|
||||
"-C" # use configure cache to speed up
|
||||
]
|
||||
++ withSystemLibs [
|
||||
# see "from TL tree" vs. "Using installed" in configure output
|
||||
"zziplib" "mpfr" "gmp"
|
||||
"pixman" "potrace" "gd" "freetype2" "libpng" "libpaper" "zlib"
|
||||
];
|
||||
|
||||
# clean broken links to stuff not built
|
||||
cleanBrokenLinks = ''
|
||||
for f in "$out"/bin/*; do
|
||||
if [[ ! -x "$f" ]]; then rm "$f"; fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
withLuaJIT = !(stdenv.hostPlatform.isPower && stdenv.hostPlatform.is64bit);
|
||||
in rec { # un-indented
|
||||
|
||||
inherit (common) cleanBrokenLinks;
|
||||
texliveYear = year;
|
||||
|
||||
|
||||
core = stdenv.mkDerivation rec {
|
||||
pname = "texlive-bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src prePatch;
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [
|
||||
/*teckit*/ zziplib mpfr gmp
|
||||
pixman gd freetype libpng libpaper zlib
|
||||
perl
|
||||
];
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
preConfigure = ''
|
||||
rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \
|
||||
libs/{lua53,luajit,mpfr,pixman,zlib,zziplib}
|
||||
mkdir WorkDir
|
||||
cd WorkDir
|
||||
'';
|
||||
configureScript = "../configure";
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ [ "--without-x" ] # disable xdvik and xpdfopen
|
||||
++ map (what: "--disable-${what}") [
|
||||
"chktex"
|
||||
"dvisvgm" "dvipng" # ghostscript dependency
|
||||
"luatex" "luajittex" "luahbtex" "luajithbtex"
|
||||
"mp" "pmp" "upmp" "mf" "mflua" "mfluajit" # cairo would bring in X and more
|
||||
"xetex" "bibtexu" "bibtex8" "bibtex-x" "upmendex" # ICU isn't small
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
doCheck = false; # triptest fails, likely due to missing TEXMF tree
|
||||
preCheck = "patchShebangs ../texk/web2c";
|
||||
|
||||
installTargets = [ "install" "texlinks" ];
|
||||
|
||||
# TODO: perhaps improve texmf.cnf search locations
|
||||
postInstall = /* links format -> engine will be regenerated in texlive.combine */ ''
|
||||
PATH="$out/bin:$PATH" ${texlinks}/bin/texlinks --cnffile "$out/share/texmf-dist/web2c/fmtutil.cnf" --unlink "$out/bin"
|
||||
'' + /* a few texmf-dist files are useful; take the rest from pkgs */ ''
|
||||
mv "$out/share/texmf-dist/web2c/texmf.cnf" .
|
||||
rm -r "$out/share/texmf-dist"
|
||||
mkdir -p "$out"/share/texmf-dist/{web2c,scripts/texlive/TeXLive}
|
||||
mv ./texmf.cnf "$out/share/texmf-dist/web2c/"
|
||||
cp ../texk/tests/TeXLive/*.pm "$out/share/texmf-dist/scripts/texlive/TeXLive/"
|
||||
cp ../texk/texlive/linked_scripts/scripts.lst "$out/share/texmf-dist/scripts/texlive/"
|
||||
'' +
|
||||
(let extraScripts =
|
||||
''
|
||||
tex4ht/ht.sh
|
||||
tex4ht/htcontext.sh
|
||||
tex4ht/htcopy.pl
|
||||
tex4ht/htlatex.sh
|
||||
tex4ht/htmex.sh
|
||||
tex4ht/htmove.pl
|
||||
tex4ht/httex.sh
|
||||
tex4ht/httexi.sh
|
||||
tex4ht/htxelatex.sh
|
||||
tex4ht/htxetex.sh
|
||||
tex4ht/mk4ht.pl
|
||||
tex4ht/xhlatex.sh
|
||||
'';
|
||||
in
|
||||
''
|
||||
echo -e 'texmf_scripts="$texmf_scripts\n${extraScripts}"' \
|
||||
>> "$out/share/texmf-dist/scripts/texlive/scripts.lst"
|
||||
'')
|
||||
+ /* doc location identical with individual TeX pkgs */ ''
|
||||
mkdir -p "$doc/doc"
|
||||
mv "$out"/share/{man,info} "$doc"/doc
|
||||
'' + /* remove manpages for utils that live in texlive.texlive-scripts to avoid a conflict in buildEnv */ ''
|
||||
(cd "$doc"/doc/man/man1; rm {fmtutil-sys.1,fmtutil.1,mktexfmt.1,mktexmf.1,mktexpk.1,mktextfm.1,texhash.1,updmap-sys.1,updmap.1})
|
||||
'' + cleanBrokenLinks;
|
||||
|
||||
setupHook = ./setup-hook.sh; # TODO: maybe texmf-nix -> texmf (and all references)
|
||||
passthru = { inherit version buildInputs; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Basic binaries for TeX Live";
|
||||
homepage = "http://www.tug.org/texlive";
|
||||
license = lib.licenses.gpl2;
|
||||
maintainers = with maintainers; [ veprbl lovek323 raskin jwiegley ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
inherit (core-big) metafont mflua metapost luatex luahbtex luajittex xetex;
|
||||
core-big = stdenv.mkDerivation { #TODO: upmendex
|
||||
pname = "texlive-core-big.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src prePatch;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
inherit (core) nativeBuildInputs;
|
||||
buildInputs = core.buildInputs ++ [ core cairo harfbuzz icu graphite2 libX11 ];
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ withSystemLibs [ "kpathsea" "ptexenc" "cairo" "harfbuzz" "icu" "graphite2" ]
|
||||
++ map (prog: "--disable-${prog}") # don't build things we already have
|
||||
([ "tex" "ptex" "eptex" "uptex" "euptex" "aleph" "pdftex"
|
||||
"web-progs" "synctex"
|
||||
] ++ lib.optionals (!withLuaJIT) [ "luajittex" "luajithbtex" "mfluajit" ]);
|
||||
|
||||
configureScript = ":";
|
||||
|
||||
# we use static libtexlua, because it's only used by a single binary
|
||||
postConfigure = let
|
||||
luajit = lib.optionalString withLuaJIT ",luajit";
|
||||
in ''
|
||||
mkdir ./WorkDir && cd ./WorkDir
|
||||
for path in libs/{pplib,teckit,lua53${luajit}} texk/web2c; do
|
||||
(
|
||||
if [[ "$path" =~ "libs/lua" ]]; then
|
||||
extraConfig="--enable-static --disable-shared"
|
||||
else
|
||||
extraConfig=""
|
||||
fi
|
||||
|
||||
mkdir -p "$path" && cd "$path"
|
||||
"../../../$path/configure" $configureFlags $extraConfig
|
||||
|
||||
if [[ "$path" =~ "libs/pplib" ]]; then
|
||||
# TODO: revert for texlive 2022
|
||||
# ../../../texk/web2c/luatexdir/luamd5/md5lib.c:197:10: fatal error: 'utilsha.h' file not found
|
||||
make ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
|
||||
fi
|
||||
)
|
||||
done
|
||||
'';
|
||||
|
||||
preBuild = "cd texk/web2c";
|
||||
enableParallelBuilding = true;
|
||||
|
||||
doCheck = false; # fails
|
||||
|
||||
# now distribute stuff into outputs, roughly as upstream TL
|
||||
# (uninteresting stuff remains in $out, typically duplicates from `core`)
|
||||
outputs = [
|
||||
"out"
|
||||
"metafont"
|
||||
"mflua"
|
||||
"metapost"
|
||||
"luatex"
|
||||
"luahbtex"
|
||||
"luajittex"
|
||||
"xetex"
|
||||
];
|
||||
postInstall = ''
|
||||
for output in $outputs; do
|
||||
mkdir -p "''${!output}/bin"
|
||||
done
|
||||
|
||||
mv "$out/bin"/{inimf,mf,mf-nowin} "$metafont/bin/"
|
||||
mv "$out/bin"/mflua{,-nowin} "$mflua/bin/"
|
||||
mv "$out/bin"/{*tomp,mfplain,*mpost} "$metapost/bin/"
|
||||
mv "$out/bin"/{luatex,texlua,texluac} "$luatex/bin/"
|
||||
mv "$out/bin"/luahbtex "$luahbtex/bin/"
|
||||
mv "$out/bin"/xetex "$xetex/bin/"
|
||||
'' + lib.optionalString withLuaJIT ''
|
||||
mv "$out/bin"/mfluajit{,-nowin} "$mflua/bin/"
|
||||
mv "$out/bin"/{luajittex,luajithbtex,texluajit,texluajitc} "$luajittex/bin/"
|
||||
'' ;
|
||||
};
|
||||
|
||||
|
||||
chktex = stdenv.mkDerivation {
|
||||
pname = "texlive-chktex.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src;
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ core/*kpathsea*/ ];
|
||||
|
||||
preConfigure = "cd texk/chktex";
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ [ "--with-system-kpathsea" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
};
|
||||
|
||||
|
||||
dvisvgm = stdenv.mkDerivation rec {
|
||||
pname = "texlive-dvisvgm.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src;
|
||||
|
||||
preConfigure = "cd texk/dvisvgm";
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ [ "--with-system-kpathsea" ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ core brotli ghostscript zlib freetype woff2 potrace xxHash ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
};
|
||||
|
||||
|
||||
dvipng = stdenv.mkDerivation {
|
||||
pname = "texlive-dvipng.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src;
|
||||
|
||||
nativeBuildInputs = [ perl pkg-config makeWrapper ];
|
||||
buildInputs = [ core/*kpathsea*/ zlib libpng freetype gd ghostscript ];
|
||||
|
||||
preConfigure = ''
|
||||
cd texk/dvipng
|
||||
patchShebangs doc/texi2pod.pl
|
||||
'';
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ [ "--with-system-kpathsea" "--with-gs=yes" "--disable-debug" ];
|
||||
|
||||
GS="${ghostscript}/bin/gs";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
};
|
||||
|
||||
|
||||
latexindent = perlPackages.buildPerlPackage rec {
|
||||
pname = "latexindent";
|
||||
inherit (src) version;
|
||||
|
||||
src = lib.head (builtins.filter (p: p.tlType == "run") texlive.latexindent.pkgs);
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
|
||||
propagatedBuildInputs = with perlPackages; [ FileHomeDir LogDispatch LogLog4perl UnicodeLineBreak YAMLTiny ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace scripts/latexindent/LatexIndent/GetYamlSettings.pm \
|
||||
--replace '$FindBin::RealBin/defaultSettings.yaml' ${src}/scripts/latexindent/defaultSettings.yaml
|
||||
'';
|
||||
|
||||
# Dirty hack to apply perlFlags, but do no build
|
||||
preConfigure = ''
|
||||
touch Makefile.PL
|
||||
'';
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
install -D ./scripts/latexindent/latexindent.pl "$out"/bin/latexindent
|
||||
mkdir -p "$out"/${perl.libPrefix}
|
||||
cp -r ./scripts/latexindent/LatexIndent "$out"/${perl.libPrefix}/
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
shortenPerlShebang "$out"/bin/latexindent
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
pygmentex = python3Packages.buildPythonApplication rec {
|
||||
pname = "pygmentex";
|
||||
inherit (src) version;
|
||||
|
||||
src = lib.head (builtins.filter (p: p.tlType == "run") texlive.pygmentex.pkgs);
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ pygments chardet ];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
doCheck = false;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D ./scripts/pygmentex/pygmentex.py "$out"/bin/pygmentex
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.ctan.org/pkg/pygmentex";
|
||||
description = "Auxiliary tool for typesetting code listings in LaTeX documents using Pygments";
|
||||
longDescription = ''
|
||||
PygmenTeX is a Python-based LaTeX package that can be used for
|
||||
typesetting code listings in a LaTeX document using Pygments.
|
||||
|
||||
Pygments is a generic syntax highlighter for general use in all kinds of
|
||||
software such as forum systems, wikis or other applications that need to
|
||||
prettify source code.
|
||||
'';
|
||||
license = licenses.lppl13c;
|
||||
maintainers = with maintainers; [ romildo ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
texlinks = stdenv.mkDerivation rec {
|
||||
name = "texlinks";
|
||||
|
||||
src = lib.head (builtins.filter (p: p.tlType == "run") texlive.texlive-scripts-extra.pkgs);
|
||||
|
||||
dontBuild = true;
|
||||
doCheck = false;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# Patch texlinks.sh back to 2015 version;
|
||||
# otherwise some bin/ links break, e.g. xe(la)tex.
|
||||
patch --verbose -R scripts/texlive-extra/texlinks.sh < '${./texlinks.diff}'
|
||||
install -Dm555 scripts/texlive-extra/texlinks.sh "$out"/bin/texlinks
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
inherit biber;
|
||||
bibtexu = bibtex8;
|
||||
bibtex8 = stdenv.mkDerivation {
|
||||
pname = "texlive-bibtex-x.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src;
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ core/*kpathsea*/ icu ];
|
||||
|
||||
preConfigure = "cd texk/bibtex-x";
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ [ "--with-system-kpathsea" "--with-system-icu" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
};
|
||||
|
||||
|
||||
xdvi = stdenv.mkDerivation {
|
||||
pname = "texlive-xdvi.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src;
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ core/*kpathsea*/ freetype ghostscript ]
|
||||
++ (with xorg; [ libX11 libXaw libXi libXpm libXmu libXaw libXext libXfixes ]);
|
||||
|
||||
preConfigure = "cd texk/xdvik";
|
||||
|
||||
configureFlags = common.configureFlags
|
||||
++ [ "--with-system-kpathsea" "--with-system-libgs" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace "$out/bin/xdvi" \
|
||||
--replace "exec xdvi-xaw" "exec '$out/bin/xdvi-xaw'"
|
||||
'';
|
||||
# TODO: it's suspicious that mktexpk generates fonts into ~/.texlive2014
|
||||
};
|
||||
|
||||
} # un-indented
|
||||
|
||||
// lib.optionalAttrs (!clisp.meta.broken) # broken on aarch64 and darwin (#20062)
|
||||
{
|
||||
|
||||
xindy = stdenv.mkDerivation {
|
||||
pname = "texlive-xindy.bin";
|
||||
inherit version;
|
||||
|
||||
inherit (common) src;
|
||||
|
||||
# If unset, xindy will try to mkdir /homeless-shelter
|
||||
HOME = ".";
|
||||
|
||||
prePatch = "cd utils/xindy";
|
||||
# hardcode clisp location
|
||||
postPatch = ''
|
||||
substituteInPlace xindy-*/user-commands/xindy.in \
|
||||
--replace "our \$clisp = ( \$is_windows ? 'clisp.exe' : 'clisp' ) ;" \
|
||||
"our \$clisp = '$(type -P clisp)';"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config perl
|
||||
(texlive.combine { inherit (texlive) scheme-basic cyrillic ec; })
|
||||
];
|
||||
buildInputs = [ clisp libiconv ];
|
||||
|
||||
configureFlags = [ "--with-clisp-runtime=system" "--disable-xindy-docs" ];
|
||||
|
||||
preInstall = ''mkdir -p "$out/bin" '';
|
||||
# fixup various file-location errors of: lib/xindy/{xindy.mem,modules/}
|
||||
postInstall = ''
|
||||
mkdir -p "$out/lib/xindy"
|
||||
mv "$out"/{bin/xindy.mem,lib/xindy/}
|
||||
ln -s ../../share/texmf-dist/xindy/modules "$out/lib/xindy/"
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
314
pkgs/tools/typesetting/tex/texlive/combine.nix
Normal file
314
pkgs/tools/typesetting/tex/texlive/combine.nix
Normal file
|
|
@ -0,0 +1,314 @@
|
|||
params: with params;
|
||||
# combine =
|
||||
args@{
|
||||
pkgFilter ? (pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "core")
|
||||
, extraName ? "combined"
|
||||
, extraVersion ? ""
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
pkgSet = removeAttrs args [ "pkgFilter" "extraName" "extraVersion" ] // {
|
||||
# include a fake "core" package
|
||||
core.pkgs = [
|
||||
(bin.core.out // { pname = "core"; tlType = "bin"; })
|
||||
(bin.core.doc // { pname = "core"; tlType = "doc"; })
|
||||
];
|
||||
};
|
||||
pkgList = rec {
|
||||
all = lib.filter pkgFilter (combinePkgs pkgSet);
|
||||
splitBin = builtins.partition (p: p.tlType == "bin") all;
|
||||
bin = mkUniqueOutPaths splitBin.right
|
||||
++ lib.optional
|
||||
(lib.any (p: p.tlType == "run" && p.pname == "pdfcrop") splitBin.wrong)
|
||||
(lib.getBin ghostscript);
|
||||
nonbin = mkUniqueOutPaths splitBin.wrong;
|
||||
|
||||
# extra interpreters needed for shebangs, based on 2015 schemes "medium" and "tetex"
|
||||
# (omitted tk needed in pname == "epspdf", bin/epspdftk)
|
||||
pkgNeedsPython = pkg: pkg.tlType == "run" && lib.elem pkg.pname
|
||||
[ "de-macro" "pythontex" "dviasm" "texliveonfly" ];
|
||||
pkgNeedsRuby = pkg: pkg.tlType == "run" && pkg.pname == "match-parens";
|
||||
extraInputs =
|
||||
lib.optional (lib.any pkgNeedsPython splitBin.wrong) python3
|
||||
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
|
||||
};
|
||||
|
||||
sortedUniqueStrings = list: lib.sort (a: b: a < b) (lib.unique list);
|
||||
|
||||
mkUniqueOutPaths = pkgs: lib.unique
|
||||
(map (p: p.outPath) (builtins.filter lib.isDerivation pkgs));
|
||||
|
||||
in (buildEnv {
|
||||
name = "texlive-${extraName}-${bin.texliveYear}${extraVersion}";
|
||||
|
||||
extraPrefix = "/share/texmf";
|
||||
|
||||
ignoreCollisions = false;
|
||||
paths = pkgList.nonbin;
|
||||
pathsToLink = [
|
||||
"/"
|
||||
"/tex/generic/config" # make it a real directory for scheme-infraonly
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = pkgList.extraInputs;
|
||||
|
||||
# This is set primarily to help find-tarballs.nix to do its job
|
||||
passthru.packages = pkgList.all;
|
||||
|
||||
postBuild = ''
|
||||
cd "$out"
|
||||
mkdir -p ./bin
|
||||
'' +
|
||||
lib.concatMapStrings
|
||||
(path: ''
|
||||
for f in '${path}'/bin/*; do
|
||||
if [[ -L "$f" ]]; then
|
||||
cp -d "$f" ./bin/
|
||||
else
|
||||
ln -s "$f" ./bin/
|
||||
fi
|
||||
done
|
||||
'')
|
||||
pkgList.bin
|
||||
+
|
||||
''
|
||||
export PATH="$out/bin:$out/share/texmf/scripts/texlive:${perl}/bin:$PATH"
|
||||
export TEXMFCNF="$out/share/texmf/web2c"
|
||||
export TEXMFDIST="$out/share/texmf"
|
||||
export TEXMFSYSCONFIG="$out/share/texmf-config"
|
||||
export TEXMFSYSVAR="$out/share/texmf-var"
|
||||
export PERL5LIB="$out/share/texmf/scripts/texlive:${bin.core.out}/share/texmf-dist/scripts/texlive"
|
||||
'' +
|
||||
# patch texmf-dist -> $out/share/texmf
|
||||
# patch texmf-local -> $out/share/texmf-local
|
||||
# TODO: perhaps do lua actions?
|
||||
# tried inspiration from install-tl, sub do_texmf_cnf
|
||||
''
|
||||
patchCnfLua() {
|
||||
local cnfLua="$1"
|
||||
|
||||
if [ -e "$cnfLua" ]; then
|
||||
local cnfLuaOrig="$(realpath "$cnfLua")"
|
||||
rm ./texmfcnf.lua
|
||||
sed \
|
||||
-e 's,texmf-dist,texmf,g' \
|
||||
-e "s,\(TEXMFLOCAL[ ]*=[ ]*\)[^\,]*,\1\"$out/share/texmf-local\",g" \
|
||||
-e "s,\$SELFAUTOLOC,$out,g" \
|
||||
-e "s,selfautodir:/,$out/share/,g" \
|
||||
-e "s,selfautodir:,$out/share/,g" \
|
||||
-e "s,selfautoparent:/,$out/share/,g" \
|
||||
-e "s,selfautoparent:,$out/share/,g" \
|
||||
"$cnfLuaOrig" > "$cnfLua"
|
||||
fi
|
||||
}
|
||||
|
||||
(
|
||||
cd ./share/texmf/web2c/
|
||||
local cnfOrig="$(realpath ./texmf.cnf)"
|
||||
rm ./texmf.cnf
|
||||
sed \
|
||||
-e 's,texmf-dist,texmf,g' \
|
||||
-e "s,\$SELFAUTOLOC,$out,g" \
|
||||
-e "s,\$SELFAUTODIR,$out/share,g" \
|
||||
-e "s,\$SELFAUTOPARENT,$out/share,g" \
|
||||
-e "s,\$SELFAUTOGRANDPARENT,$out/share,g" \
|
||||
-e "/^mpost,/d" `# CVE-2016-10243` \
|
||||
"$cnfOrig" > ./texmf.cnf
|
||||
|
||||
patchCnfLua "./texmfcnf.lua"
|
||||
|
||||
mkdir $out/share/texmf-local
|
||||
)
|
||||
'' +
|
||||
# now filter hyphenation patterns and formats
|
||||
(let
|
||||
hyphens = lib.filter (p: p.hasHyphens or false && p.tlType == "run") pkgList.splitBin.wrong;
|
||||
hyphenPNames = sortedUniqueStrings (map (p: p.pname) hyphens);
|
||||
formats = lib.filter (p: p.hasFormats or false && p.tlType == "run") pkgList.splitBin.wrong;
|
||||
formatPNames = sortedUniqueStrings (map (p: p.pname) formats);
|
||||
# sed expression that prints the lines in /start/,/end/ except for /end/
|
||||
section = start: end: "/${start}/,/${end}/{ /${start}/p; /${end}/!p; };\n";
|
||||
script =
|
||||
writeText "hyphens.sed" (
|
||||
# document how the file was generated (for language.dat)
|
||||
"1{ s/^(% Generated by .*)$/\\1, modified by texlive.combine/; p; }\n"
|
||||
# pick up the header
|
||||
+ "2,/^% from/{ /^% from/!p; };\n"
|
||||
# pick up all sections matching packages that we combine
|
||||
+ lib.concatMapStrings (pname: section "^% from ${pname}:$" "^% from|^%%% No changes may be made beyond this point.$") hyphenPNames
|
||||
# pick up the footer (for language.def)
|
||||
+ "/^%%% No changes may be made beyond this point.$/,$p;\n"
|
||||
);
|
||||
scriptLua =
|
||||
writeText "hyphens.lua.sed" (
|
||||
"1{ s/^(-- Generated by .*)$/\\1, modified by texlive.combine/; p; }\n"
|
||||
+ "2,/^-- END of language.us.lua/p;\n"
|
||||
+ lib.concatMapStrings (pname: section "^-- from ${pname}:$" "^}$|^-- from") hyphenPNames
|
||||
+ "$p;\n"
|
||||
);
|
||||
fmtutilSed =
|
||||
writeText "fmtutil.sed" (
|
||||
"1{ s/^(# Generated by .*)$/\\1, modified by texlive.combine/; p; }\n"
|
||||
+ "2,/^# from/{ /^# from/!p; };\n"
|
||||
+ lib.concatMapStrings (pname: section "^# from ${pname}:$" "^# from") formatPNames
|
||||
);
|
||||
in ''
|
||||
(
|
||||
cd ./share/texmf/tex/generic/config/
|
||||
for fname in language.{dat,def}; do
|
||||
[[ -e "$fname" ]] && sed -E -n -f '${script}' -i "$fname"
|
||||
done
|
||||
[[ -e language.dat.lua ]] && sed -E -n -f '${scriptLua}' -i language.dat.lua
|
||||
)
|
||||
(
|
||||
cd ./share/texmf/web2c/
|
||||
[[ -e fmtutil.cnf ]] && sed -E -n -f '${fmtutilSed}' -i fmtutil.cnf
|
||||
)
|
||||
'') +
|
||||
|
||||
# function to wrap created executables with required env vars
|
||||
''
|
||||
wrapBin() {
|
||||
for link in ./bin/*; do
|
||||
[ -L "$link" -a -x "$link" ] || continue # if not link, assume OK
|
||||
local target=$(readlink "$link")
|
||||
|
||||
# skip simple local symlinks; mktexfmt in particular
|
||||
echo "$target" | grep / > /dev/null || continue;
|
||||
|
||||
echo -n "Wrapping '$link'"
|
||||
rm "$link"
|
||||
makeWrapper "$target" "$link" \
|
||||
--prefix PATH : "$out/bin:${perl}/bin" \
|
||||
--prefix PERL5LIB : "$PERL5LIB" \
|
||||
--set-default TEXMFCNF "$TEXMFCNF"
|
||||
|
||||
# avoid using non-nix shebang in $target by calling interpreter
|
||||
if [[ "$(head -c 2 "$target")" = "#!" ]]; then
|
||||
local cmdline="$(head -n 1 "$target" | sed 's/^\#\! *//;s/ *$//')"
|
||||
local relative=`basename "$cmdline" | sed 's/^env //' `
|
||||
local newInterp=`echo "$relative" | cut -d\ -f1`
|
||||
local params=`echo "$relative" | cut -d\ -f2- -s`
|
||||
local newPath="$(type -P "$newInterp")"
|
||||
if [[ -z "$newPath" ]]; then
|
||||
echo " Warning: unknown shebang '$cmdline' in '$target'"
|
||||
continue
|
||||
fi
|
||||
echo " and patching shebang '$cmdline'"
|
||||
sed "s|^exec |exec $newPath $params |" -i "$link"
|
||||
|
||||
elif head -n 1 "$target" | grep -q 'exec perl'; then
|
||||
# see #24343 for details of the problem
|
||||
echo " and patching weird perl shebang"
|
||||
sed "s|^exec |exec '${perl}/bin/perl' -w |" -i "$link"
|
||||
|
||||
else
|
||||
sed 's|^exec |exec -a "$0" |' -i "$link"
|
||||
echo
|
||||
fi
|
||||
done
|
||||
}
|
||||
'' +
|
||||
# texlive post-install actions
|
||||
''
|
||||
for tool in updmap; do
|
||||
ln -sf "$out/share/texmf/scripts/texlive/$tool."* "$out/bin/$tool"
|
||||
done
|
||||
'' +
|
||||
# now hack to preserve "$0" for mktexfmt
|
||||
''
|
||||
cp "$out"/share/texmf/scripts/texlive/fmtutil.pl "$out/bin/fmtutil"
|
||||
patchShebangs "$out/bin/fmtutil"
|
||||
sed "1s|$| -I $out/share/texmf/scripts/texlive|" -i "$out/bin/fmtutil"
|
||||
ln -sf fmtutil "$out/bin/mktexfmt"
|
||||
|
||||
perl `type -P mktexlsr.pl` --sort ./share/texmf
|
||||
${bin.texlinks}/bin/texlinks "$out/bin" && wrapBin
|
||||
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?
|
||||
|
||||
# Disable unavailable map files
|
||||
echo y | perl `type -P updmap.pl` --sys --syncwithtrees --force
|
||||
# Regenerate the map files (this is optional)
|
||||
perl `type -P updmap.pl` --sys --force
|
||||
|
||||
# sort entries to improve reproducibility
|
||||
[[ -f "$TEXMFSYSCONFIG"/web2c/updmap.cfg ]] && sort -o "$TEXMFSYSCONFIG"/web2c/updmap.cfg "$TEXMFSYSCONFIG"/web2c/updmap.cfg
|
||||
|
||||
perl `type -P mktexlsr.pl` --sort ./share/texmf-* # to make sure
|
||||
'' +
|
||||
# install (wrappers for) scripts, based on a list from upstream texlive
|
||||
''
|
||||
(
|
||||
cd "$out/share/texmf/scripts"
|
||||
source '${bin.core.out}/share/texmf-dist/scripts/texlive/scripts.lst'
|
||||
for s in $texmf_scripts; do
|
||||
[[ -x "./$s" ]] || continue
|
||||
tName="$(basename $s | sed 's/\.[a-z]\+$//')" # remove extension
|
||||
[[ ! -e "$out/bin/$tName" ]] || continue
|
||||
ln -sv "$(realpath $s)" "$out/bin/$tName" # wrapped below
|
||||
done
|
||||
)
|
||||
'' +
|
||||
# A hacky way to provide repstopdf
|
||||
# * Copy is done to have a correct "$0" so that epstopdf enables the restricted mode
|
||||
# * ./bin/repstopdf needs to be a symlink to be processed by wrapBin
|
||||
''
|
||||
if [[ -e ./bin/epstopdf ]]; then
|
||||
cp $(realpath ./bin/epstopdf) ./share/texmf/scripts/repstopdf
|
||||
ln -s "$out"/share/texmf/scripts/repstopdf ./bin/repstopdf
|
||||
fi
|
||||
'' +
|
||||
# finish up the wrappers
|
||||
''
|
||||
rm "$out"/bin/*-sys
|
||||
wrapBin
|
||||
'' +
|
||||
# Perform a small test to verify that the restricted mode get enabled when
|
||||
# needed (detected by checking if it disallows --gscmd)
|
||||
''
|
||||
if [[ -e ./bin/epstopdf ]]; then
|
||||
echo "Testing restricted mode for {,r}epstopdf"
|
||||
! (epstopdf --gscmd echo /dev/null 2>&1 || true) | grep forbidden
|
||||
(repstopdf --gscmd echo /dev/null 2>&1 || true) | grep forbidden
|
||||
fi
|
||||
'' +
|
||||
# TODO: a context trigger https://www.preining.info/blog/2015/06/debian-tex-live-2015-the-new-layout/
|
||||
# http://wiki.contextgarden.net/ConTeXt_Standalone#Unix-like_platforms_.28Linux.2FMacOS_X.2FFreeBSD.2FSolaris.29
|
||||
|
||||
# I would just create links from "$out"/share/{man,info},
|
||||
# but buildenv has problems with merging symlinks with directories;
|
||||
# note: it's possible we might need deepen the work-around to man/*.
|
||||
''
|
||||
for d in {man,info}; do
|
||||
[[ -e "./share/texmf/doc/$d" ]] || continue;
|
||||
(
|
||||
mkdir -p "./share/$d" && cd "./share/$d"
|
||||
ln -s -t . ../texmf/doc/"$d"/*
|
||||
)
|
||||
done
|
||||
'' +
|
||||
# MkIV uses its own lookup mechanism and we need to initialize
|
||||
# caches for it. Unsetting TEXMFCNF is needed to let mtxrun
|
||||
# determine it from kpathsea so that the config path is given with
|
||||
# "selfautodir:" as it will be in runtime. This is important because
|
||||
# the cache is identified by a hash of this path.
|
||||
''
|
||||
if [[ -e "$out/bin/mtxrun" ]]; then
|
||||
(
|
||||
unset TEXMFCNF
|
||||
mtxrun --generate
|
||||
)
|
||||
fi
|
||||
''
|
||||
+ bin.cleanBrokenLinks +
|
||||
# Get rid of all log files. They are not needed, but take up space
|
||||
# and render the build unreproducible by their embedded timestamps.
|
||||
''
|
||||
find $TEXMFSYSVAR/web2c -name '*.log' -delete
|
||||
''
|
||||
;
|
||||
}).overrideAttrs (_: { allowSubstitutes = true; })
|
||||
# TODO: make TeX fonts visible by fontconfig: it should be enough to install an appropriate file
|
||||
# similarly, deal with xe(la)tex font visibility?
|
||||
214
pkgs/tools/typesetting/tex/texlive/default.nix
Normal file
214
pkgs/tools/typesetting/tex/texlive/default.nix
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
/* TeX Live user docs
|
||||
- source: ../../../../../doc/languages-frameworks/texlive.xml
|
||||
- current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive
|
||||
*/
|
||||
{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv
|
||||
, callPackage, ghostscriptX, harfbuzz
|
||||
, makeWrapper, python3, ruby, perl
|
||||
, useFixedHashes ? true
|
||||
, recurseIntoAttrs
|
||||
}:
|
||||
let
|
||||
# various binaries (compiled)
|
||||
bin = callPackage ./bin.nix {
|
||||
ghostscript = ghostscriptX;
|
||||
harfbuzz = harfbuzz.override {
|
||||
withIcu = true; withGraphite2 = true;
|
||||
};
|
||||
};
|
||||
|
||||
# map: name -> fixed-output hash
|
||||
fixedHashes = lib.optionalAttrs useFixedHashes (import ./fixedHashes.nix);
|
||||
|
||||
# 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;
|
||||
ghostscript = ghostscriptX; # could be without X, probably, but we use X above
|
||||
};
|
||||
|
||||
# the set of TeX Live packages, collections, and schemes; using upstream naming
|
||||
tl = let
|
||||
orig = import ./pkgs.nix tl;
|
||||
removeSelfDep = lib.mapAttrs
|
||||
(n: p: if p ? deps then p // { deps = lib.filterAttrs (dn: _: n != dn) p.deps; }
|
||||
else p);
|
||||
clean = removeSelfDep (orig // {
|
||||
# overrides of texlive.tlpdb
|
||||
|
||||
texlive-msg-translations = orig.texlive-msg-translations // {
|
||||
hasRunfiles = false; # only *.po for tlmgr
|
||||
};
|
||||
|
||||
xdvi = orig.xdvi // { # it seems to need it to transform fonts
|
||||
deps = (orig.xdvi.deps or {}) // { inherit (tl) metafont; };
|
||||
};
|
||||
|
||||
# remove dependency-heavy packages from the basic collections
|
||||
collection-basic = orig.collection-basic // {
|
||||
deps = removeAttrs orig.collection-basic.deps [ "metafont" "xdvi" ];
|
||||
};
|
||||
# add them elsewhere so that collections cover all packages
|
||||
collection-metapost = orig.collection-metapost // {
|
||||
deps = orig.collection-metapost.deps // { inherit (tl) metafont; };
|
||||
};
|
||||
collection-plaingeneric = orig.collection-plaingeneric // {
|
||||
deps = orig.collection-plaingeneric.deps // { inherit (tl) xdvi; };
|
||||
};
|
||||
|
||||
# override cyclic dependency until #167226 is fixed
|
||||
xecjk = orig.xecjk // {
|
||||
deps = removeAttrs orig.xecjk.deps [ "ctex" ];
|
||||
};
|
||||
|
||||
texdoc = orig.texdoc // {
|
||||
# build Data.tlpdb.lua (part of the 'tlType == "run"' package)
|
||||
postUnpack = ''
|
||||
if [[ -f "$out"/scripts/texdoc/texdoc.tlu ]]; then
|
||||
unxz --stdout "${tlpdb}" > texlive.tlpdb
|
||||
|
||||
# create dummy doc file to ensure that texdoc does not return an error
|
||||
mkdir -p support/texdoc
|
||||
touch support/texdoc/NEWS
|
||||
|
||||
TEXMFCNF="${bin.core}"/share/texmf-dist/web2c TEXMF="$out" TEXDOCS=. TEXMFVAR=. \
|
||||
"${bin.luatex}"/bin/texlua "$out"/scripts/texdoc/texdoc.tlu \
|
||||
-c texlive_tlpdb=texlive.tlpdb -lM texdoc
|
||||
|
||||
cp texdoc/cache-tlpdb.lua "$out"/scripts/texdoc/Data.tlpdb.lua
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}); # overrides
|
||||
|
||||
# tl =
|
||||
in lib.mapAttrs flatDeps clean;
|
||||
# TODO: texlive.infra for web2c config?
|
||||
|
||||
|
||||
flatDeps = pname: attrs:
|
||||
let
|
||||
version = attrs.version or (builtins.toString attrs.revision);
|
||||
mkPkgV = tlType: let
|
||||
pkg = attrs // {
|
||||
sha512 = attrs.sha512.${tlType};
|
||||
inherit pname tlType version;
|
||||
};
|
||||
in mkPkg pkg;
|
||||
in {
|
||||
# TL pkg contains lists of packages: runtime files, docs, sources, binaries
|
||||
pkgs =
|
||||
# tarball of a collection/scheme itself only contains a tlobj file
|
||||
[( if (attrs.hasRunfiles or false) then mkPkgV "run"
|
||||
# the fake derivations are used for filtering of hyphenation patterns and formats
|
||||
else {
|
||||
inherit pname version;
|
||||
tlType = "run";
|
||||
hasFormats = attrs.hasFormats or false;
|
||||
hasHyphens = attrs.hasHyphens or false;
|
||||
}
|
||||
)]
|
||||
++ lib.optional (attrs.sha512 ? doc) (mkPkgV "doc")
|
||||
++ lib.optional (attrs.sha512 ? source) (mkPkgV "source")
|
||||
++ lib.optional (bin ? ${pname})
|
||||
( bin.${pname} // { inherit pname; tlType = "bin"; } )
|
||||
++ combinePkgs (attrs.deps or {});
|
||||
};
|
||||
|
||||
# for daily snapshots
|
||||
# snapshot = {
|
||||
# year = "2022";
|
||||
# month = "03";
|
||||
# day = "22";
|
||||
# };
|
||||
|
||||
tlpdb = fetchurl {
|
||||
# use the same mirror(s) as urlPrefixes below
|
||||
urls = [
|
||||
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/tlpkg/texlive.tlpdb.xz"
|
||||
"ftp://tug.org/texlive/historic/${bin.texliveYear}/tlnet-final/tlpkg/texlive.tlpdb.xz"
|
||||
#"https://texlive.info/tlnet-archive/${snapshot.year}/${snapshot.month}/${snapshot.day}/tlnet/tlpkg/texlive.tlpdb.xz"
|
||||
];
|
||||
hash = "sha256-qSV6OZmGHCom2w85WXm84ohMrGGJLZ2Vzj9talDNiOo=";
|
||||
};
|
||||
|
||||
# create a derivation that contains an unpacked upstream TL package
|
||||
mkPkg = { pname, tlType, revision, version, sha512, postUnpack ? "", stripPrefix ? 1, ... }@args:
|
||||
let
|
||||
# the basename used by upstream (without ".tar.xz" suffix)
|
||||
urlName = pname + lib.optionalString (tlType != "run") ".${tlType}";
|
||||
tlName = urlName + "-${version}";
|
||||
fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes
|
||||
|
||||
urls = args.urls or (if args ? url then [ args.url ] else
|
||||
map (up: "${up}/${urlName}.r${toString revision}.tar.xz") urlPrefixes);
|
||||
|
||||
# The tarballs on CTAN mirrors for the current release are constantly
|
||||
# receiving updates, so we can't use those directly. Stable snapshots
|
||||
# need to be used instead. Ideally, for the release branches of NixOS we
|
||||
# should be switching to the tlnet-final versions
|
||||
# (https://tug.org/historic/).
|
||||
urlPrefixes = args.urlPrefixes or [
|
||||
# tlnet-final snapshot
|
||||
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/archive"
|
||||
"ftp://tug.org/texlive/historic/${bin.texliveYear}/tlnet-final/archive"
|
||||
|
||||
# Daily snapshots hosted by one of the texlive release managers
|
||||
#"https://texlive.info/tlnet-archive/${snapshot.year}/${snapshot.month}/${snapshot.day}/tlnet/archive"
|
||||
];
|
||||
|
||||
in runCommand "texlive-${tlName}"
|
||||
( {
|
||||
src = fetchurl { inherit urls sha512; };
|
||||
inherit stripPrefix;
|
||||
# metadata for texlive.combine
|
||||
passthru = {
|
||||
inherit pname tlType version;
|
||||
hasFormats = args.hasFormats or false;
|
||||
hasHyphens = args.hasHyphens or false;
|
||||
};
|
||||
} // lib.optionalAttrs (fixedHash != null) {
|
||||
outputHash = fixedHash;
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
}
|
||||
)
|
||||
( ''
|
||||
mkdir "$out"
|
||||
tar -xf "$src" \
|
||||
--strip-components="$stripPrefix" \
|
||||
-C "$out" --anchored --exclude=tlpkg --keep-old-files
|
||||
'' + postUnpack
|
||||
);
|
||||
|
||||
# combine a set of TL packages into a single TL meta-package
|
||||
combinePkgs = pkgSet: lib.concatLists # uniqueness is handled in `combine`
|
||||
(lib.mapAttrsToList (_n: a: a.pkgs) pkgSet);
|
||||
|
||||
in
|
||||
tl // {
|
||||
inherit bin combine;
|
||||
|
||||
# Pre-defined combined packages for TeX Live schemes,
|
||||
# to make nix-env usage more comfortable and build selected on Hydra.
|
||||
combined = with lib; recurseIntoAttrs (
|
||||
mapAttrs
|
||||
(pname: attrs:
|
||||
addMetaAttrs rec {
|
||||
description = "TeX Live environment for ${pname}";
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = with lib.maintainers; [ veprbl ];
|
||||
}
|
||||
(combine {
|
||||
${pname} = attrs;
|
||||
extraName = "combined" + lib.removePrefix "scheme" pname;
|
||||
extraVersion = "-final";
|
||||
#extraVersion = ".${snapshot.year}${snapshot.month}${snapshot.day}";
|
||||
})
|
||||
)
|
||||
{ inherit (tl)
|
||||
scheme-basic scheme-context scheme-full scheme-gust scheme-infraonly
|
||||
scheme-medium scheme-minimal scheme-small scheme-tetex;
|
||||
}
|
||||
);
|
||||
}
|
||||
24
pkgs/tools/typesetting/tex/texlive/fixHashes.awk
Executable file
24
pkgs/tools/typesetting/tex/texlive/fixHashes.awk
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i "gawk -f" -p gawk
|
||||
|
||||
BEGIN {
|
||||
print "{"
|
||||
}
|
||||
|
||||
/-texlive-/ && !/\.bin/ {
|
||||
if (match($0, /-texlive-([^\/]*)/, m) == 0) {
|
||||
print "No match for \""$0"\"" > "/dev/stderr"
|
||||
exit 1
|
||||
}
|
||||
cmd="nix-hash --type sha256 --base32 "$0
|
||||
if (( cmd | getline hash ) <= 0) {
|
||||
print "Error executing nix-hash" > "/dev/stderr"
|
||||
exit 1
|
||||
}
|
||||
close(cmd)
|
||||
printf("\"%s\"=\"%s\";\n", m[1], hash)
|
||||
}
|
||||
|
||||
END {
|
||||
print "}"
|
||||
}
|
||||
9516
pkgs/tools/typesetting/tex/texlive/fixedHashes.nix
Normal file
9516
pkgs/tools/typesetting/tex/texlive/fixedHashes.nix
Normal file
File diff suppressed because it is too large
Load diff
38559
pkgs/tools/typesetting/tex/texlive/pkgs.nix
Normal file
38559
pkgs/tools/typesetting/tex/texlive/pkgs.nix
Normal file
File diff suppressed because it is too large
Load diff
7
pkgs/tools/typesetting/tex/texlive/setup-hook.sh
Normal file
7
pkgs/tools/typesetting/tex/texlive/setup-hook.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
addTeXMFPath () {
|
||||
if test -d "$1/share/texmf-nix"; then
|
||||
export TEXINPUTS="${TEXINPUTS}${TEXINPUTS:+:}$1/share/texmf-nix//:"
|
||||
fi
|
||||
}
|
||||
|
||||
addEnvHooks "$targetOffset" addTeXMFPath
|
||||
9
pkgs/tools/typesetting/tex/texlive/texlinks.diff
Normal file
9
pkgs/tools/typesetting/tex/texlive/texlinks.diff
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
@@ -157,7 +157,7 @@
|
||||
verbose_echo "skipped ConTeXtish symlink $src -> $dest (special case)"
|
||||
;;
|
||||
*)
|
||||
- test ! -f "$src" &&
|
||||
+ test "x$src" != "x`(ls -ld $src | awk '{print $NF}') 2>/dev/null`" &&
|
||||
rm -f "$src"
|
||||
|
||||
if test -f "$src"; then
|
||||
38
pkgs/tools/typesetting/tex/texlive/tl2nix.sed
Normal file
38
pkgs/tools/typesetting/tex/texlive/tl2nix.sed
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# wrap whole file into an attrset
|
||||
1itl: { # no indentation
|
||||
$a}
|
||||
|
||||
# trash packages we don't want
|
||||
/^name .*\./,/^$/d
|
||||
|
||||
# quote package names, as some start with a number :-/
|
||||
s/^name (.*)/name "\1"/
|
||||
|
||||
# extract revision
|
||||
s/^revision ([0-9]*)$/ revision = \1;/p
|
||||
|
||||
# form an attrmap per package
|
||||
/^name /s/^name (.*)/\1 = {/p
|
||||
/^$/,1i};
|
||||
|
||||
# extract hashes of *.tar.xz
|
||||
s/^containerchecksum (.*)/ sha512.run = "\1";/p
|
||||
s/^doccontainerchecksum (.*)/ sha512.doc = "\1";/p
|
||||
s/^srccontainerchecksum (.*)/ sha512.source = "\1";/p
|
||||
/^runfiles /i\ hasRunfiles = true;
|
||||
|
||||
# number of path components to strip, defaulting to 1 ("texmf-dist/")
|
||||
/^relocated 1/i\ stripPrefix = 0;
|
||||
|
||||
# extract version and clean unwanted chars from it
|
||||
/^catalogue-version/y/ \/~/_--/
|
||||
/^catalogue-version/s/[\#,:\(\)]//g
|
||||
s/^catalogue-version_(.*)/ version = "\1";/p
|
||||
|
||||
# extract deps
|
||||
s/^depend ([^.]*)$/ deps."\1" = tl."\1";/p
|
||||
|
||||
# extract hyphenation patterns and formats
|
||||
# (this may create duplicate lines, use uniq to remove them)
|
||||
/^execute\sAddHyphen/i\ hasHyphens = true;
|
||||
/^execute\sAddFormat/i\ hasFormats = true;
|
||||
33
pkgs/tools/typesetting/tikzit/default.nix
Normal file
33
pkgs/tools/typesetting/tikzit/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, mkDerivation, fetchFromGitHub, qmake, qttools, qtbase, poppler, flex, bison }:
|
||||
|
||||
mkDerivation {
|
||||
pname = "tikzit";
|
||||
version = "2.1.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tikzit";
|
||||
repo = "tikzit";
|
||||
rev = "v2.1.6";
|
||||
sha256 = "0ba99pgv54pj1xvhrwn9db2w0v4h07vsjajcnhpa2smy88ypg32h";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ qmake qttools flex bison ];
|
||||
buildInputs = [ qtbase poppler ];
|
||||
|
||||
# src/data/tikzlexer.l:29:10: fatal error: tikzparser.parser.hpp: No such file or directory
|
||||
enableParallelBuilding = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A graphical tool for rapidly creating graphs and diagrams using PGF/TikZ";
|
||||
longDescription = ''
|
||||
TikZiT is a simple GUI editor for graphs and string diagrams.
|
||||
Its native file format is a subset of PGF/TikZ, which means TikZiT files
|
||||
can be included directly in papers typeset using LaTeX.
|
||||
For preview support the texlive package 'preview' has to be installed.
|
||||
'';
|
||||
homepage = "https://tikzit.github.io/";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.all;
|
||||
maintainers = [ maintainers.iblech maintainers.mgttlinger ];
|
||||
};
|
||||
}
|
||||
53
pkgs/tools/typesetting/xmlroff/default.nix
Normal file
53
pkgs/tools/typesetting/xmlroff/default.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{ lib, stdenv, fetchFromGitHub
|
||||
, autoreconfHook
|
||||
, gtk2
|
||||
, libxml2
|
||||
, libxslt
|
||||
, pango
|
||||
, perl
|
||||
, pkg-config
|
||||
, popt
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xmlroff";
|
||||
version = "0.6.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0dgp72094lx9i9gvg21pp8ak7bg39707rdf6wz011p9s6n6lrq5g";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
||||
buildInputs = [
|
||||
libxml2
|
||||
libxslt
|
||||
pango
|
||||
gtk2
|
||||
popt
|
||||
];
|
||||
|
||||
sourceRoot = "source/xmlroff/";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
configureScript = "./autogen.sh";
|
||||
|
||||
configureFlags = [
|
||||
"--disable-gp"
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
substituteInPlace tools/insert-file-as-string.pl --replace "/usr/bin/perl" "${perl}/bin/perl"
|
||||
substituteInPlace Makefile --replace "docs" "" # docs target wants to download from network
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "XSL Formatter";
|
||||
homepage = "http://xmlroff.org/";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.bsd3;
|
||||
};
|
||||
}
|
||||
52
pkgs/tools/typesetting/xmlto/default.nix
Normal file
52
pkgs/tools/typesetting/xmlto/default.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{ fetchurl, lib, stdenv, libxml2, libxslt
|
||||
, docbook_xml_dtd_45, docbook_xsl, w3m
|
||||
, bash, getopt, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xmlto";
|
||||
version = "0.0.28";
|
||||
src = fetchurl {
|
||||
url = "https://releases.pagure.org/${pname}/${pname}-${version}.tar.bz2";
|
||||
sha256 = "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs xmlif/test/run-test
|
||||
|
||||
substituteInPlace "xmlto.in" \
|
||||
--replace "/bin/bash" "${bash}/bin/bash"
|
||||
substituteInPlace "xmlto.in" \
|
||||
--replace "/usr/bin/locale" "$(type -P locale)"
|
||||
substituteInPlace "xmlto.in" \
|
||||
--replace "mktemp" "$(type -P mktemp)"
|
||||
'';
|
||||
|
||||
# `libxml2' provides `xmllint', needed at build-time and run-time.
|
||||
# `libxslt' provides `xsltproc', used by `xmlto' at run-time.
|
||||
nativeBuildInputs = [ makeWrapper getopt ];
|
||||
buildInputs = [ libxml2 libxslt docbook_xml_dtd_45 docbook_xsl ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/xmlto" \
|
||||
--prefix PATH : "${lib.makeBinPath [ libxslt libxml2 getopt ]}"
|
||||
|
||||
# `w3m' is needed for HTML to text conversions.
|
||||
substituteInPlace "$out/share/xmlto/format/docbook/txt" \
|
||||
--replace "/usr/bin/w3m" "${w3m}/bin/w3m"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Front-end to an XSL toolchain";
|
||||
|
||||
longDescription = ''
|
||||
xmlto is a front-end to an XSL toolchain. It chooses an
|
||||
appropriate stylesheet for the conversion you want and applies
|
||||
it using an external XSL-T processor. It also performs any
|
||||
necessary post-processing.
|
||||
'';
|
||||
|
||||
license = lib.licenses.gpl2Plus;
|
||||
homepage = "https://pagure.io/xmlto/";
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue