Skip to content

Commit

Permalink
Merge pull request #298561 from Yarny0/hylafax-update-libtiff-and-tools
Browse files Browse the repository at this point in the history
replace `libtiff_4_5` with `libtiff_and_tools`, update `hylafaxplus`
  • Loading branch information
SuperSandro2000 committed Apr 21, 2024
2 parents 25a77d3 + 87eabf9 commit 241d162
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 142 deletions.
9 changes: 3 additions & 6 deletions pkgs/applications/graphics/gscan2pdf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 }:

Expand Down Expand Up @@ -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" \
Expand All @@ -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
Expand Down
86 changes: 0 additions & 86 deletions pkgs/development/libraries/libtiff/4.5.nix

This file was deleted.

5 changes: 1 addition & 4 deletions pkgs/development/libraries/libtiff/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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" ];
Expand Down
16 changes: 0 additions & 16 deletions pkgs/development/libraries/libtiff/headers-4.5.patch

This file was deleted.

73 changes: 73 additions & 0 deletions pkgs/development/libraries/libtiff/libtiff_t.nix
Original file line number Diff line number Diff line change
@@ -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 <version>`, 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" ];
};
})
21 changes: 0 additions & 21 deletions pkgs/development/libraries/libtiff/rename-version-4.5.patch

This file was deleted.

4 changes: 2 additions & 2 deletions pkgs/servers/hylafaxplus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/servers/hylafaxplus/libtiff-4.patch
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
21 changes: 16 additions & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5537,7 +5537,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 { };

Expand Down Expand Up @@ -9161,8 +9165,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 { };
Expand Down Expand Up @@ -23026,8 +23031,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 { };

Expand Down

0 comments on commit 241d162

Please sign in to comment.