summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Łukasik <mati75@linuxmint.pl>2016-04-07 22:22:24 +0200
committerMateusz Łukasik <mati75@linuxmint.pl>2016-04-07 22:22:24 +0200
commit919061c0f889afc422572d41e456a85db33d306d (patch)
treeabdd147707d7a23de709f123b4dac9b2673de68d
parent124bf3bdccdac9d0eb78ce65b53c9a4ba128e052 (diff)
Add use-system-libguess.patch to use system libguess libraries.
-rw-r--r--debian/changelog3
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/use-system-libguess.patch244
3 files changed, 247 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 5f2bdb0..d61c614 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,7 +19,8 @@ audacious (3.7.2-1) UNRELEASED; urgency=medium
- Add install and symbols files.
* debian/patches:
- Add add-keywords.patch to provides keywords in desktop file.
- - Add use-system-licenses.patch to use system system licenses path.
+ - Add use-system-licenses.patch to use system licenses path.
+ - Add use-system-libguess.patch to use system libguess libraries.
* debian/rules:
- Use bindnow flag.
* debian/control:
diff --git a/debian/patches/series b/debian/patches/series
index bb69562..1b22314 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
add-keywords.patch
use-system-licenses.patch
+use-system-libguess.patch
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"))
+ };