{ stdenv, fetchurl, cmake, libpng, libtiff, lcms2 }:

stdenv.mkDerivation rec {
  name = "openjpeg-2.0.0";

  src = fetchurl {
    url = "http://openjpeg.googlecode.com/files/${name}.tar.gz";
    sha256 = "1n05yrmscpgksrh2kfh12h18l0lw9j03mgmvwcg3hm8m0lwgak9k";
  };

  configurePhase = "cmake";

  buildInputs = [ cmake libpng libtiff lcms2 ];

  meta = {
    homepage = http://www.openjpeg.org/;
    description = "Open-source JPEG 2000 codec written in C language";
    license = "BSD";
    platforms = stdenv.lib.platforms.all;
  };
}

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "openjpeg-1.5.1";

  src = fetchurl {
    url = "http://openjpeg.googlecode.com/files/${name}.tar.gz";
    sha256 = "13dbyf3jwr4h2dn1k11zph3jgx17z7d66xmi640mbsf8l6bk1yvc";
  };

  meta = {
    homepage = http://www.openjpeg.org/;
    description = "Open-source JPEG 2000 codec written in C language";
    license = "BSD";
    platforms = stdenv.lib.platforms.all;
  };
}

Revert "openjpeg: major update": not good yet (mupdf)
Revert "openjpeg: major update": not good yet (mupdf)

This reverts commit b2a07ce1894ac8180cfe214ff65ac5ead328c065.
