Skip to content

Commit

Permalink
dblatex: add missing dependencies
Browse files Browse the repository at this point in the history
imagemagick, transfig, inkscape, fontconfig and ghostscript was missing.

And pass --use-python-path at install time so that script shebangs end
up with #!/path/to/python instead of #!/path/to/env python.
  • Loading branch information
bjornfor committed Sep 28, 2013
1 parent 44f8e28 commit 0350bd3
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions pkgs/tools/typesetting/tex/dblatex/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv, fetchurl, python, libxslt, tetex }:
{ stdenv, fetchurl, python, libxslt, tetex, imagemagick, transfig, inkscape
, fontconfig, ghostscript }:

stdenv.mkDerivation rec {
name = "dblatex-0.3.4";
Expand All @@ -8,15 +9,38 @@ stdenv.mkDerivation rec {
sha256 = "120w3wm07qx0k1grgdhjwm2vpwil71icshjvqznskp1f6ggch290";
};

buildInputs = [ python libxslt tetex imagemagick transfig ];

# 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 = ''
for file in $(find -name "*.py"); do
sed -e 's|cmd = \["xsltproc|cmd = \["${libxslt}/bin/xsltproc|g' \
-e 's|Popen(\["xsltproc|Popen(\["${libxslt}/bin/xsltproc|g' \
-e 's|cmd = "convert|cmd = "${imagemagick}/bin/convert|g' \
-e 's|cmd = "fig2dev|cmd = "${transfig}/bin/fig2dev|g' \
-e 's|cmd = \["texindy|cmd = ["nixpkgs_is_missing_texindy|g' \
-e 's|cmd = \["ps2pdf|cmd = ["${ghostscript}/bin/ps2pdf|g' \
-e 's|cmd = "inkscape|cmd = "${inkscape}/bin/inkscape|g' \
-e 's|cmd = "epstopdf|cmd = "${tetex}/bin/epstopdf|g' \
-e 's|cmd = \["makeindex|cmd = ["${tetex}/bin/makeindex|g' \
-e 's|doc.program = "pdflatex"|doc.program = "${tetex}/bin/pdflatex"|g' \
-e 's|self.program = "latex"|self.program = "${tetex}/bin/latex"|g' \
-e 's|Popen("pdflatex|Popen("${tetex}/bin/pdflatex|g' \
-e 's|"fc-match"|"${fontconfig}/bin/fc-match"|g' \
-e 's|"fc-list"|"${fontconfig}/bin/fc-list"|g' \
-i "$file"
done
sed -i 's|self.install_layout == "deb"|False|' setup.py
'';

buildPhase = "true";

installPhase = ''
sed -i 's|self.install_layout == "deb"|False|' setup.py
python ./setup.py install --prefix=$out
python ./setup.py install --prefix="$out" --use-python-path --verbose
'';

buildInputs = [ python libxslt tetex ];

meta = {
description = "A program to convert DocBook to DVI, PostScript or PDF via LaTeX or ConTeXt";
homepage = http://dblatex.sourceforge.net/;
Expand Down

1 comment on commit 0350bd3

@edolstra
Copy link
Member

Choose a reason for hiding this comment

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

This change adds a significant amount of bloat to the closure of dblatex. As far as I can tell, it adds a dependency on Pango, GTK+, Ghostscript, Cairo, Transfig, Poppler, CUPS, libusb, Mesa, Inkscape, ImageMagick, libdrm and a bunch of other packages. In particular the dependency on Inkscape seems gratuitous.

Please sign in to comment.