nixpkgs/pkgs/development/libraries/libtiff/default.nix
Yarny0 f57a4b0ac1 libtiff: introduce libtiff_4_5
With the update to libtiff 4.6 in
0a74a54ac2 ,
many tiff-processing utility executables got dropped:

http://www.simplesystems.org/libtiff/releases/v4.6.0.html

Some of these executables can still be "restored" with
the configure switch `--enable-tools-unsupported`,
but unfortunatelly,
at least hylafaxplus (maybe more packages) relies on
utilities that even cannot be restored with this switch.

The commit at hand reintroduces the old libtiff
version 4.5.1 as `libtiff_4_5` into nixpkgs.
It restores the old build recipe with the following changes:

* passthru.updateScript is dropped as it is of no use here
* passthru.tests is dropped as it only contains
  packages that now build with the new libtiff version
* patches are applied for the two CVEs that are fixed in 4.6.0

As libtiff 4.5 is no longer supported by libtiff developers,
new vulnerabilities will likely go unnoticed
unless they also affect the current version.
To not disable hydra builds, we don't add
`knownVulnerabilities` *for now*, but add comments to alert
updaters of the current libtiff version so patches can
be backported or the situation be reevaluated as a whole.
2023-11-01 07:32:25 +01:00

93 lines
2.0 KiB
Nix

{ lib
, stdenv
, fetchFromGitLab
, nix-update-script
, autoreconfHook
, pkg-config
, sphinx
, libdeflate
, libjpeg
, xz
, zlib
# for passthru.tests
, libgeotiff
, python3Packages
, imagemagick
, graphicsmagick
, gdal
, openimageio
, freeimage
}:
stdenv.mkDerivation rec {
pname = "libtiff";
version = "4.6.0";
# if you update this, please consider adding patches and/or
# setting `knownVulnerabilities` in libtiff `4.5.nix`
src = fetchFromGitLab {
owner = "libtiff";
repo = "libtiff";
rev = "v${version}";
hash = "sha256-qCg5qjsPPynCHIg0JsPJldwVdcYkI68zYmyNAKUCoyw=";
};
patches = [
# FreeImage needs this patch
./headers.patch
# libc++abi 11 has an `#include <version>`, this picks up files name
# `version` in the project's include paths
./rename-version.patch
];
postPatch = ''
mv VERSION VERSION.txt
'';
outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
postFixup = ''
moveToOutput include/tif_config.h $dev_private
moveToOutput include/tif_dir.h $dev_private
moveToOutput include/tif_hash_set.h $dev_private
moveToOutput include/tiffiop.h $dev_private
'';
# If you want to change to a different build system, please make
# sure cross-compilation works first!
nativeBuildInputs = [ autoreconfHook pkg-config sphinx ];
# TODO: opengl support (bogus configure detection)
propagatedBuildInputs = [
libdeflate
libjpeg
xz
zlib
];
enableParallelBuilding = true;
doCheck = true;
passthru = {
tests = {
inherit libgeotiff imagemagick graphicsmagick gdal openimageio freeimage;
inherit (python3Packages) pillow imread;
};
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Library and utilities for working with the TIFF image file format";
homepage = "https://libtiff.gitlab.io/libtiff";
changelog = "https://libtiff.gitlab.io/libtiff/v${version}.html";
maintainers = with maintainers; [ qyliss ];
license = licenses.libtiff;
platforms = platforms.unix;
};
}