···11-# Per https://github.com/opentoonz/opentoonz/blob/master/doc/how_to_build_linux.md ,
22-# opentoonz requires its own modified version of libtiff. We still build it as
33-# a separate package
44-# 1. For visibility for tools like vulnix, and
55-# 2. To avoid a diamond-dependency problem with opencv linking the normal libtiff
66-# and opentoonz linking opencv and this modified libtiff, we build an opencv
77-# against this modified libtiff as well.
88-#
99-# We use a separate mkDerivation rather than a minimal libtiff.overrideAttrs
1010-# because the main libtiff builds with cmake and this version of libtiff was
1111-# forked before libtiff gained CMake build capability (added in libtiff-4.0.5).
1212-1313-{ lib, fetchFromGitHub, stdenv, pkg-config, zlib, libjpeg, xz, libtiff, }:
1414-1515-let source = import ./source.nix { inherit fetchFromGitHub; };
1616-1717-in stdenv.mkDerivation {
1818- pname = "libtiff";
1919- version = source.versions.libtiff + "-opentoonz";
2020-2121- inherit (source) src;
2222- outputs = [ "bin" "dev" "out" "man" "doc" ];
2323-2424- nativeBuildInputs = [ pkg-config ];
2525- propagatedBuildInputs = [ zlib libjpeg xz ];
2626-2727- postUnpack = ''
2828- sourceRoot="$sourceRoot/thirdparty/tiff-${source.versions.libtiff}"
2929- '';
3030-3131- # opentoonz uses internal libtiff headers
3232- postInstall = ''
3333- cp libtiff/{tif_config,tif_dir,tiffiop}.h $dev/include
3434- '';
3535-3636- meta = libtiff.meta // {
3737- knownVulnerabilities = [''
3838- Do not open untrusted files with Opentoonz:
3939- Opentoonz uses an old custom fork of tibtiff from 2012 that is known to
4040- be affected by at least these 50 vulnerabilities:
4141- CVE-2012-4564 CVE-2013-4232 CVE-2013-4243 CVE-2013-4244 CVE-2014-8127
4242- CVE-2014-8128 CVE-2014-8129 CVE-2014-8130 CVE-2014-9330 CVE-2015-1547
4343- CVE-2015-8781 CVE-2015-8782 CVE-2015-8783 CVE-2015-8784 CVE-2015-8870
4444- CVE-2016-3620 CVE-2016-3621 CVE-2016-3623 CVE-2016-3624 CVE-2016-3625
4545- CVE-2016-3631 CVE-2016-3632 CVE-2016-3633 CVE-2016-3634 CVE-2016-3658
4646- CVE-2016-3945 CVE-2016-3990 CVE-2016-3991 CVE-2016-5102 CVE-2016-5314
4747- CVE-2016-5315 CVE-2016-5316 CVE-2016-5318 CVE-2016-5319 CVE-2016-5321
4848- CVE-2016-5322 CVE-2016-5323 CVE-2016-6223 CVE-2016-9453 CVE-2016-9532
4949- CVE-2017-9935 CVE-2017-9937 CVE-2018-10963 CVE-2018-5360
5050- CVE-2019-14973 CVE-2019-17546 CVE-2020-35521 CVE-2020-35522
5151- CVE-2020-35523 CVE-2020-35524
5252- More info at https://github.com/opentoonz/opentoonz/issues/4193
5353- ''];
5454- maintainers = with lib.maintainers; [ chkno ];
5555- };
5656-}
-16
pkgs/applications/graphics/opentoonz/source.nix
···11-# opentoonz's source archive contains both opentoonz's source and a modified
22-# version of libtiff that opentoonz requires.
33-44-{ fetchFromGitHub, }: rec {
55- versions = {
66- opentoonz = "1.7.1";
77- libtiff = "4.0.3"; # The version in thirdparty/tiff-*
88- };
99-1010- src = fetchFromGitHub {
1111- owner = "opentoonz";
1212- repo = "opentoonz";
1313- rev = "v${versions.opentoonz}";
1414- hash = "sha256-5iXOvh4QTv+G0fjEHU62u7QCee+jbvKhK0+fQXbdJis=";
1515- };
1616-}