From 919602500b571eea23fe580c62e9bad7a6d94447 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:06:58 +0200 Subject: [PATCH 1/7] libtiff: 4.6.0 -> 4.7.0 Release notes: https://libtiff.gitlab.io/libtiff/releases/v4.7.0.html Fixed CVEs: * CVE-2023-52356 https://gitlab.com/libtiff/libtiff/-/issues/622 * CVE-2024-7006 https://gitlab.com/libtiff/libtiff/-/issues/624 This update incorporates the `lerc` dependency declaration, therefore we drop the corresponding patch, c.f. https://gitlab.com/libtiff/libtiff/-/merge_requests/633 https://github.com/NixOS/nixpkgs/pull/320105 --- pkgs/development/libraries/libtiff/default.nix | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix index b66c8c288bc8..99fb5e644cfb 100644 --- a/pkgs/development/libraries/libtiff/default.nix +++ b/pkgs/development/libraries/libtiff/default.nix @@ -29,13 +29,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "libtiff"; - version = "4.6.0"; + version = "4.7.0"; src = fetchFromGitLab { owner = "libtiff"; repo = "libtiff"; rev = "v${finalAttrs.version}"; - hash = "sha256-qCg5qjsPPynCHIg0JsPJldwVdcYkI68zYmyNAKUCoyw="; + hash = "sha256-SuK9/a6OUAumEe1kz1itFJGKxJzbmHkBVLMnyXhIwmQ="; }; patches = [ @@ -44,15 +44,6 @@ stdenv.mkDerivation (finalAttrs: { # libc++abi 11 has an `#include `, this picks up files name # `version` in the project's include paths ./rename-version.patch - # Fix static linking of `libtiff` via `pkg-config` not working - # because `libtiff` does not declare `Lerc` dependency. - # nixpkgs has `lerc` >= 4 which provides a `.pc` file. - # TODO: Close when https://gitlab.com/libtiff/libtiff/-/merge_requests/633 is merged and available - (fetchpatch { - name = "libtiff-4.pc-Fix-Requires.private-missing-Lerc.patch"; - url = "https://gitlab.com/libtiff/libtiff/-/commit/ea882c3c240c14a897b9be38d815cc1893aafa59.patch"; - hash = "sha256-C0xA3k1sgKmGJjEnyG9UxhXqYBYShKUDQsyjhbEDJbQ="; - }) ]; postPatch = '' From b1b4a97dc9eb522a901f16157e00872decfdf4b7 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:36:52 +0200 Subject: [PATCH 2/7] hylafaxplus: use newest libtiff instead of libtiff 4.6.0t libtiff 4.7.0 restored the programs needed by hylafaxplus, cf. https://github.com/NixOS/nixpkgs/commit/cff182e2194369a71a21daefd173e9d2c692e901 --- pkgs/top-level/all-packages.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 848fcaddc1f7..996b03937904 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8739,11 +8739,7 @@ with pkgs; hybridreverb2 = callPackage ../applications/audio/hybridreverb2 { }; - hylafaxplus = callPackage ../servers/hylafaxplus { - # needs this fork of libtiff, because original libtiff - # stopped packaging required tools with version 4.6 - libtiff = libtiff_t; - }; + hylafaxplus = callPackage ../servers/hylafaxplus { }; hyphen = callPackage ../development/libraries/hyphen { }; From 86d7a802cb310b4aea78a6fbd2f0e9907a0429c3 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:39:07 +0200 Subject: [PATCH 3/7] gscan2pdf: use newest libtiff instead of libtiff 4.6.0t libtiff 4.7.0 restored the programs needed by gscan2pdf, cf. https://github.com/NixOS/nixpkgs/commit/ec1a3695b48e649ededd2b25bf421aa9145a9afe --- pkgs/top-level/all-packages.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 996b03937904..78b35c61a1eb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5281,11 +5281,7 @@ with pkgs; grobi = callPackage ../tools/X11/grobi { }; - gscan2pdf = callPackage ../applications/graphics/gscan2pdf { - # needs this fork of libtiff, because original libtiff - # stopped packaging required tools with version 4.6 - libtiff = libtiff_t; - }; + gscan2pdf = callPackage ../applications/graphics/gscan2pdf { }; gsctl = callPackage ../applications/misc/gsctl { }; From 97e1737419ded3af33ed32e7305efe0901be0ace Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:41:22 +0200 Subject: [PATCH 4/7] libtiff_t (fork of libtiff): drop libtiff 4.6.0t (a fork of libtiff) was needed after libtiff dropped some programs with version 4.6.0 that are required by other packages (notably hylafaxplus and gscan2pdf), cf. https://github.com/NixOS/nixpkgs/pull/298561/commits libtiff 4.7.0 again contains those programs, so its dependees no longer need the forked version. Hence libtiff_t is no longer needed and can be dropped. --- .../libraries/libtiff/libtiff_t.nix | 73 ------------------- pkgs/top-level/all-packages.nix | 9 +-- 2 files changed, 1 insertion(+), 81 deletions(-) delete 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 deleted file mode 100644 index 37e48f6ea14f..000000000000 --- a/pkgs/development/libraries/libtiff/libtiff_t.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ 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 78b35c61a1eb..f8e060c2826c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22094,14 +22094,7 @@ with pkgs; libtifiles2 = callPackage ../development/libraries/libtifiles2 { }; - inherit - ({ - libtiff = callPackage ../development/libraries/libtiff { }; - libtiff_t = callPackage ../development/libraries/libtiff/libtiff_t.nix { }; - }) - libtiff - libtiff_t - ; + libtiff = callPackage ../development/libraries/libtiff { }; libtiger = callPackage ../development/libraries/libtiger { }; From 6099db12925ab88280a52ce607a6d4089d3b38e9 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:51:46 +0200 Subject: [PATCH 5/7] hylafaxplus: migrate to `pkgs/by-name` overlay --- pkgs/{servers => by-name/hy}/hylafaxplus/config.site | 0 pkgs/{servers => by-name/hy}/hylafaxplus/libtiff-4.patch | 0 .../default.nix => by-name/hy/hylafaxplus/package.nix} | 0 pkgs/{servers => by-name/hy}/hylafaxplus/post-install-check.sh | 0 pkgs/{servers => by-name/hy}/hylafaxplus/post-install.sh | 0 pkgs/{servers => by-name/hy}/hylafaxplus/post-patch.sh | 0 pkgs/top-level/all-packages.nix | 2 -- 7 files changed, 2 deletions(-) rename pkgs/{servers => by-name/hy}/hylafaxplus/config.site (100%) rename pkgs/{servers => by-name/hy}/hylafaxplus/libtiff-4.patch (100%) rename pkgs/{servers/hylafaxplus/default.nix => by-name/hy/hylafaxplus/package.nix} (100%) rename pkgs/{servers => by-name/hy}/hylafaxplus/post-install-check.sh (100%) rename pkgs/{servers => by-name/hy}/hylafaxplus/post-install.sh (100%) rename pkgs/{servers => by-name/hy}/hylafaxplus/post-patch.sh (100%) diff --git a/pkgs/servers/hylafaxplus/config.site b/pkgs/by-name/hy/hylafaxplus/config.site similarity index 100% rename from pkgs/servers/hylafaxplus/config.site rename to pkgs/by-name/hy/hylafaxplus/config.site diff --git a/pkgs/servers/hylafaxplus/libtiff-4.patch b/pkgs/by-name/hy/hylafaxplus/libtiff-4.patch similarity index 100% rename from pkgs/servers/hylafaxplus/libtiff-4.patch rename to pkgs/by-name/hy/hylafaxplus/libtiff-4.patch diff --git a/pkgs/servers/hylafaxplus/default.nix b/pkgs/by-name/hy/hylafaxplus/package.nix similarity index 100% rename from pkgs/servers/hylafaxplus/default.nix rename to pkgs/by-name/hy/hylafaxplus/package.nix diff --git a/pkgs/servers/hylafaxplus/post-install-check.sh b/pkgs/by-name/hy/hylafaxplus/post-install-check.sh similarity index 100% rename from pkgs/servers/hylafaxplus/post-install-check.sh rename to pkgs/by-name/hy/hylafaxplus/post-install-check.sh diff --git a/pkgs/servers/hylafaxplus/post-install.sh b/pkgs/by-name/hy/hylafaxplus/post-install.sh similarity index 100% rename from pkgs/servers/hylafaxplus/post-install.sh rename to pkgs/by-name/hy/hylafaxplus/post-install.sh diff --git a/pkgs/servers/hylafaxplus/post-patch.sh b/pkgs/by-name/hy/hylafaxplus/post-patch.sh similarity index 100% rename from pkgs/servers/hylafaxplus/post-patch.sh rename to pkgs/by-name/hy/hylafaxplus/post-patch.sh diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f8e060c2826c..e04133b8757c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8735,8 +8735,6 @@ with pkgs; hybridreverb2 = callPackage ../applications/audio/hybridreverb2 { }; - hylafaxplus = callPackage ../servers/hylafaxplus { }; - hyphen = callPackage ../development/libraries/hyphen { }; hyphenDicts = recurseIntoAttrs (callPackages ../development/libraries/hyphen/dictionaries.nix {}); From e2c2aae222d423938f0925360d65ab4f1f467c73 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:56:05 +0200 Subject: [PATCH 6/7] gscan2pdf: migrate to `pkgs/by-name` overlay --- .../graphics => by-name/gs}/gscan2pdf/image-utf8-fix.patch | 0 .../gscan2pdf/default.nix => by-name/gs/gscan2pdf/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 2 deletions(-) rename pkgs/{applications/graphics => by-name/gs}/gscan2pdf/image-utf8-fix.patch (100%) rename pkgs/{applications/graphics/gscan2pdf/default.nix => by-name/gs/gscan2pdf/package.nix} (100%) diff --git a/pkgs/applications/graphics/gscan2pdf/image-utf8-fix.patch b/pkgs/by-name/gs/gscan2pdf/image-utf8-fix.patch similarity index 100% rename from pkgs/applications/graphics/gscan2pdf/image-utf8-fix.patch rename to pkgs/by-name/gs/gscan2pdf/image-utf8-fix.patch diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/by-name/gs/gscan2pdf/package.nix similarity index 100% rename from pkgs/applications/graphics/gscan2pdf/default.nix rename to pkgs/by-name/gs/gscan2pdf/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e04133b8757c..f954175ade23 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5281,8 +5281,6 @@ with pkgs; grobi = callPackage ../tools/X11/grobi { }; - gscan2pdf = callPackage ../applications/graphics/gscan2pdf { }; - gsctl = callPackage ../applications/misc/gsctl { }; gsocket = callPackage ../tools/networking/gsocket { }; From 6a6a191d00ef20a836be34ac5a8ce6fbe1dbb640 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 8 Sep 2024 09:07:10 +0200 Subject: [PATCH 7/7] libtiff: migrate to `pkgs/by-name` overlay --- .../{development/libraries => by-name/li}/libtiff/headers.patch | 0 .../libtiff/default.nix => by-name/li/libtiff/package.nix} | 0 .../libraries => by-name/li}/libtiff/rename-version.patch | 0 pkgs/top-level/all-packages.nix | 2 -- 4 files changed, 2 deletions(-) rename pkgs/{development/libraries => by-name/li}/libtiff/headers.patch (100%) rename pkgs/{development/libraries/libtiff/default.nix => by-name/li/libtiff/package.nix} (100%) rename pkgs/{development/libraries => by-name/li}/libtiff/rename-version.patch (100%) diff --git a/pkgs/development/libraries/libtiff/headers.patch b/pkgs/by-name/li/libtiff/headers.patch similarity index 100% rename from pkgs/development/libraries/libtiff/headers.patch rename to pkgs/by-name/li/libtiff/headers.patch diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/by-name/li/libtiff/package.nix similarity index 100% rename from pkgs/development/libraries/libtiff/default.nix rename to pkgs/by-name/li/libtiff/package.nix diff --git a/pkgs/development/libraries/libtiff/rename-version.patch b/pkgs/by-name/li/libtiff/rename-version.patch similarity index 100% rename from pkgs/development/libraries/libtiff/rename-version.patch rename to pkgs/by-name/li/libtiff/rename-version.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f954175ade23..6977276c7e18 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22090,8 +22090,6 @@ with pkgs; libtifiles2 = callPackage ../development/libraries/libtifiles2 { }; - libtiff = callPackage ../development/libraries/libtiff { }; - libtiger = callPackage ../development/libraries/libtiger { }; libtommath = callPackage ../development/libraries/libtommath { };