diff options
Diffstat (limited to 'debian/patches/use-system-libguess.patch')
-rw-r--r-- | debian/patches/use-system-libguess.patch | 244 |
1 files changed, 244 insertions, 0 deletions
diff --git a/debian/patches/use-system-libguess.patch b/debian/patches/use-system-libguess.patch new file mode 100644 index 0000000..20f7b83 --- /dev/null +++ b/debian/patches/use-system-libguess.patch @@ -0,0 +1,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")) + }; |