mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-24 00:45:52 +00:00
- fix after tiff update to 4.0.0
PR: 149611
This commit is contained in:
parent
a8b6b27f89
commit
b299f4ee6a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=260033
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= hylafax
|
||||
PORTVERSION= 6.0.4
|
||||
PORTREVISION= 4
|
||||
PORTREVISION= 5
|
||||
CATEGORIES= comms
|
||||
MASTER_SITES= ftp://ftp.hylafax.org/source/
|
||||
|
||||
|
102
comms/hylafax/files/patch-FileTransfer.c++
Normal file
102
comms/hylafax/files/patch-FileTransfer.c++
Normal file
@ -0,0 +1,102 @@
|
||||
--- hfaxd/FileTransfer.c++.orig 2009-12-28 20:05:40.000000000 +0100
|
||||
+++ hfaxd/FileTransfer.c++ 2010-08-26 21:47:16.000000000 +0200
|
||||
@@ -65,11 +65,31 @@
|
||||
static const char* strunames[] = { "File", "Record", "Page", "TIFF" };
|
||||
static const char* modenames[] = { "Stream", "Block", "Compressed", "ZIP" };
|
||||
|
||||
+extern "C" {
|
||||
+/*
|
||||
+ * TIFF Image File Directories are comprised of a table of field
|
||||
+ * descriptors of the form shown below. The table is sorted in
|
||||
+ * ascending order by tag. The values associated with each entry are
|
||||
+ * disjoint and may appear anywhere in the file (so long as they are
|
||||
+ * placed on a word boundary).
|
||||
+ *
|
||||
+ * If the value is 4 bytes or less, then it is placed in the offset
|
||||
+ * field to save space. If the value is less than 4 bytes, it is
|
||||
+ * left-justified in the offset field.
|
||||
+ */
|
||||
+typedef struct {
|
||||
+ uint16 tdir_tag; /* see below */
|
||||
+ uint16 tdir_type; /* data type; see below */
|
||||
+ uint32 tdir_count; /* number of items; length in spec */
|
||||
+ uint32 tdir_offset; /* byte offset to field data */
|
||||
+} TIFFDirEntry;
|
||||
+}
|
||||
+
|
||||
#define N(a) (sizeof (a) / sizeof (a[0]))
|
||||
|
||||
|
||||
static bool
|
||||
-isTIFF(const TIFFHeader& h)
|
||||
+isTIFF(const TIFFHeaderClassic& h)
|
||||
{
|
||||
if (h.tiff_magic != TIFF_BIGENDIAN && h.tiff_magic != TIFF_LITTLEENDIAN)
|
||||
return (false);
|
||||
@@ -82,7 +102,7 @@
|
||||
// byte swap version stamp if opposite byte order
|
||||
if ((u.c[0] == 0) ^ (h.tiff_magic == TIFF_BIGENDIAN))
|
||||
TIFFSwabShort(&version);
|
||||
- return (version == TIFF_VERSION);
|
||||
+ return (version == TIFF_VERSION_CLASSIC);
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +249,7 @@
|
||||
uint32* sb;
|
||||
TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &sb);
|
||||
file_size = sizeof (DirTemplate) +
|
||||
- sizeof (TIFFHeader) + sizeof (uint16);
|
||||
+ sizeof (TIFFHeaderClassic) + sizeof (uint16);
|
||||
for (tstrip_t s = 0, ns = TIFFNumberOfStrips(tif); s < ns; s++)
|
||||
file_size += sb[s];
|
||||
reply(code, "%s for %s (%lu bytes).",
|
||||
@@ -261,10 +281,10 @@
|
||||
if (fd >= 0) {
|
||||
union {
|
||||
char buf[512];
|
||||
- TIFFHeader h;
|
||||
+ TIFFHeaderClassic h;
|
||||
} b;
|
||||
ssize_t cc = Sys::read(fd, (char*) &b, sizeof (b));
|
||||
- if (cc > (ssize_t)sizeof (b.h) && b.h.tiff_version == TIFF_VERSION &&
|
||||
+ if (cc > (ssize_t)sizeof (b.h) && b.h.tiff_version == TIFF_VERSION_CLASSIC &&
|
||||
(b.h.tiff_magic == TIFF_BIGENDIAN ||
|
||||
b.h.tiff_magic == TIFF_LITTLEENDIAN)) {
|
||||
(void) lseek(fd, 0L, SEEK_SET); // rewind
|
||||
@@ -343,7 +363,7 @@
|
||||
{
|
||||
static DirTemplate templ = {
|
||||
#define TIFFdiroff(v) \
|
||||
- (uint32) (sizeof (TIFFHeader) + sizeof (uint16) + \
|
||||
+ (uint32) (sizeof (TIFFHeaderClassic) + sizeof (uint16) + \
|
||||
(intptr_t) &(((DirTemplate*) 0)->v))
|
||||
{ TIFFTAG_SUBFILETYPE, TIFF_LONG, 1 },
|
||||
{ TIFFTAG_IMAGEWIDTH, TIFF_LONG, 1 },
|
||||
@@ -377,14 +397,14 @@
|
||||
* of things about the contents of the TIFF file.
|
||||
*/
|
||||
struct {
|
||||
- TIFFHeader h;
|
||||
+ TIFFHeaderClassic h;
|
||||
uint16 dircount;
|
||||
u_char dirstuff[sizeof (templ)];
|
||||
} buf;
|
||||
union { int32 i; char c[4]; } u; u.i = 1;
|
||||
buf.h.tiff_magic = (u.c[0] == 0 ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN);
|
||||
- buf.h.tiff_version = TIFF_VERSION;
|
||||
- buf.h.tiff_diroff = sizeof (TIFFHeader);
|
||||
+ buf.h.tiff_version = TIFF_VERSION_CLASSIC;
|
||||
+ buf.h.tiff_diroff = sizeof (TIFFHeaderClassic);
|
||||
buf.dircount = (uint16) NTAGS;
|
||||
getLong(tif, templ.SubFileType);
|
||||
getLong(tif, templ.ImageWidth);
|
||||
@@ -957,7 +977,7 @@
|
||||
if (FileCache::lookup(docname, sb) && S_ISREG(sb.st_mode)) {
|
||||
union {
|
||||
char buf[512];
|
||||
- TIFFHeader h;
|
||||
+ TIFFHeaderClassic h;
|
||||
} b;
|
||||
ssize_t cc = Sys::read(fd, (char*) &b, sizeof (b));
|
||||
if (cc > 2 && b.buf[0] == '%' && b.buf[1] == '!')
|
@ -1,5 +1,5 @@
|
||||
--- configure.orig 2009-12-28 20:05:40.000000000 +0100
|
||||
+++ configure 2009-12-31 10:43:58.000000000 +0100
|
||||
+++ configure 2010-08-26 21:36:38.000000000 +0200
|
||||
@@ -831,6 +831,7 @@
|
||||
# NB: use ANSI C prototype to weed out non-ANSI compilers.
|
||||
#
|
||||
@ -21,11 +21,11 @@
|
||||
if [ "$DISABLE_JBIG" != "yes" ]; then
|
||||
Note "Checking for JBIG library support"
|
||||
- CheckForLibrary jbg_enc_init -ljbig &&
|
||||
+ CheckForLibrary jbg_enc_init -L/usr/local/lib -ljbig &&
|
||||
+ CheckForLibrary jbg_enc_init -L/usr/local/lib -L/usr/local/lib -ljbig &&
|
||||
CheckForIncludeFile jbig.h && {
|
||||
HAVE_JBIG="#define HAVE_JBIG 1"
|
||||
- LIBJBIG="-ljbig"
|
||||
+ LIBJBIG="-L/usr/local/lib -ljbig"
|
||||
+ LIBJBIG="-L/usr/local/lib -L/usr/local/lib -ljbig"
|
||||
}
|
||||
if [ "x$LIBJBIG" = "x" ]; then
|
||||
Note "... not found. Disabling JBIG support"
|
||||
@ -125,7 +125,15 @@
|
||||
#include "tiffio.h"
|
||||
main()
|
||||
{
|
||||
@@ -3233,7 +3269,7 @@
|
||||
@@ -2552,6 +2588,7 @@
|
||||
case ${lib_ver} in
|
||||
3.4) tiff_runlen_t="uint16" ;;
|
||||
3.[56789]) tiff_runlen_t="uint32" ;;
|
||||
+ 4.[0-9]) tiff_runlen_t="uint32" ;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
@@ -3233,7 +3270,7 @@
|
||||
strtoul
|
||||
writev
|
||||
"
|
||||
@ -134,7 +142,7 @@
|
||||
for i in $FUNCS; do
|
||||
CheckForFunc $i || {
|
||||
Note "... emulate $i"
|
||||
@@ -3291,6 +3327,7 @@
|
||||
@@ -3291,6 +3328,7 @@
|
||||
# Verify library is compatible.
|
||||
#
|
||||
cat>t.c<<EOF
|
||||
|
Loading…
Reference in New Issue
Block a user