1 |
commit: 7a3e067c600566c5d1815b8666ea29fe4b6b3906 |
2 |
Author: Alfred Persson Forsberg <cat <AT> catcream <DOT> org> |
3 |
AuthorDate: Tue Aug 16 20:05:59 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 18 18:42:15 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a3e067c |
7 |
|
8 |
media-gfx/exiv2: fix test for musl |
9 |
|
10 |
This is fixed upstream. See the patch file for upstream commits. It only |
11 |
patches broken tests, not tested code, so no revbump is needed. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/836230 |
14 |
Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org> |
15 |
Closes: https://github.com/gentoo/gentoo/pull/26884 |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
media-gfx/exiv2/exiv2-0.27.5-r1.ebuild | 4 ++ |
19 |
.../exiv2/files/exiv2-0.27.5-musl-tests.patch | 56 ++++++++++++++++++++++ |
20 |
2 files changed, 60 insertions(+) |
21 |
|
22 |
diff --git a/media-gfx/exiv2/exiv2-0.27.5-r1.ebuild b/media-gfx/exiv2/exiv2-0.27.5-r1.ebuild |
23 |
index 8655bd0c7eac..e262b7b9c5c8 100644 |
24 |
--- a/media-gfx/exiv2/exiv2-0.27.5-r1.ebuild |
25 |
+++ b/media-gfx/exiv2/exiv2-0.27.5-r1.ebuild |
26 |
@@ -50,6 +50,10 @@ DEPEND="${DEPEND} |
27 |
|
28 |
DOCS=( README.md doc/ChangeLog doc/cmd.txt ) |
29 |
|
30 |
+PATCHES=( |
31 |
+ "${FILESDIR}"/${PN}-0.27.5-musl-tests.patch |
32 |
+) |
33 |
+ |
34 |
pkg_setup() { |
35 |
use doc && python-any-r1_pkg_setup |
36 |
} |
37 |
|
38 |
diff --git a/media-gfx/exiv2/files/exiv2-0.27.5-musl-tests.patch b/media-gfx/exiv2/files/exiv2-0.27.5-musl-tests.patch |
39 |
new file mode 100644 |
40 |
index 000000000000..3fa70d739f4a |
41 |
--- /dev/null |
42 |
+++ b/media-gfx/exiv2/files/exiv2-0.27.5-musl-tests.patch |
43 |
@@ -0,0 +1,56 @@ |
44 |
+https://github.com/Exiv2/exiv2/commit/82adcb1f86def0555b25713a8b84dba84944b275 (1) |
45 |
+https://github.com/Exiv2/exiv2/commit/7d8cd00778c3eee9f32af04b009d8a5651eb53e7 (2) |
46 |
+ |
47 |
+This is basically just commit (1). Though it wasn't directly applicable so I just merged it with (2). |
48 |
+Easier and it makes the file same as upstream. |
49 |
+ |
50 |
+diff -u b/unitTests/test_futils.cpp b/unitTests/test_futils.cpp |
51 |
+--- b/unitTests/test_futils.cpp |
52 |
++++ b/unitTests/test_futils.cpp |
53 |
+@@ -42,21 +42,8 @@ |
54 |
+ std::string tmpFile("tmp.dat"); |
55 |
+ std::ofstream auxFile(tmpFile.c_str()); |
56 |
+ auxFile.close(); |
57 |
+-#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW__) || defined(__MSYS__) |
58 |
+- const char * expectedString = "No error (errno = 0)"; |
59 |
+-#elif defined(__APPLE__) |
60 |
+- const char * expectedString = "Undefined error: 0 (errno = 0)"; |
61 |
+-#elif defined(__sun__) |
62 |
+- const char * expectedString = "Error 0 (errno = 0)"; |
63 |
+-#elif defined(__FreeBSD__) |
64 |
+- const char * expectedString = "No error: 0 (errno = 0)"; |
65 |
+-#elif defined(__NetBSD__) |
66 |
+- const char * expectedString = "Undefined error: 0 (errno = 0)"; |
67 |
+-#else |
68 |
+- const char * expectedString = "Success (errno = 0)"; |
69 |
+-#endif |
70 |
+ std::remove(tmpFile.c_str()); |
71 |
+- ASSERT_STREQ(expectedString, strError().c_str()); |
72 |
++ ASSERT_TRUE(strError().find("(errno = 0)") != std::string::npos); |
73 |
+ } |
74 |
+ |
75 |
+ TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile) |
76 |
+@@ -68,22 +55,7 @@ |
77 |
+ TEST(strError, doNotRecognizeUnknownError) |
78 |
+ { |
79 |
+ errno = 9999; |
80 |
+-#if defined(__MINGW__) || defined(__MSYS__) || defined(__CYGWIN__) |
81 |
+- const char * expectedString = "Unknown error 9999 (errno = 9999)"; |
82 |
+-#elif defined(_WIN32) |
83 |
+- const char * expectedString = "Unknown error (errno = 9999)"; |
84 |
+-#elif defined(__APPLE__) |
85 |
+- const char * expectedString = "Unknown error: 9999 (errno = 9999)"; |
86 |
+-#elif defined(__sun__) |
87 |
+- const char * expectedString = "Unknown error (errno = 9999)"; |
88 |
+-#elif defined(__FreeBSD__) |
89 |
+- const char * expectedString = "Unknown error: 9999 (errno = 9999)"; |
90 |
+-#elif defined(__NetBSD__) |
91 |
+- const char * expectedString = "Unknown error: 9999 (errno = 9999)"; |
92 |
+-#else |
93 |
+- const char * expectedString = "Unknown error 9999 (errno = 9999)"; |
94 |
+-#endif |
95 |
+- ASSERT_STREQ(expectedString, strError().c_str()); |
96 |
++ ASSERT_TRUE(strError().find("(errno = 9999)") != std::string::npos); |
97 |
+ } |
98 |
+ |
99 |
+ TEST(getEnv, getsDefaultValueWhenExpectedEnvVariableDoesNotExist) |