From fabdf2c8a9101306fe884bed4a356facd7961108 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:53:28 +0100 Subject: [PATCH 1/6] hylafaxplus: 7.0.7 -> 7.0.8 Note that this update makes hylafaxplus compatible with libtiff 4.6.0t (a fork of libtiff at version 4.6.0). A follow-up commit will introduce that library fork and make hylafaxplus build with it. --- pkgs/servers/hylafaxplus/default.nix | 4 ++-- pkgs/servers/hylafaxplus/libtiff-4.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/hylafaxplus/default.nix b/pkgs/servers/hylafaxplus/default.nix index 278f0b4c5260..246ad636ceb4 100644 --- a/pkgs/servers/hylafaxplus/default.nix +++ b/pkgs/servers/hylafaxplus/default.nix @@ -32,8 +32,8 @@ let pname = "hylafaxplus"; - version = "7.0.7"; - hash = "sha512-nUvt+M0HBYN+MsGskuuDt1j0nI5Dk8MbfK/OVxP2FCDby3eiDg0eDtcpIxlOe4o0klko07zDRIb06zqh8ABuKA=="; + version = "7.0.8"; + hash = "sha512-6wTLVcaHpASy+2i+jeoJ1cM2aLgI5vznGrLd4NCkLHiOxlfCh/ASRaj2Nxt9ZZ5NN/deEwf9tNSZ7MkFZHVsqA=="; configSite = substituteAll { name = "${pname}-config.site"; diff --git a/pkgs/servers/hylafaxplus/libtiff-4.patch b/pkgs/servers/hylafaxplus/libtiff-4.patch index e00d94b5a979..d7284e242865 100644 --- a/pkgs/servers/hylafaxplus/libtiff-4.patch +++ b/pkgs/servers/hylafaxplus/libtiff-4.patch @@ -1,11 +1,11 @@ https://bugs.gentoo.org/706154 --- a/configure +++ b/configure -@@ -2583,7 +2583,7 @@ EOF +@@ -2584,7 +2584,7 @@ EOF echo '#define TIFFSTRIPBYTECOUNTS uint32_t' echo '#define TIFFVERSION TIFF_VERSION' echo '#define TIFFHEADER TIFFHeader';; -- 4.[012345]) tiff_runlen_t="uint32_t" +- 4.[0123456]) tiff_runlen_t="uint32_t" + 4.[0-9]) tiff_runlen_t="uint32_t" tiff_offset_t="uint64_t" echo '#define TIFFSTRIPBYTECOUNTS uint64_t' From 376bd1931e864348d7383bada1c3df3c98ef4d37 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 23 Mar 2024 09:04:17 +0100 Subject: [PATCH 2/6] libtiff: fix meta.changelog url --- pkgs/development/libraries/libtiff/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index 04b67ff83bde..66ed2f07c84c 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -93,7 +93,7 @@ stdenv.mkDerivation (finalAttrs: { 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${finalAttrs.version}.html"; + changelog = "https://libtiff.gitlab.io/libtiff/releases/v${finalAttrs.version}.html"; license = licenses.libtiff; platforms = platforms.unix ++ platforms.windows; pkgConfigModules = [ "libtiff-4" ]; From 6ce2532285410691a83142877891fd57f340a502 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 23 Mar 2024 09:16:15 +0100 Subject: [PATCH 3/6] libtiff_t: init at 4.6.0t (fork of libtiff) libtiff 4.6.0 dropped a bunch of helper tools, thereby breaking packages that depend on these tools. To fix those packages, nixpkgs started packaging libtiff_4_5 separately, see commit f57a4b0ac1b954eec0c8def2a99e2a464ac6ff7a. Currently, two packages use libtiff_4_5: * hylafaplus (cd3771c7097b1ce25b0b3cd4e16361bf2929aa15) * gscan2pdf (9a579e14dd7536bf4cf554c065615810defd72d8) Lee Howard (core developer of hylafaxplus) forked libtiff 4.6.0 to provide a current version that restores those dropped helper tools. The library is also called "libtiff", with current version "4.6.0t". It is based on libtiff 4.6.0 and incorporates several fixes, particularly for the dropped helper tools, see https://sourceforge.net/p/hylafax/mailman/message/58751878/ and http://www.libtiff.org/releases/v4.6.0t.html . The commit at hand packages that fork for nixpkgs. Follow-up commits will replace libtiff_4_5 with libtiff_t, so affected packages can again use a current libtiff library. The build recipe of libtiff_t is based on the libtiff recipe. Besides adapted URLs, the only change is dropping `passthru`, as it referred to many packages depending on the original libtiff. The unorthodox code introduced in all-packages.nix is needed to satisfy the automated "by-name" check; see "Recommendation for new packages with multiple versions" in the file `pkgs/by-name/README.md`. Depending on how things develop in the future, we might want to switch completely to the forked libtiff library one day. Or the original libtiff restores the missing tools, making libtiff_t superfluous. --- .../libraries/libtiff/libtiff_t.nix | 73 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 12 ++- 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/libtiff/libtiff_t.nix diff --git a/pkgs/development/libraries/libtiff/libtiff_t.nix b/pkgs/development/libraries/libtiff/libtiff_t.nix new file mode 100644 index 000000000000..37e48f6ea14f --- /dev/null +++ b/pkgs/development/libraries/libtiff/libtiff_t.nix @@ -0,0 +1,73 @@ +{ lib +, stdenv +, fetchzip + +, autoreconfHook +, pkg-config +, sphinx + +, libdeflate +, libjpeg +, xz +, zlib +}: + +# This is a fork created by the hylafaxplus developer to +# restore tools dropped by original libtiff in version 4.6.0. + +stdenv.mkDerivation (finalAttrs: { + pname = "libtiff_t"; + version = "4.6.0t"; + + src = fetchzip { + url = "http://www.libtiff.org/downloads/tiff-${finalAttrs.version}.tar.xz"; + hash = "sha256-9ov4w2jw4LtKr82/4jWMAGhc5GEdviJ7bT+y0+U/Ac4="; + }; + + patches = [ + # FreeImage needs this patch + ./headers.patch + # libc++abi 11 has an `#include `, 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; + + meta = with lib; { + description = "Library and utilities for working with the TIFF image file format (fork containing tools dropped in original libtiff version)"; + homepage = "http://www.libtiff.org"; + changelog = "http://www.libtiff.org/releases/v${finalAttrs.version}.html"; + maintainers = with maintainers; [ yarny ]; + license = licenses.libtiff; + platforms = platforms.unix ++ platforms.windows; + pkgConfigModules = [ "libtiff-4" ]; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cb74ff63aa15..c03ad1fc38fc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23031,8 +23031,16 @@ with pkgs; libtifiles2 = callPackage ../development/libraries/libtifiles2 { }; - libtiff = callPackage ../development/libraries/libtiff { }; - libtiff_4_5 = callPackage ../development/libraries/libtiff/4.5.nix { }; + inherit + ({ + libtiff = callPackage ../development/libraries/libtiff { }; + libtiff_4_5 = callPackage ../development/libraries/libtiff/4.5.nix { }; + libtiff_t = callPackage ../development/libraries/libtiff/libtiff_t.nix { }; + }) + libtiff + libtiff_4_5 + libtiff_t + ; libtiger = callPackage ../development/libraries/libtiger { }; From cff182e2194369a71a21daefd173e9d2c692e901 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 23 Mar 2024 09:44:40 +0100 Subject: [PATCH 4/6] hylafaxplus: switch to current libtiff 4.6.0t hylafaxplus is not compatible with libtiff 4.6.0 as published on https://libtiff.gitlab.io/libtiff/ and http://www.simplesystems.org/libtiff/ . To fix the build, we used an older libtiff version (see cd3771c7097b1ce25b0b3cd4e16361bf2929aa15). In the meantime, hylafaxplus developer Lee Howard published a forked version "4.6.0t" of libtiff, providing the missing tools for hylafaxplus, see https://sourceforge.net/p/hylafax/mailman/message/58751879/ . The commit at hand changes the libtiff version for hylafaxplus to use that fork. --- pkgs/top-level/all-packages.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c03ad1fc38fc..817fada27dd7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9167,8 +9167,9 @@ with pkgs; hybridreverb2 = callPackage ../applications/audio/hybridreverb2 { }; hylafaxplus = callPackage ../servers/hylafaxplus { - # libtiff >= 4.6 dropped many executables needed by hylafaxplus - libtiff = libtiff_4_5; + # needs this fork of libtiff, because original libtiff + # stopped packaging required tools with version 4.6 + libtiff = libtiff_t; }; hyphen = callPackage ../development/libraries/hyphen { }; From ec1a3695b48e649ededd2b25bf421aa9145a9afe Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:25:33 +0100 Subject: [PATCH 5/6] gscan2pdf: switch to current libtiff 4.6.0t gscan2pdf is not compatible with libtiff 4.6.0 as published on https://libtiff.gitlab.io/libtiff/ and http://www.simplesystems.org/libtiff/ . To fix the build, we used an older libtiff version (see 9a579e14dd7536bf4cf554c065615810defd72d8). In the meantime, hylafaxplus developer Lee Howard published a forked version "4.6.0t" of libtiff, providing the missing tools, see https://sourceforge.net/p/hylafax/mailman/message/58751879/ . That fork is also suitable for gscan2pdf, so the commit at hand changes the libtiff version for gscan2pdf to use that fork. --- pkgs/applications/graphics/gscan2pdf/default.nix | 9 +++------ pkgs/top-level/all-packages.nix | 6 +++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/applications/graphics/gscan2pdf/default.nix index bbf52e105a28..d7ebb0a747ea 100644 --- a/pkgs/applications/graphics/gscan2pdf/default.nix +++ b/pkgs/applications/graphics/gscan2pdf/default.nix @@ -2,7 +2,7 @@ # libs librsvg, sane-backends, sane-frontends, # runtime dependencies - imagemagick, libtiff_4_5, djvulibre, poppler_utils, ghostscript, unpaper, pdftk, + imagemagick, libtiff, djvulibre, poppler_utils, ghostscript, unpaper, pdftk, # test dependencies xvfb-run, liberation_ttf, file, tesseract }: @@ -82,7 +82,7 @@ perlPackages.buildPerlPackage rec { wrapProgram "$out/bin/gscan2pdf" \ --prefix PATH : "${sane-backends}/bin" \ --prefix PATH : "${imagemagick}/bin" \ - --prefix PATH : "${libtiff_4_5}/bin" \ + --prefix PATH : "${libtiff}/bin" \ --prefix PATH : "${djvulibre}/bin" \ --prefix PATH : "${poppler_utils}/bin" \ --prefix PATH : "${ghostscript}/bin" \ @@ -98,10 +98,7 @@ perlPackages.buildPerlPackage rec { nativeCheckInputs = [ imagemagick - # Needs older libtiff version, because it stopped packageing tools like - # tiff2pdf and others in version 4.6. These tools are necessary for gscan2pdf. - # See commit f57a4b0ac1b954eec0c8def2a99e2a464ac6ff7a for in-depth explanation. - libtiff_4_5 + libtiff djvulibre poppler_utils ghostscript diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 817fada27dd7..05f11595a9d7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5543,7 +5543,11 @@ with pkgs; grobi = callPackage ../tools/X11/grobi { }; - gscan2pdf = callPackage ../applications/graphics/gscan2pdf { }; + gscan2pdf = callPackage ../applications/graphics/gscan2pdf { + # needs this fork of libtiff, because original libtiff + # stopped packaging required tools with version 4.6 + libtiff = libtiff_t; + }; gsctl = callPackage ../applications/misc/gsctl { }; From 87eabf9c4defa60c12436590b64a68ad4fad790d Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 23 Mar 2024 09:47:40 +0100 Subject: [PATCH 6/6] Revert "libtiff: introduce libtiff_4_5" This reverts commit f57a4b0ac1b954eec0c8def2a99e2a464ac6ff7a. The old version libtiff_4_5 is no longer needed. Both dependents (gscan2pdf and hylafaxplus) have switched to the forked libtiff version 4.6.0t which is based on the current libtiff version 4.6.0 but also contains required command line tools missing in the original libtiff library. --- pkgs/development/libraries/libtiff/4.5.nix | 86 ------------------- .../development/libraries/libtiff/default.nix | 3 - .../libraries/libtiff/headers-4.5.patch | 16 ---- .../libtiff/rename-version-4.5.patch | 21 ----- pkgs/top-level/all-packages.nix | 2 - 5 files changed, 128 deletions(-) delete mode 100644 pkgs/development/libraries/libtiff/4.5.nix delete mode 100644 pkgs/development/libraries/libtiff/headers-4.5.patch delete mode 100644 pkgs/development/libraries/libtiff/rename-version-4.5.patch diff --git a/pkgs/development/libraries/libtiff/4.5.nix b/pkgs/development/libraries/libtiff/4.5.nix deleted file mode 100644 index 3b24c6f1a2e1..000000000000 --- a/pkgs/development/libraries/libtiff/4.5.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ lib -, stdenv -, fetchFromGitLab -, fetchpatch - -, autoreconfHook -, pkg-config -, sphinx - -, libdeflate -, libjpeg -, xz -, zlib -}: - -stdenv.mkDerivation rec { - pname = "libtiff"; - version = "4.5.1"; - - src = fetchFromGitLab { - owner = "libtiff"; - repo = "libtiff"; - rev = "v${version}"; - hash = "sha256-qQEthy6YhNAQmdDMyoCIvK8f3Tx25MgqhJZW74CB93E="; - }; - - patches = [ - # cf. https://bugzilla.redhat.com/2224974 - (fetchpatch { - name = "CVE-2023-40745.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/bdf7b2621c62e04d0408391b7d5611502a752cd0.diff"; - hash = "sha256-HdU02YJ1/T3dnCT+yG03tUyAHkgeQt1yjZx/auCQxyw="; - }) - # cf. https://bugzilla.redhat.com/2224971 - (fetchpatch { - name = "CVE-2023-41175.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/965fa243004e012adc533ae8e38db3055f101a7f.diff"; - hash = "sha256-Pvg6JfJWOIaTrfFF0YSREZkS9saTG9IsXnsXtcyKILA="; - }) - # FreeImage needs this patch - ./headers-4.5.patch - # libc++abi 11 has an `#include `, this picks up files name - # `version` in the project's include paths - ./rename-version-4.5.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 ]; - - propagatedBuildInputs = [ - libdeflate - libjpeg - xz - zlib - ]; - - enableParallelBuilding = true; - - doCheck = true; - - 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"; - # XXX not enabled for now to keep hydra builds running, - # but we have to keep an eye on security updates in supported version - #knownVulnerabilities = [ "support for version 4.5 ended in Sept 2023" ]; - maintainers = with maintainers; [ yarny ]; - license = licenses.libtiff; - platforms = platforms.unix; - }; -} diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index 66ed2f07c84c..c8871a4ba68e 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -28,9 +28,6 @@ stdenv.mkDerivation (finalAttrs: { 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"; diff --git a/pkgs/development/libraries/libtiff/headers-4.5.patch b/pkgs/development/libraries/libtiff/headers-4.5.patch deleted file mode 100644 index 49af1abb0a54..000000000000 --- a/pkgs/development/libraries/libtiff/headers-4.5.patch +++ /dev/null @@ -1,16 +0,0 @@ -export private headers for freeimage ---- i/libtiff/Makefile.am -+++ w/libtiff/Makefile.am -@@ -36,8 +36,12 @@ EXTRA_DIST = \ - tiffconf.h.cmake.in - - libtiffinclude_HEADERS = \ -+ tif_config.h \ -+ tif_dir.h \ -+ tif_hash_set.h \ - tiff.h \ - tiffio.h \ -+ tiffiop.h \ - tiffvers.h - - if HAVE_CXX diff --git a/pkgs/development/libraries/libtiff/rename-version-4.5.patch b/pkgs/development/libraries/libtiff/rename-version-4.5.patch deleted file mode 100644 index 3e93569d4245..000000000000 --- a/pkgs/development/libraries/libtiff/rename-version-4.5.patch +++ /dev/null @@ -1,21 +0,0 @@ -fix case-insensitive build ---- a/Makefile.am -+++ b/Makefile.am -@@ -34,7 +34,7 @@ docfiles = \ - README.md \ - RELEASE-DATE \ - TODO \ -- VERSION -+ VERSION.txt - - EXTRA_DIST = \ - cmake \ -@@ -61,7 +61,7 @@ SUBDIRS = port libtiff tools build contrib test doc - - release: - (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) -- (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION) -+ (rm -f $(top_srcdir)/VERSION.txt && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION.txt) - (rm -f $(top_srcdir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(LIBTIFF_RELEASE_DATE),;s,LIBTIFF_MAJOR_VERSION,$(LIBTIFF_MAJOR_VERSION),;s,LIBTIFF_MINOR_VERSION,$(LIBTIFF_MINOR_VERSION),;s,LIBTIFF_MICRO_VERSION,$(LIBTIFF_MICRO_VERSION),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_srcdir)/libtiff/tiffvers.h) - - pkgconfigdir = $(libdir)/pkgconfig diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05f11595a9d7..78e86a7c0f94 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23039,11 +23039,9 @@ with pkgs; inherit ({ libtiff = callPackage ../development/libraries/libtiff { }; - libtiff_4_5 = callPackage ../development/libraries/libtiff/4.5.nix { }; libtiff_t = callPackage ../development/libraries/libtiff/libtiff_t.nix { }; }) libtiff - libtiff_4_5 libtiff_t ;