diff --git a/pkgs/applications/graphics/ImageMagick/6.3.8-5.nix b/pkgs/applications/graphics/ImageMagick/6.3.8-5.nix deleted file mode 100644 index 83c7075f8e5..00000000000 --- a/pkgs/applications/graphics/ImageMagick/6.3.8-5.nix +++ /dev/null @@ -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 {})) diff --git a/pkgs/applications/graphics/ImageMagick/6.4.1-1.nix b/pkgs/applications/graphics/ImageMagick/6.4.1-1.nix deleted file mode 100644 index 79c571a92db..00000000000 --- a/pkgs/applications/graphics/ImageMagick/6.4.1-1.nix +++ /dev/null @@ -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 {})) diff --git a/pkgs/applications/graphics/ImageMagick/6.3.9-0.nix b/pkgs/applications/graphics/ImageMagick/default.nix similarity index 88% rename from pkgs/applications/graphics/ImageMagick/6.3.9-0.nix rename to pkgs/applications/graphics/ImageMagick/default.nix index ad7899b33c4..bf89a796c22 100644 --- a/pkgs/applications/graphics/ImageMagick/6.3.9-0.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -1,5 +1,7 @@ args: with args; +let version = "6.4.1-1"; in + stdenv.mkDerivation (rec { name = "ImageMagick-${version}"; @@ -8,7 +10,7 @@ stdenv.mkDerivation (rec { "ftp://ftp.imagemagick.org/pub/ImageMagick/${name}.tar.bz2" "http://ftp.surfnet.nl/pub/ImageMagick/${name}.tar.bz2" ]; - sha256 = "0ynn8gxixjb16xhg60hp2sbfymh03y5qxxgffwlchciiylw9dlvd"; + sha256 = "0a8defbfa867bb5e969f898d9a3b65a8c4f6952cb71411b40f005dd0a183644e"; }; configureFlags = '' diff --git a/pkgs/misc/tex/nix/default.nix b/pkgs/misc/tex/nix/default.nix index 54fb512c890..6b0ec098837 100644 --- a/pkgs/misc/tex/nix/default.nix +++ b/pkgs/misc/tex/nix/default.nix @@ -95,15 +95,15 @@ rec { pkgs.stdenv.mkDerivation { inherit name preamble body; - buildCommand = " + buildCommand = '' touch $out - echo '\\documentclass{article}' >> $out - echo '\\pagestyle{empty}' >> $out - if test -n \"$preamble\"; then cat $preamble >> $out; fi - echo '\\begin{document}' >> $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 - "; + echo '\end{document}' >> $out + ''; }; @@ -116,8 +116,10 @@ rec { pkgs.stdenv.mkDerivation { name = "png"; inherit postscript; + + buildInputs = [pkgs.imagemagick pkgs.ghostscript]; - buildCommand = " + buildCommand = '' if test -d $postscript; then input=$(ls $postscript/*.ps) else @@ -125,19 +127,17 @@ rec { ln -s $postscript $input fi - # !!! Quick hack: no ImageMagick in Nixpkgs yet! - export PATH=/usr/bin:$PATH ensureDir $out - convert -units PixelsPerInch \\ - -density 300 \\ - -trim \\ - -matte \\ - -transparent '#ffffff' \\ - -type PaletteMatte \\ - +repage \\ - $input \\ - \"$out/$(basename $input .ps).png\" - "; + convert -units PixelsPerInch \ + -density 300 \ + -trim \ + -matte \ + -transparent '#ffffff' \ + -type PaletteMatte \ + +repage \ + $input \ + "$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); + }; + + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 18a2d49e31d..9236d4fd711 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5374,21 +5374,17 @@ let pkgs = rec { inherit (xlibs) libX11 libXft libXext libXinerama libXrandr; }; - imagemagickFun = lib.sumArgs (selectVersion ../applications/graphics/ImageMagick "6.4.1-1" ) { - inherit stdenv fetchurl libtool; + imagemagick = import ../applications/graphics/ImageMagick { + inherit stdenv fetchurl bzip2 freetype graphviz ghostscript + libjpeg libpng libtiff libxml2 zlib libtool; + inherit (xlibs) libX11; }; - imagemagick = imagemagickFun { - inherit bzip2 freetype graphviz ghostscript libjpeg libpng libtiff - libxml2 zlib; + imagemagickBig = import ../applications/graphics/ImageMagick { + inherit stdenv fetchurl bzip2 freetype graphviz ghostscript + libjpeg libpng libtiff libxml2 zlib tetex librsvg libtool; 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 { inherit fetchurl stdenv perl perlXMLParser pkgconfig zlib @@ -6508,7 +6504,7 @@ let pkgs = rec { */ texFunctions = import ../misc/tex/nix { - inherit stdenv perl tetex graphviz ghostscript; + inherit stdenv perl tetex graphviz ghostscript imagemagick; }; texLiveFun = builderDefsPackage (import ../misc/tex/texlive) {