···1-# Per https://github.com/opentoonz/opentoonz/blob/master/doc/how_to_build_linux.md ,
2-# opentoonz requires its own modified version of libtiff. We still build it as
3-# a separate package
4-# 1. For visibility for tools like vulnix, and
5-# 2. To avoid a diamond-dependency problem with opencv linking the normal libtiff
6-# and opentoonz linking opencv and this modified libtiff, we build an opencv
7-# against this modified libtiff as well.
8-#
9-# We use a separate mkDerivation rather than a minimal libtiff.overrideAttrs
10-# because the main libtiff builds with cmake and this version of libtiff was
11-# forked before libtiff gained CMake build capability (added in libtiff-4.0.5).
12-13-{ lib, fetchFromGitHub, stdenv, pkg-config, zlib, libjpeg, xz, libtiff, }:
14-15-let source = import ./source.nix { inherit fetchFromGitHub; };
16-17-in stdenv.mkDerivation {
18- pname = "libtiff";
19- version = source.versions.libtiff + "-opentoonz";
20-21- inherit (source) src;
22- outputs = [ "bin" "dev" "out" "man" "doc" ];
23-24- nativeBuildInputs = [ pkg-config ];
25- propagatedBuildInputs = [ zlib libjpeg xz ];
26-27- postUnpack = ''
28- sourceRoot="$sourceRoot/thirdparty/tiff-${source.versions.libtiff}"
29- '';
30-31- # opentoonz uses internal libtiff headers
32- postInstall = ''
33- cp libtiff/{tif_config,tif_dir,tiffiop}.h $dev/include
34- '';
35-36- meta = libtiff.meta // {
37- knownVulnerabilities = [''
38- Do not open untrusted files with Opentoonz:
39- Opentoonz uses an old custom fork of tibtiff from 2012 that is known to
40- be affected by at least these 50 vulnerabilities:
41- CVE-2012-4564 CVE-2013-4232 CVE-2013-4243 CVE-2013-4244 CVE-2014-8127
42- CVE-2014-8128 CVE-2014-8129 CVE-2014-8130 CVE-2014-9330 CVE-2015-1547
43- CVE-2015-8781 CVE-2015-8782 CVE-2015-8783 CVE-2015-8784 CVE-2015-8870
44- CVE-2016-3620 CVE-2016-3621 CVE-2016-3623 CVE-2016-3624 CVE-2016-3625
45- CVE-2016-3631 CVE-2016-3632 CVE-2016-3633 CVE-2016-3634 CVE-2016-3658
46- CVE-2016-3945 CVE-2016-3990 CVE-2016-3991 CVE-2016-5102 CVE-2016-5314
47- CVE-2016-5315 CVE-2016-5316 CVE-2016-5318 CVE-2016-5319 CVE-2016-5321
48- CVE-2016-5322 CVE-2016-5323 CVE-2016-6223 CVE-2016-9453 CVE-2016-9532
49- CVE-2017-9935 CVE-2017-9937 CVE-2018-10963 CVE-2018-5360
50- CVE-2019-14973 CVE-2019-17546 CVE-2020-35521 CVE-2020-35522
51- CVE-2020-35523 CVE-2020-35524
52- More info at https://github.com/opentoonz/opentoonz/issues/4193
53- ''];
54- maintainers = with lib.maintainers; [ chkno ];
55- };
56-}