1 |
commit: 029ab1b7af1a6bbdeac5ea22edb9e63349cdd2a6 |
2 |
Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 24 05:41:11 2021 +0000 |
4 |
Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 24 05:41:11 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=029ab1b7 |
7 |
|
8 |
media-radio/grig: Prepare for coming media-libs/hamlib42 |
9 |
|
10 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
11 |
Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org> |
12 |
|
13 |
media-radio/grig/files/grig-0.8.1-hamlib42.patch | 203 +++++++++++++++++++++++ |
14 |
media-radio/grig/grig-0.8.1-r1.ebuild | 11 ++ |
15 |
2 files changed, 214 insertions(+) |
16 |
|
17 |
diff --git a/media-radio/grig/files/grig-0.8.1-hamlib42.patch b/media-radio/grig/files/grig-0.8.1-hamlib42.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..16c2dc85181 |
20 |
--- /dev/null |
21 |
+++ b/media-radio/grig/files/grig-0.8.1-hamlib42.patch |
22 |
@@ -0,0 +1,203 @@ |
23 |
+diff --git a/src/rig-daemon-check.c b/src/rig-daemon-check.c |
24 |
+index 932a84c..07045bd 100644 |
25 |
+--- a/src/rig-daemon-check.c |
26 |
++++ b/src/rig-daemon-check.c |
27 |
+@@ -884,7 +884,7 @@ rig_daemon_check_level (RIG *myrig, |
28 |
+ if (has_get->att || has_set->att) { |
29 |
+ int i = 0; |
30 |
+ |
31 |
+- while ((i < MAXDBLSTSIZ) && (myrig->state.attenuator[i] != 0)) { |
32 |
++ while ((i < HAMLIB_MAXDBLSTSIZ) && (myrig->state.attenuator[i] != 0)) { |
33 |
+ rig_data_set_att_data (i, myrig->state.attenuator[i]); |
34 |
+ i++; |
35 |
+ } |
36 |
+@@ -895,7 +895,7 @@ rig_daemon_check_level (RIG *myrig, |
37 |
+ if (has_get->preamp || has_set->preamp) { |
38 |
+ int i = 0; |
39 |
+ |
40 |
+- while ((i < MAXDBLSTSIZ) && (myrig->state.preamp[i] != 0)) { |
41 |
++ while ((i < HAMLIB_MAXDBLSTSIZ) && (myrig->state.preamp[i] != 0)) { |
42 |
+ rig_data_set_preamp_data (i, myrig->state.preamp[i]); |
43 |
+ i++; |
44 |
+ } |
45 |
+diff --git a/src/rig-daemon.c b/src/rig-daemon.c |
46 |
+index 0070283..c8e0ee5 100644 |
47 |
+--- a/src/rig-daemon.c |
48 |
++++ b/src/rig-daemon.c |
49 |
+@@ -537,7 +537,7 @@ rig_daemon_start (int rigid, |
50 |
+ } |
51 |
+ |
52 |
+ /* configure and open rig device */ |
53 |
+- strncpy (myrig->state.rigport.pathname, rigport, FILPATHLEN); |
54 |
++ strncpy (myrig->state.rigport.pathname, rigport, HAMLIB_FILPATHLEN); |
55 |
+ g_free (rigport); |
56 |
+ |
57 |
+ /* set speed if any special whishes */ |
58 |
+diff --git a/src/rig-data.c b/src/rig-data.c |
59 |
+index cc76268..1858a8d 100644 |
60 |
+--- a/src/rig-data.c |
61 |
++++ b/src/rig-data.c |
62 |
+@@ -64,10 +64,10 @@ grig_cmd_avail_t has_get; /*!< Flags to indicate reading capabilities. */ |
63 |
+ |
64 |
+ |
65 |
+ /** \brief List of attenuator values (absolute values). */ |
66 |
+-static int att[MAXDBLSTSIZ]; |
67 |
++static int att[HAMLIB_MAXDBLSTSIZ]; |
68 |
+ |
69 |
+ /** \brief List of preamp values. */ |
70 |
+-static int preamp[MAXDBLSTSIZ]; |
71 |
++static int preamp[HAMLIB_MAXDBLSTSIZ]; |
72 |
+ |
73 |
+ /** \brief Bit field of available VFO's */ |
74 |
+ static int vfo_list; |
75 |
+@@ -116,7 +116,7 @@ rig_data_set_vfos (int vfos) |
76 |
+ void |
77 |
+ rig_data_set_att_data (int index, int data) |
78 |
+ { |
79 |
+- if ((index >= 0) && (index < MAXDBLSTSIZ)) |
80 |
++ if ((index >= 0) && (index < HAMLIB_MAXDBLSTSIZ)) |
81 |
+ att[index] = data; |
82 |
+ } |
83 |
+ |
84 |
+@@ -132,7 +132,7 @@ rig_data_set_att_data (int index, int data) |
85 |
+ int |
86 |
+ rig_data_get_att_data (int index) |
87 |
+ { |
88 |
+- if ((index >= 0) && (index < MAXDBLSTSIZ)) { |
89 |
++ if ((index >= 0) && (index < HAMLIB_MAXDBLSTSIZ)) { |
90 |
+ return att[index]; |
91 |
+ } |
92 |
+ else { |
93 |
+@@ -158,7 +158,7 @@ rig_data_get_att_index (int data) |
94 |
+ return -1; |
95 |
+ |
96 |
+ /* scan through the array */ |
97 |
+- while ((i < MAXDBLSTSIZ) && (att[i] != 0)) { |
98 |
++ while ((i < HAMLIB_MAXDBLSTSIZ) && (att[i] != 0)) { |
99 |
+ if (att[i] == data) { |
100 |
+ return i; |
101 |
+ } |
102 |
+@@ -182,7 +182,7 @@ rig_data_get_att_index (int data) |
103 |
+ void |
104 |
+ rig_data_set_preamp_data (int index, int data) |
105 |
+ { |
106 |
+- if ((index >= 0) && (index < MAXDBLSTSIZ)) |
107 |
++ if ((index >= 0) && (index < HAMLIB_MAXDBLSTSIZ)) |
108 |
+ preamp[index] = data; |
109 |
+ } |
110 |
+ |
111 |
+@@ -198,7 +198,7 @@ rig_data_set_preamp_data (int index, int data) |
112 |
+ int |
113 |
+ rig_data_get_preamp_data (int index) |
114 |
+ { |
115 |
+- if ((index >= 0) && (index < MAXDBLSTSIZ)) { |
116 |
++ if ((index >= 0) && (index < HAMLIB_MAXDBLSTSIZ)) { |
117 |
+ return preamp[index]; |
118 |
+ } |
119 |
+ else { |
120 |
+@@ -225,7 +225,7 @@ rig_data_get_preamp_index (int data) |
121 |
+ return -1; |
122 |
+ |
123 |
+ /* scan through the array */ |
124 |
+- while ((i < MAXDBLSTSIZ) && (preamp[i] != 0)) { |
125 |
++ while ((i < HAMLIB_MAXDBLSTSIZ) && (preamp[i] != 0)) { |
126 |
+ if (preamp[i] == data) { |
127 |
+ return i; |
128 |
+ } |
129 |
+diff --git a/src/rig-gui-buttons.c b/src/rig-gui-buttons.c |
130 |
+index ae95f4d..6873447 100644 |
131 |
+--- a/src/rig-gui-buttons.c |
132 |
++++ b/src/rig-gui-buttons.c |
133 |
+@@ -283,10 +283,10 @@ rig_gui_buttons_create_att_selector () |
134 |
+ /* add ATT OFF ie. 0 dB */ |
135 |
+ gtk_combo_box_append_text (GTK_COMBO_BOX (att), _("ATT OFF")); |
136 |
+ |
137 |
+- /* note: MAXDBLSTSIZ is defined in hamlib; it is the max size of the |
138 |
++ /* note: HAMLIB_MAXDBLSTSIZ is defined in hamlib; it is the max size of the |
139 |
+ ATT and preamp arrays. |
140 |
+ */ |
141 |
+- while ((i < MAXDBLSTSIZ) && rig_data_get_att_data (i)) { |
142 |
++ while ((i < HAMLIB_MAXDBLSTSIZ) && rig_data_get_att_data (i)) { |
143 |
+ |
144 |
+ text = g_strdup_printf ("-%d dB", rig_data_get_att_data (i)); |
145 |
+ gtk_combo_box_append_text (GTK_COMBO_BOX (att), text); |
146 |
+@@ -343,10 +343,10 @@ rig_gui_buttons_create_preamp_selector () |
147 |
+ /* add ATT OFF ie. 0 dB */ |
148 |
+ gtk_combo_box_append_text (GTK_COMBO_BOX (preamp), _("PREAMP OFF")); |
149 |
+ |
150 |
+- /* note: MAXDBLSTSIZ is defined in hamlib; it is the max size of the |
151 |
++ /* note: HAMLIB_MAXDBLSTSIZ is defined in hamlib; it is the max size of the |
152 |
+ ATT and preamp arrays. |
153 |
+ */ |
154 |
+- while ((i < MAXDBLSTSIZ) && rig_data_get_preamp_data (i)) { |
155 |
++ while ((i < HAMLIB_MAXDBLSTSIZ) && rig_data_get_preamp_data (i)) { |
156 |
+ |
157 |
+ text = g_strdup_printf ("%d dB", rig_data_get_preamp_data (i)); |
158 |
+ gtk_combo_box_append_text (GTK_COMBO_BOX (preamp), text); |
159 |
+diff --git a/src/rig-gui-info.c b/src/rig-gui-info.c |
160 |
+index 53733bf..d73ef2d 100644 |
161 |
+--- a/src/rig-gui-info.c |
162 |
++++ b/src/rig-gui-info.c |
163 |
+@@ -714,7 +714,7 @@ rig_gui_info_create_tunstep_frame () |
164 |
+ /* Create a table with enough rows to show the |
165 |
+ max possible number of unique tuning steps. |
166 |
+ */ |
167 |
+- table = gtk_table_new (TSLSTSIZ, 2, FALSE); |
168 |
++ table = gtk_table_new (HAMLIB_TSLSTSIZ, 2, FALSE); |
169 |
+ |
170 |
+ label = gtk_label_new (NULL); |
171 |
+ gtk_label_set_markup (GTK_LABEL (label), _("<b>STEP</b>")); |
172 |
+@@ -746,7 +746,7 @@ rig_gui_info_create_tunstep_frame () |
173 |
+ } |
174 |
+ */ |
175 |
+ /* for each available tuning ste */ |
176 |
+- for (i = 0; i < TSLSTSIZ; i++) { |
177 |
++ for (i = 0; i < HAMLIB_TSLSTSIZ; i++) { |
178 |
+ |
179 |
+ gboolean firsthit = TRUE; /* indicates whether found mode is the first one |
180 |
+ for the current tuning step. */ |
181 |
+@@ -757,7 +757,7 @@ rig_gui_info_create_tunstep_frame () |
182 |
+ */ |
183 |
+ if (myrig->caps->tuning_steps[i].ts == 0) { |
184 |
+ |
185 |
+- i = TSLSTSIZ; |
186 |
++ i = HAMLIB_TSLSTSIZ; |
187 |
+ } |
188 |
+ |
189 |
+ /* otherwise continue */ |
190 |
+@@ -853,7 +853,7 @@ rig_gui_info_create_frontend_frame () |
191 |
+ text = g_strdup (""); |
192 |
+ |
193 |
+ /* loop over all available preamp values and concatenate them into a label */ |
194 |
+- for (i = 0; i < MAXDBLSTSIZ; i++) { |
195 |
++ for (i = 0; i < HAMLIB_MAXDBLSTSIZ; i++) { |
196 |
+ |
197 |
+ data = rig_data_get_preamp_data (i); |
198 |
+ |
199 |
+@@ -861,7 +861,7 @@ rig_gui_info_create_frontend_frame () |
200 |
+ reached the terminator |
201 |
+ */ |
202 |
+ if (data == 0) { |
203 |
+- i = MAXDBLSTSIZ; |
204 |
++ i = HAMLIB_MAXDBLSTSIZ; |
205 |
+ } |
206 |
+ else { |
207 |
+ if (i > 0) { |
208 |
+@@ -900,7 +900,7 @@ rig_gui_info_create_frontend_frame () |
209 |
+ |
210 |
+ text = g_strdup (""); |
211 |
+ /* loop over all available attenuator values and concatenate them into a label */ |
212 |
+- for (i = 0; i < MAXDBLSTSIZ; i++) { |
213 |
++ for (i = 0; i < HAMLIB_MAXDBLSTSIZ; i++) { |
214 |
+ |
215 |
+ data = rig_data_get_att_data (i); |
216 |
+ |
217 |
+@@ -908,7 +908,7 @@ rig_gui_info_create_frontend_frame () |
218 |
+ reached the terminator |
219 |
+ */ |
220 |
+ if (data == 0) { |
221 |
+- i = MAXDBLSTSIZ; |
222 |
++ i = HAMLIB_MAXDBLSTSIZ; |
223 |
+ } |
224 |
+ else { |
225 |
+ if (i > 0) { |
226 |
|
227 |
diff --git a/media-radio/grig/grig-0.8.1-r1.ebuild b/media-radio/grig/grig-0.8.1-r1.ebuild |
228 |
index 998b4e4fa86..07f9ee0da9b 100644 |
229 |
--- a/media-radio/grig/grig-0.8.1-r1.ebuild |
230 |
+++ b/media-radio/grig/grig-0.8.1-r1.ebuild |
231 |
@@ -26,6 +26,17 @@ src_configure() { |
232 |
econf --enable-hardware |
233 |
} |
234 |
|
235 |
+src_prepare() { |
236 |
+ # prepare for media-radio/hamlib-4.2 change of API |
237 |
+ if has_version '>=media-libs/hamlib-4.2' ; then |
238 |
+ eapply -p1 "${FILESDIR}"/${P}-hamlib42.patch |
239 |
+ fi |
240 |
+ |
241 |
+ eapply ${PATCHES} |
242 |
+ |
243 |
+ eapply_user |
244 |
+} |
245 |
+ |
246 |
src_install() { |
247 |
default |
248 |
make_desktop_entry ${PN} "GRig" "/usr/share/pixmaps/grig/grig-logo.png" "HamRadio" |