2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
|
|
|
, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, zlib
|
|
|
|
, libjpeg
|
|
|
|
, xz
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "4.1.0";
|
|
|
|
pname = "libtiff";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.osgeo.org/libtiff/tiff-${version}.tar.gz";
|
|
|
|
sha256 = "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
cmakeFlags = if stdenv.isDarwin then [
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
|
|
|
] else null;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# 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 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ zlib libjpeg xz ]; #TODO: opengl support (bogus configure detection)
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "test";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library and utilities for working with the TIFF image file format";
|
|
|
|
homepage = "http://download.osgeo.org/libtiff";
|
|
|
|
license = licenses.libtiff;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|