depot/third_party/nixpkgs/pkgs/development/libraries/libtiff/default.nix
Default email 07d6a74cbb Project import generated by Copybara.
GitOrigin-RevId: f5e8bdd07d1afaabf6b37afc5497b1e498b8046f
2021-03-19 18:17:44 +01:00

54 lines
1.2 KiB
Nix

{ lib, stdenv
, fetchurl
, pkg-config
, cmake
, libdeflate
, libjpeg
, xz
, zlib
}:
stdenv.mkDerivation rec {
pname = "libtiff";
version = "4.2.0";
src = fetchurl {
url = "https://download.osgeo.org/libtiff/tiff-${version}.tar.gz";
sha256 = "1jrkjv0xya9radddn8idxvs2gqzp3l2b1s8knlizmn7ad3jq817b";
};
cmakeFlags = if stdenv.isDarwin then [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
] else null;
# FreeImage needs this patch
patches = [ ./headers.patch ];
outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
postFixup = ''
moveToOutput include/tif_dir.h $dev_private
moveToOutput include/tif_config.h $dev_private
moveToOutput include/tiffiop.h $dev_private
'';
nativeBuildInputs = [ cmake pkg-config ];
propagatedBuildInputs = [ libjpeg xz zlib ]; #TODO: opengl support (bogus configure detection)
buildInputs = [ libdeflate ]; # TODO: move all propagatedBuildInputs to buildInputs.
enableParallelBuilding = true;
doInstallCheck = true;
installCheckTarget = "test";
meta = with lib; {
description = "Library and utilities for working with the TIFF image file format";
homepage = "http://download.osgeo.org/libtiff";
license = licenses.libtiff;
platforms = platforms.unix;
};
}