diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/applications/graphics/gscan2pdf/default.nix index bbf52e105a284..d7ebb0a747ea3 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/development/libraries/libtiff/4.5.nix b/pkgs/development/libraries/libtiff/4.5.nix deleted file mode 100644 index 3b24c6f1a2e1d..0000000000000 --- 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 04b67ff83bdeb..c8871a4ba68e8 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"; @@ -93,7 +90,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" ]; 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 49af1abb0a54a..0000000000000 --- 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/libtiff_t.nix b/pkgs/development/libraries/libtiff/libtiff_t.nix new file mode 100644 index 0000000000000..37e48f6ea14f4 --- /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/development/libraries/libtiff/rename-version-4.5.patch b/pkgs/development/libraries/libtiff/rename-version-4.5.patch deleted file mode 100644 index 3e93569d4245a..0000000000000 --- 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/servers/hylafaxplus/default.nix b/pkgs/servers/hylafaxplus/default.nix index 278f0b4c5260a..246ad636ceb4c 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 e00d94b5a979b..d7284e2428651 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' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cb74ff63aa151..78e86a7c0f94b 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 { }; @@ -9167,8 +9171,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 { }; @@ -23031,8 +23036,14 @@ 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_t = callPackage ../development/libraries/libtiff/libtiff_t.nix { }; + }) + libtiff + libtiff_t + ; libtiger = callPackage ../development/libraries/libtiger { };