Package: audacious / 3.7.2-1

use-system-libguess.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
Description: User system libguess
Author: Mateusz Łukasik <mati75@linuxmint.pl>

--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,27 @@ if test "x$HAVE_MSWINDOWS" = "xyes" && t
     LDFLAGS="$LDFLAGS -Wl,-subsystem,windows"
 fi
 
+dnl Character set detection
+dnl =======================
+
+AC_ARG_ENABLE(chardet,
+ AS_HELP_STRING(--enable-chardet, [Disable character set detection (default=auto)]),
+ USE_CHARDET=$enableval, USE_CHARDET=auto)
+
+if test $USE_CHARDET != no ; then
+    PKG_CHECK_MODULES(LIBGUESS, libguess >= 1.2, have_libguess=yes, have_libguess=no)
+    if test $have_libguess = yes ; then
+        USE_CHARDET=yes
+        AC_DEFINE(USE_CHARDET, 1, [Define if character set detection enabled])
+    elif test $USE_CHARDET = yes ; then
+        AC_MSG_ERROR([Character set detection could not be enabled; check config.log])
+    else
+        USE_CHARDET=no
+    fi
+fi
+
+AC_SUBST(USE_CHARDET)
+
 dnl D-Bus support
 dnl =============
 
@@ -140,6 +161,7 @@ echo "Configuration:"
 echo ""
 echo "  Install path:                           $prefix"
 echo ""
+echo "  Automatic character code detection:     $USE_CHARDET"
 echo "  D-Bus support:                          $USE_DBUS"
 echo "  GTK+ support:                           $USE_GTK"
 echo "  Qt support:                             $USE_QT"
--- a/extra.mk.in
+++ b/extra.mk.in
@@ -1,4 +1,5 @@
 HAVE_MSWINDOWS ?= @HAVE_MSWINDOWS@
+USE_CHARDET ?= @USE_CHARDET@
 USE_DBUS ?= @USE_DBUS@
 USE_GTK ?= @USE_GTK@
 USE_QT ?= @USE_QT@
@@ -11,6 +12,8 @@ GMODULE_CFLAGS ?= @GMODULE_CFLAGS@
 GMODULE_LIBS ?= @GMODULE_LIBS@
 GTK_CFLAGS ?= @GTK_CFLAGS@
 GTK_LIBS ?= @GTK_LIBS@
+LIBGUESS_CFLAGS ?= @LIBGUESS_CFLAGS@
+LIBGUESS_LIBS ?= @LIBGUESS_LIBS@
 QTCORE_CFLAGS ?= @QTCORE_CFLAGS@
 QTCORE_LIBS ?= @QTCORE_LIBS@
 QT_CFLAGS ?= @QT_CFLAGS@
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,6 +1,6 @@
 include ../extra.mk
 
-SUBDIRS := audacious libaudcore libaudtag libguess
+SUBDIRS := audacious libaudcore libaudtag
 
 ifeq ($(USE_GTK),yes)
 SUBDIRS += libaudgui
@@ -17,7 +17,6 @@ endif
 include ../buildsys.mk
 
 audacious: libaudcore
-libaudcore: libguess
 libaudtag: libaudcore
 
 ifeq ($(USE_GTK),yes)
--- a/src/libaudcore/Makefile
+++ b/src/libaudcore/Makefile
@@ -89,6 +89,7 @@ CPPFLAGS := -I.. -I../.. \
             ${CPPFLAGS} \
             ${GLIB_CFLAGS} \
             ${GMODULE_CFLAGS} \
+            ${LIBGUESS_CFLAGS} \
             ${QTCORE_CFLAGS} \
             -DHARDCODE_BINDIR=\"${bindir}\" \
             -DHARDCODE_DATADIR=\"${datadir}/audacious\" \
@@ -99,8 +100,8 @@ CPPFLAGS := -I.. -I../.. \
 
 CFLAGS += ${LIB_CFLAGS}
 
-LIBS := ../libguess/libguess.a \
-        ${LIBS} -lm \
+LIBS += -lm \
         ${GLIB_LIBS} \
         ${GMODULE_LIBS} \
+	${LIBGUESS_LIBS} \
         ${QTCORE_LIBS}
--- a/src/libaudcore/charset.cc
+++ b/src/libaudcore/charset.cc
@@ -28,8 +28,11 @@
 
 #include <glib.h>
 
-#include "libguess/libguess.h"
-
+#ifdef USE_CHARDET
+extern "C" {
+#include <libguess/libguess.h>
+}
+#endif
 #include "hook.h"
 #include "index.h"
 #include "runtime.h"
@@ -142,6 +150,7 @@ static StringBuf convert_to_utf8_locked
     if (len < 0)
         len = strlen (str);
 
+#ifdef USE_CHARDET
     if (detect_region)
     {
         /* prefer libguess-detected charset */
@@ -161,6 +170,7 @@ static StringBuf convert_to_utf8_locked
         if (utf8)
             return utf8;
     }
+#endif
 
     /* try system locale last (this one will print a warning if it fails) */
     return str_from_locale (str, len);
--- a/src/libaudgui/Makefile
+++ b/src/libaudgui/Makefile
@@ -45,6 +45,7 @@ LD = ${CXX}
 CPPFLAGS := -I.. -I../.. \
             ${CPPFLAGS} \
             ${GLIB_CFLAGS} \
+            ${LIBGUESS_CFLAGS} \
             ${GTK_CFLAGS}
 
 CFLAGS += ${LIB_CFLAGS}
--- a/src/libaudgui/prefs-window.cc
+++ b/src/libaudgui/prefs-window.cc
@@ -33,12 +33,14 @@
 #include <libaudcore/preferences.h>
 #include <libaudcore/runtime.h>
 
-#include "libguess/libguess.h"
-
 #include "internal.h"
 #include "libaudgui.h"
 #include "libaudgui-gtk.h"
 
+#ifdef USE_CHARDET
+#include <libguess.h>
+#endif
+
 enum CategoryViewCols {
     CATEGORY_VIEW_COL_ICON,
     CATEGORY_VIEW_COL_NAME,
@@ -109,6 +111,7 @@ static const TitleFieldTag title_field_t
     { N_("Quality")    , "${quality}" }
 };
 
+#ifdef USE_CHARDET
 static const ComboItem chardet_detector_presets[] = {
     ComboItem (N_("None"), ""),
     ComboItem (N_("Arabic"), GUESS_REGION_AR),
@@ -123,6 +126,7 @@ static const ComboItem chardet_detector_
     ComboItem (N_("Taiwanese"), GUESS_REGION_TW),
     ComboItem (N_("Turkish"), GUESS_REGION_TR)
 };
+#endif
 
 static const ComboItem bitdepth_elements[] = {
     ComboItem ("16", 16),
@@ -253,9 +257,11 @@ static const PreferencesWidget connectiv
 };
 
 static const PreferencesWidget chardet_elements[] = {
+#ifdef USE_CHARDET
     WidgetCombo (N_("Auto character encoding detector for:"),
         WidgetString (0, "chardet_detector"),
         {{chardet_detector_presets}}),
+#endif
     WidgetEntry (N_("Fallback character encodings:"),
         WidgetString (0, "chardet_fallback"))
 };
--- a/src/libaudqt/Makefile
+++ b/src/libaudqt/Makefile
@@ -33,7 +33,8 @@ LD = ${CXX}
 
 CPPFLAGS := -I.. -I../.. \
             ${CPPFLAGS} \
-            ${QT_CFLAGS}
+            ${QT_CFLAGS} \
+            ${LIBGUESS_CFLAGS}
 
 CFLAGS += ${LIB_CFLAGS}
 
--- a/src/libaudqt/prefs-window.cc
+++ b/src/libaudqt/prefs-window.cc
@@ -48,11 +48,13 @@
 #include <libaudcore/preferences.h>
 #include <libaudcore/runtime.h>
 
-#include "libguess/libguess.h"
-
 #include "libaudqt.h"
 #include "prefs-pluginlist-model.h"
 
+#ifdef USE_CHARDET
+#include <libguess.h>
+#endif
+
 namespace audqt {
 
 struct Category {
@@ -113,6 +115,7 @@ static const TitleFieldTag title_field_t
     { N_("Quality")    , "${quality}" }
 };
 
+#ifdef USE_CHARDET
 static const ComboItem chardet_detector_presets[] = {
     ComboItem (N_("None"), ""),
     ComboItem (N_("Arabic"), GUESS_REGION_AR),
@@ -127,6 +130,7 @@ static const ComboItem chardet_detector_
     ComboItem (N_("Taiwanese"), GUESS_REGION_TW),
     ComboItem (N_("Turkish"), GUESS_REGION_TR)
 };
+#endif
 
 static const ComboItem bitdepth_elements[] = {
     ComboItem ("16", 16),
@@ -241,9 +245,11 @@ static const PreferencesWidget connectiv
 };
 
 static const PreferencesWidget chardet_elements[] = {
+#ifdef USE_CHARDET
     WidgetCombo (N_("Auto character encoding detector for:"),
         WidgetString (0, "chardet_detector"),
         {{chardet_detector_presets}}),
+#endif
     WidgetEntry (N_("Fallback character encodings:"),
         WidgetString (0, "chardet_fallback"))
 };