Skip to content

Instantly share code, notes, and snippets.

@kiloreux
Last active May 18, 2017 18:20
Show Gist options
  • Save kiloreux/52dfe94db95b44c6f97afa5be6e74efa to your computer and use it in GitHub Desktop.
Save kiloreux/52dfe94db95b44c6f97afa5be6e74efa to your computer and use it in GitHub Desktop.
let
rawfunc = import <nixpkgs>;
in
with rawfunc {};
{
imagemagick1 = pkgs.callPackage ./imagemagick-old.nix { };
imagemagick2 = pkgs.callPackage ./imagemagick-new.nix { };
}
{ stdenv, lib, fetchurl, python, pkgconfig, zlib, glib, flex, bison, makeStaticLibraries, glibc, libtool, bzip2, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg, lcms2, openexr, libpng\
, librsvg, libtiff, libxml2, openjpeg, libwebp }:
let
cfg = {
version = "6.9.4-10";
sha256 = "a2c981ea80de0ed95135591d0e504a2427187594a5cb2342474f50d97e626a2d";
};
in
stdenv.mkDerivation rec {
name = "imagemagicknew";
buildInputs = [ python pkgconfig zlib.static flex bison glibc.static zlib fontconfig freetype ghostscript libpng libtiff libxml2 ];
inherit (cfg) version;
src = fetchurl {
urls = [
"mirror://imagemagick/releases/ImageMagick-${version}.tar.xz"
];
sha256 = "a2c981ea80de0ed95135591d0e504a2427187594a5cb2342474f50d97e626a2d";
};
enableParallelBuilding = true;
configureFlags =
[ "--with-frozenpaths" ]
++ [ "--with-gcc-arch=x86-64" ]
++ [ "--host=x86_64" ]
++ lib.optional (librsvg != null) "--with-rsvg"
++ lib.optionals (ghostscript != null)
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib"
]
;
postInstall = ''
for x in $out/bin/*; do mv -v $x ''${x}-1.4;done
for x in $out/etc/ImageMagick-6/*; do mv -v $x ''${x}-1.4;done
'';
}
{ stdenv, lib, fetchurl, python, pkgconfig, zlib, glib, flex, bison, makeStaticLibraries, glibc, libtool, bzip2, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg, lcms2, openexr, libpng\
, librsvg, libtiff, libxml2, openjpeg, libwebp }:
let
cfg = {
version = "6.9.3-10";
sha256 = "e33f021c879f31703f9e620f578ccf7d221a34941589da4bbe967b16a814336a";
};
in
stdenv.mkDerivation rec {
name = "imagemagickold";
buildInputs = [ python pkgconfig zlib.static flex bison glibc.static zlib fontconfig freetype ghostscript libpng libtiff libxml2 ];
inherit (cfg) version;
src = fetchurl {
urls = [
"mirror://imagemagick/releases/ImageMagick-${version}.tar.xz"
];
sha256 = "e33f021c879f31703f9e620f578ccf7d221a34941589da4bbe967b16a814336a";
};
enableParallelBuilding = true;
configureFlags =
[ "--with-frozenpaths" ]
++ [ "--with-gcc-arch=x86-64" ]
++ [ "--host=x86_64" ]
++ lib.optional (librsvg != null) "--with-rsvg"
++ lib.optionals (ghostscript != null)
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib"
]
;
postInstall = ''
for x in $out/bin/*; do mv -v $x ''${x}-1.2;done
for x in $out/etc/ImageMagick-6/*; do mv -v $x ''${x}-1.2;done
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment