* ImageMagick: don't need to keep old versions I guess.

* texFunctions.simpleTexToPNG: purity (use our own ImageMagick).

svn path=/nixpkgs/trunk/; revision=11836
This commit is contained in:
Eelco Dolstra 2008-05-16 11:26:23 +00:00
parent 4bbd9bab29
commit 3042994875
5 changed files with 49 additions and 87 deletions

View File

@ -1,26 +0,0 @@
args: with args;
stdenv.mkDerivation (rec {
name = "ImageMagick-6.3.8-5";
src = fetchurl {
url = "ftp://ftp.imagemagick.org/pub/ImageMagick/${name}.tar.bz2";
sha256 = "0lsvi2z5b5zam6yvjzsyjpa36rg1c0kczifz73k9b4v8zz9a9vfl";
};
configureFlags = " --with-dots --with-gs-font-dir="+ ghostscript +
"/share/ghostscript/fonts --with-gslib " +(
if args ? tetex then " --with-frozenpaths " else ""
);
buildInputs = [bzip2 freetype ghostscript graphviz libjpeg libpng
libtiff libX11 libxml2 zlib libtool] ++ (if args ? tetex then [args.tetex] else [])
++ (if args ? librsvg then [args.librsvg] else []);
meta = {
homepage = http://www.imagemagick.org;
};
} // (if args ? tetex then {
preConfigure = "
export DVIDecodeDelegate=${args.tetex}/bin/dvips
";
} else {}))

View File

@ -1,26 +0,0 @@
args: with args;
stdenv.mkDerivation (rec {
name = "ImageMagick-${version}";
src = fetchurl {
url = "ftp://ftp.imagemagick.org/pub/ImageMagick/${name}.tar.bz2";
sha256 = "0a8defbfa867bb5e969f898d9a3b65a8c4f6952cb71411b40f005dd0a183644e";
};
configureFlags = " --with-dots --with-gs-font-dir="+ ghostscript +
"/share/ghostscript/fonts --with-gslib " +(
if args ? tetex then " --with-frozenpaths " else ""
);
buildInputs = [bzip2 freetype ghostscript graphviz libjpeg libpng
libtiff libX11 libxml2 zlib libtool] ++ (if args ? tetex then [args.tetex] else [])
++ (if args ? librsvg then [args.librsvg] else []);
meta = {
homepage = http://www.imagemagick.org;
};
} // (if args ? tetex then {
preConfigure = "
export DVIDecodeDelegate=${args.tetex}/bin/dvips
";
} else {}))

View File

@ -1,5 +1,7 @@
args: with args; args: with args;
let version = "6.4.1-1"; in
stdenv.mkDerivation (rec { stdenv.mkDerivation (rec {
name = "ImageMagick-${version}"; name = "ImageMagick-${version}";
@ -8,7 +10,7 @@ stdenv.mkDerivation (rec {
"ftp://ftp.imagemagick.org/pub/ImageMagick/${name}.tar.bz2" "ftp://ftp.imagemagick.org/pub/ImageMagick/${name}.tar.bz2"
"http://ftp.surfnet.nl/pub/ImageMagick/${name}.tar.bz2" "http://ftp.surfnet.nl/pub/ImageMagick/${name}.tar.bz2"
]; ];
sha256 = "0ynn8gxixjb16xhg60hp2sbfymh03y5qxxgffwlchciiylw9dlvd"; sha256 = "0a8defbfa867bb5e969f898d9a3b65a8c4f6952cb71411b40f005dd0a183644e";
}; };
configureFlags = '' configureFlags = ''

View File

@ -95,15 +95,15 @@ rec {
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
inherit name preamble body; inherit name preamble body;
buildCommand = " buildCommand = ''
touch $out touch $out
echo '\\documentclass{article}' >> $out echo '\documentclass{article}' >> $out
echo '\\pagestyle{empty}' >> $out echo '\pagestyle{empty}' >> $out
if test -n \"$preamble\"; then cat $preamble >> $out; fi if test -n "$preamble"; then cat $preamble >> $out; fi
echo '\\begin{document}' >> $out echo '\begin{document}' >> $out
cat $body >> $out cat $body >> $out
echo '\\end{document}' >> $out echo '\end{document}' >> $out
"; '';
}; };
@ -117,7 +117,9 @@ rec {
name = "png"; name = "png";
inherit postscript; inherit postscript;
buildCommand = " buildInputs = [pkgs.imagemagick pkgs.ghostscript];
buildCommand = ''
if test -d $postscript; then if test -d $postscript; then
input=$(ls $postscript/*.ps) input=$(ls $postscript/*.ps)
else else
@ -125,19 +127,17 @@ rec {
ln -s $postscript $input ln -s $postscript $input
fi fi
# !!! Quick hack: no ImageMagick in Nixpkgs yet!
export PATH=/usr/bin:$PATH
ensureDir $out ensureDir $out
convert -units PixelsPerInch \\ convert -units PixelsPerInch \
-density 300 \\ -density 300 \
-trim \\ -trim \
-matte \\ -matte \
-transparent '#ffffff' \\ -transparent '#ffffff' \
-type PaletteMatte \\ -type PaletteMatte \
+repage \\ +repage \
$input \\ $input \
\"$out/$(basename $input .ps).png\" "$out/$(basename $input .ps).png"
"; ''; # */
}; };
@ -162,5 +162,21 @@ rec {
}; };
# Convert a piece of TeX code to a PDF.
simpleTeXToPDF =
{ preamble ? null
, body
, name ? baseNameOf (toString body)
, packages ? []
}:
runLaTeX {
rootFile = wrapSimpleTeX {
inherit body preamble;
};
inherit packages;
searchRelativeTo = dirOf (toString body);
};
} }

View File

@ -5374,21 +5374,17 @@ let pkgs = rec {
inherit (xlibs) libX11 libXft libXext libXinerama libXrandr; inherit (xlibs) libX11 libXft libXext libXinerama libXrandr;
}; };
imagemagickFun = lib.sumArgs (selectVersion ../applications/graphics/ImageMagick "6.4.1-1" ) { imagemagick = import ../applications/graphics/ImageMagick {
inherit stdenv fetchurl libtool; inherit stdenv fetchurl bzip2 freetype graphviz ghostscript
libjpeg libpng libtiff libxml2 zlib libtool;
inherit (xlibs) libX11;
}; };
imagemagick = imagemagickFun { imagemagickBig = import ../applications/graphics/ImageMagick {
inherit bzip2 freetype graphviz ghostscript libjpeg libpng libtiff inherit stdenv fetchurl bzip2 freetype graphviz ghostscript
libxml2 zlib; libjpeg libpng libtiff libxml2 zlib tetex librsvg libtool;
inherit (xlibs) libX11; inherit (xlibs) libX11;
} null; };
imagemagickBig = imagemagickFun {
inherit bzip2 freetype graphviz ghostscript libjpeg libpng libtiff
libxml2 zlib tetex librsvg;
inherit (xlibs) libX11;
} null;
inkscape = import ../applications/graphics/inkscape { inkscape = import ../applications/graphics/inkscape {
inherit fetchurl stdenv perl perlXMLParser pkgconfig zlib inherit fetchurl stdenv perl perlXMLParser pkgconfig zlib
@ -6508,7 +6504,7 @@ let pkgs = rec {
*/ */
texFunctions = import ../misc/tex/nix { texFunctions = import ../misc/tex/nix {
inherit stdenv perl tetex graphviz ghostscript; inherit stdenv perl tetex graphviz ghostscript imagemagick;
}; };
texLiveFun = builderDefsPackage (import ../misc/tex/texlive) { texLiveFun = builderDefsPackage (import ../misc/tex/texlive) {