gnu: biber: Downgrade to 2.11.
[jackhill/guix/guix.git] / gnu / packages / patches / libextractor-exiv2.patch
1 This patch allows us to build libextractor against exiv2 0.27.x.
2 Adapted from this upstream commit:
3
4 commit 1ecee9a47717e36cb8a3925d011d1a6de11d631c
5 Author: Christian Grothoff <christian@grothoff.org>
6 Date: Mon Jul 29 17:58:18 2019 +0200
7
8 importing patch from Gentoo/AS to address exiv2 build issue (#5820)
9
10 diff --git a/src/plugins/exiv2_extractor.cc b/src/plugins/exiv2_extractor.cc
11 index 8741d40..ef402a8 100644
12 --- a/src/plugins/exiv2_extractor.cc
13 +++ b/src/plugins/exiv2_extractor.cc
14 @@ -27,10 +27,7 @@
15 #include <cassert>
16 #include <cstring>
17 #include <math.h>
18 -#include <exiv2/exif.hpp>
19 -#include <exiv2/error.hpp>
20 -#include <exiv2/image.hpp>
21 -#include <exiv2/futils.hpp>
22 +#include <exiv2/exiv2.hpp>
23
24 /**
25 * Enable debugging to get error messages.
26 @@ -180,7 +177,7 @@ public:
27 *
28 * @return -1 on error
29 */
30 -#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0)
31 +#if EXIV2_TEST_VERSION(0,26,0)
32 virtual size_t size (void) const;
33 #else
34 virtual long int size (void) const;
35 @@ -316,7 +313,11 @@ ExtractorIO::getb ()
36 const unsigned char *r;
37
38 if (1 != ec->read (ec->cls, &data, 1))
39 +#if EXIV2_TEST_VERSION(0,27,0)
40 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
41 +#else
42 throw Exiv2::BasicError<char> (42 /* error code */);
43 +#endif
44 r = (const unsigned char *) data;
45 return *r;
46 }
47 @@ -371,7 +372,11 @@ ExtractorIO::putb (Exiv2::byte data)
48 void
49 ExtractorIO::transfer (Exiv2::BasicIo& src)
50 {
51 +#if EXIV2_TEST_VERSION(0,27,0)
52 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
53 +#else
54 throw Exiv2::BasicError<char> (42 /* error code */);
55 +#endif
56 }
57
58
59 @@ -416,7 +421,11 @@ ExtractorIO::seek (long offset,
60 Exiv2::byte *
61 ExtractorIO::mmap (bool isWritable)
62 {
63 +#if EXIV2_TEST_VERSION(0,27,0)
64 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
65 +#else
66 throw Exiv2::BasicError<char> (42 /* error code */);
67 +#endif
68 }
69
70
71 @@ -449,7 +458,7 @@ ExtractorIO::tell (void) const
72 *
73 * @return -1 on error
74 */
75 -#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0)
76 +#if EXIV2_TEST_VERSION(0,26,0)
77 size_t
78 #else
79 long int
80 @@ -504,7 +513,11 @@ ExtractorIO::eof () const
81 std::string
82 ExtractorIO::path () const
83 {
84 +#if EXIV2_TEST_VERSION(0,27,0)
85 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
86 +#else
87 throw Exiv2::BasicError<char> (42 /* error code */);
88 +#endif
89 }
90
91
92 @@ -517,7 +530,11 @@ ExtractorIO::path () const
93 std::wstring
94 ExtractorIO::wpath () const
95 {
96 +#if EXIV2_TEST_VERSION(0,27,0)
97 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
98 +#else
99 throw Exiv2::BasicError<char> (42 /* error code */);
100 +#endif
101 }
102 #endif
103
104 @@ -531,7 +548,11 @@ Exiv2::BasicIo::AutoPtr
105 ExtractorIO::temporary () const
106 {
107 fprintf (stderr, "throwing temporary error\n");
108 +#if EXIV2_TEST_VERSION(0,27,0)
109 + throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
110 +#else
111 throw Exiv2::BasicError<char> (42 /* error code */);
112 +#endif
113 }
114
115
116 @@ -697,7 +718,7 @@ EXTRACTOR_exiv2_extract_method (struct EXTRACTOR_ExtractContext *ec)
117 {
118 try
119 {
120 -#if EXIV2_MAKE_VERSION(0,23,0) <= EXIV2_VERSION
121 +#if !EXIV2_TEST_VERSION(0,24,0)
122 Exiv2::LogMsg::setLevel (Exiv2::LogMsg::mute);
123 #endif
124 std::auto_ptr<Exiv2::BasicIo> eio(new ExtractorIO (ec));