1 |
commit: 727aed785bfa82cf4546f02e7d4f8a590c39f035 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 22 04:21:31 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 22 04:21:42 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=727aed78 |
7 |
|
8 |
net-analyzer/wireshark: fix build without zlib |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../files/wireshark-3.6.1-fix-build-no-zlib.patch | 82 ++++++++++++++++++++++ |
13 |
net-analyzer/wireshark/wireshark-3.6.1.ebuild | 1 + |
14 |
2 files changed, 83 insertions(+) |
15 |
|
16 |
diff --git a/net-analyzer/wireshark/files/wireshark-3.6.1-fix-build-no-zlib.patch b/net-analyzer/wireshark/files/wireshark-3.6.1-fix-build-no-zlib.patch |
17 |
new file mode 100644 |
18 |
index 000000000000..3a935ce89969 |
19 |
--- /dev/null |
20 |
+++ b/net-analyzer/wireshark/files/wireshark-3.6.1-fix-build-no-zlib.patch |
21 |
@@ -0,0 +1,82 @@ |
22 |
+https://gitlab.com/wireshark/wireshark/-/commit/5dc11653a364975e5cc9a4a994d9d88e138e8385.patch |
23 |
+https://gitlab.com/wireshark/wireshark/-/issues/17899 |
24 |
+ |
25 |
+From: Guy Harris <gharris@×××××.net> |
26 |
+Date: Fri, 21 Jan 2022 15:04:28 -0800 |
27 |
+Subject: [PATCH] Fix no-ZLib builds. |
28 |
+ |
29 |
+Don't use ZLib routines or data types if we're built without ZLib. |
30 |
+ |
31 |
+Don't support --compress-type=gzip, or a gzip check box in the Output |
32 |
+pane of the Capture Options dialog, if we're built without ZLib. |
33 |
+ |
34 |
+Fixes #17899. |
35 |
+ |
36 |
+ |
37 |
+(cherry picked from commit 125f5cbd881c2e1236d968a3e8fdcf5af2606e77) |
38 |
+--- a/capture_opts.c |
39 |
++++ b/capture_opts.c |
40 |
+@@ -986,9 +986,18 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg_ |
41 |
+ if (strcmp(optarg_str_p, "none") == 0) { |
42 |
+ ; |
43 |
+ } else if (strcmp(optarg_str_p, "gzip") == 0) { |
44 |
++#ifdef HAVE_ZLIB |
45 |
+ ; |
46 |
++#else |
47 |
++ cmdarg_err("'gzip' compression is not supported"); |
48 |
++ return 1; |
49 |
++#endif |
50 |
+ } else { |
51 |
++#ifdef HAVE_ZLIB |
52 |
+ cmdarg_err("parameter of --compress-type can be 'none' or 'gzip'"); |
53 |
++#else |
54 |
++ cmdarg_err("parameter of --compress-type can only be 'none'"); |
55 |
++#endif |
56 |
+ return 1; |
57 |
+ } |
58 |
+ capture_opts->compress_type = g_strdup(optarg_str_p); |
59 |
+--- a/ringbuffer.c |
60 |
++++ b/ringbuffer.c |
61 |
+@@ -124,6 +124,7 @@ static void CleanupOldCap(gchar* name) |
62 |
+ g_mutex_unlock(&rb_data.mutex); |
63 |
+ } |
64 |
+ |
65 |
++#ifdef HAVE_ZLIB |
66 |
+ /* |
67 |
+ * compress capture file |
68 |
+ */ |
69 |
+@@ -200,6 +201,7 @@ static int ringbuf_start_compress_file(rb_file* rfile) |
70 |
+ g_thread_new("exec_compress", &exec_compress_thread, name); |
71 |
+ return 0; |
72 |
+ } |
73 |
++#endif |
74 |
+ |
75 |
+ /* |
76 |
+ * create the next filename and open a new binary file with that name |
77 |
+@@ -216,9 +218,11 @@ static int ringbuf_open_file(rb_file *rfile, int *err) |
78 |
+ /* remove old file (if any, so ignore error) */ |
79 |
+ ws_unlink(rfile->name); |
80 |
+ } |
81 |
++#ifdef HAVE_ZLIB |
82 |
+ else if (rb_data.compress_type != NULL && strcmp(rb_data.compress_type, "gzip") == 0) { |
83 |
+ ringbuf_start_compress_file(rfile); |
84 |
+ } |
85 |
++#endif |
86 |
+ g_free(rfile->name); |
87 |
+ } |
88 |
+ |
89 |
+--- a/ui/qt/capture_options_dialog.cpp |
90 |
++++ b/ui/qt/capture_options_dialog.cpp |
91 |
+@@ -486,7 +486,11 @@ void CaptureOptionsDialog::on_gbNewFileAuto_toggled(bool checked) |
92 |
+ ui->stopMBComboBox->setEnabled(checked?false:true); |
93 |
+ ui->gbCompression->setEnabled(checked); |
94 |
+ ui->rbCompressionNone->setEnabled(checked); |
95 |
++#ifdef HAVE_ZLIB |
96 |
+ ui->rbCompressionGzip->setEnabled(checked); |
97 |
++#else |
98 |
++ ui->rbCompressionGzip->setEnabled(false); |
99 |
++#endif |
100 |
+ } |
101 |
+ |
102 |
+ void CaptureOptionsDialog::on_cbUpdatePacketsRT_toggled(bool checked) |
103 |
+GitLab |
104 |
|
105 |
diff --git a/net-analyzer/wireshark/wireshark-3.6.1.ebuild b/net-analyzer/wireshark/wireshark-3.6.1.ebuild |
106 |
index c90b5a717962..a4fec6f5c579 100644 |
107 |
--- a/net-analyzer/wireshark/wireshark-3.6.1.ebuild |
108 |
+++ b/net-analyzer/wireshark/wireshark-3.6.1.ebuild |
109 |
@@ -96,6 +96,7 @@ RDEPEND="${RDEPEND} |
110 |
PATCHES=( |
111 |
"${FILESDIR}"/${PN}-2.6.0-redhat.patch |
112 |
"${FILESDIR}"/${PN}-3.4.2-cmake-lua-version.patch |
113 |
+ "${FILESDIR}"/${P}-fix-build-no-zlib.patch |
114 |
) |
115 |
|
116 |
pkg_setup() { |