/[gentoo-x86]/media-tv/xbmc/files/xbmc-9999-nomythtv.patch
Gentoo

Diff of /media-tv/xbmc/files/xbmc-9999-nomythtv.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.3
1http://trac.xbmc.org/attachment/ticket/11775 1http://trac.xbmc.org/ticket/11775
2 2
3make mysql support optional 3make mysql/mythtv support optional
4 4
5--- a/Makefile.in 5--- a/Makefile.in
6+++ b/Makefile.in 6+++ b/Makefile.in
7@@ -127,13 +127,17 @@ endif 7@@ -127,13 +127,17 @@ endif
8 LIB_DIRS=\ 8 LIB_DIRS=\
35 externals: codecs libs visualizations screensavers 35 externals: codecs libs visualizations screensavers
36 36
37 xcode_depends: \ 37 xcode_depends: \
38--- a/configure.in 38--- a/configure.in
39+++ b/configure.in 39+++ b/configure.in
40@@ -68,6 +68,8 @@ goom_enabled="== GOOM enabled. ==" 40@@ -68,6 +68,9 @@ goom_enabled="== GOOM enabled. =="
41 goom_disabled="== GOOM disabled. ==" 41 goom_disabled="== GOOM disabled. =="
42 pulse_not_found="== Could not find libpulse. PulseAudio support disabled. ==" 42 pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
43 pulse_disabled="== PulseAudio support manually disabled. ==" 43 pulse_disabled="== PulseAudio support manually disabled. =="
44+mysql_not_found="Could not find required library libmysqlclient for MythTV." 44+mysql_not_found="Could not find libmysqlclient. MySQL (and MythTV) support disabled. =="
45+mysql_disabled="== MySQL support disabled. =="
45+mythtv_disabled="== MythTV support disabled. ==" 46+mythtv_disabled="== MythTV support disabled. =="
46 dvdcss_enabled="== DVDCSS support enabled. ==" 47 dvdcss_enabled="== DVDCSS support enabled. =="
47 dvdcss_disabled="== DVDCSS support disabled. ==" 48 dvdcss_disabled="== DVDCSS support disabled. =="
48 hal_not_found="== Could not find hal. HAL support disabled. ==" 49 hal_not_found="== Could not find hal. HAL support disabled. =="
49@@ -238,6 +240,12 @@ AC_ARG_ENABLE([ffmpeg_libvorbis], 50@@ -238,6 +241,18 @@ AC_ARG_ENABLE([ffmpeg_libvorbis],
50 [use_ffmpeg_libvorbis=$enableval], 51 [use_ffmpeg_libvorbis=$enableval],
51 [use_ffmpeg_libvorbis=no]) 52 [use_ffmpeg_libvorbis=no])
52 53
54+AC_ARG_ENABLE([mysql],
55+ [AS_HELP_STRING([--enable-mysql],
56+ [enable MySQL support (default is auto)])],
57+ [use_mysql=$enableval],
58+ [use_mysql=auto])
59+
53+AC_ARG_ENABLE([mythtv], 60+AC_ARG_ENABLE([mythtv],
54+ [AS_HELP_STRING([--enable-mythtv], 61+ [AS_HELP_STRING([--enable-mythtv],
55+ [enable MythTV support (default is yes)])], 62+ [enable MythTV support (default is auto)])],
56+ [use_mythtv=$enableval], 63+ [use_mythtv=$enableval],
57+ [use_mythtv=yes]) 64+ [use_mythtv=auto])
58+ 65+
59 AC_ARG_ENABLE([dvdcss], 66 AC_ARG_ENABLE([dvdcss],
60 [AS_HELP_STRING([--enable-dvdcss], 67 [AS_HELP_STRING([--enable-dvdcss],
61 [enable DVDCSS support (default is yes)])], 68 [enable DVDCSS support (default is yes)])],
62@@ -563,14 +571,21 @@ else 69@@ -563,14 +578,30 @@ else
63 fi 70 fi
64 71
65 # platform common libraries 72 # platform common libraries
66-AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no") 73-AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
67-if test $MYSQL_CONFIG = "yes"; then 74-if test $MYSQL_CONFIG = "yes"; then
68- INCLUDES="$INCLUDES `mysql_config --include`" 75- INCLUDES="$INCLUDES `mysql_config --include`"
69- MYSQL_LIBS=`mysql_config --libs` 76- MYSQL_LIBS=`mysql_config --libs`
70- LIBS="$LIBS $MYSQL_LIBS" 77- LIBS="$LIBS $MYSQL_LIBS"
71- AC_SUBST(MYSQL_LIBS) 78- AC_SUBST(MYSQL_LIBS)
79-else
80- AC_MSG_ERROR($missing_program)
81+have_mysql=no
72+if test "$use_mythtv" = "yes"; then 82+if test "$use_mysql" != "no"; then
73+ AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no") 83+ AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
74+ if test $MYSQL_CONFIG = "yes"; then 84+ if test $MYSQL_CONFIG = "yes"; then
75+ INCLUDES="$INCLUDES `mysql_config --include`" 85+ INCLUDES="$INCLUDES `mysql_config --include`"
76+ MYSQL_LIBS=`mysql_config --libs` 86+ MYSQL_LIBS=`mysql_config --libs`
77+ LIBS="$LIBS $MYSQL_LIBS" 87+ LIBS="$LIBS $MYSQL_LIBS"
78+ AC_SUBST(MYSQL_LIBS) 88+ AC_SUBST(MYSQL_LIBS)
79+ else 89+ AC_CHECK_LIB([mysqlclient], [main], have_mysql=yes)
80+ AC_MSG_ERROR($missing_program)
81+ fi 90+ fi
82+ AC_CHECK_LIB([mysqlclient], [main], 91+fi
92+if test "$have_mysql" = "yes"; then
93+ AC_DEFINE([BUILD_MYSQL], [1], [Define to 1 to build MySQL.])
94+ AC
95+ if test "$use_mysql" != "no"; then
83+ AC_DEFINE([BUILD_MYTHTV], [1], [Define to 1 to build mythtv.]), 96+ AC_DEFINE([BUILD_MYTHTV], [1], [Define to 1 to build mythtv.]),
97+ fi
98+elif test "$use_mysql" = "yes" || test "$use_mythtv" = "yes"; then
84+ AC_MSG_ERROR($mysql_not_found)) 99+ AC_MSG_ERROR([$mysql_not_found])
85 else 100+else
86- AC_MSG_ERROR($missing_program) 101+ use_mysql=no
102+ AC_MSG_NOTICE($mysql_disabled)
103+ use_mythtv=no
87+ AC_MSG_RESULT($mythtv_disabled) 104+ AC_MSG_NOTICE($mythtv_disabled)
88 fi 105 fi
89 AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library)) 106 AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
90 AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library)) 107 AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library))
91@@ -594,7 +609,6 @@ AC_CHECK_LIB([lzo2], [main],, AC_MSG_ERROR($missing_library)) 108@@ -594,7 +625,6 @@ AC_CHECK_LIB([lzo2], [main],, AC_MSG_ERROR($missing_library))
92 AC_CHECK_LIB([z], [main],, AC_MSG_ERROR($missing_library)) 109 AC_CHECK_LIB([z], [main],, AC_MSG_ERROR($missing_library))
93 AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR($missing_library)) 110 AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR($missing_library))
94 AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR($missing_library)) 111 AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR($missing_library))
95-AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library)) 112-AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
96 AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh])) 113 AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
97 AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library)) 114 AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
98 AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth])) 115 AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
99@@ -1319,6 +1333,12 @@ else 116@@ -1319,6 +1349,18 @@ else
100 final_message="$final_message\n HAL Support:\tNo" 117 final_message="$final_message\n HAL Support:\tNo"
101 fi 118 fi
102 119
120+if test "$use_mysql" = "yes"; then
121+ final_message="$final_message\n MySQL:\tYes"
122+else
123+ final_message="$final_message\n MySQL:\tNo"
124+fi
125+
103+if test "$use_mythtv" = "yes"; then 126+if test "$use_mythtv" = "yes"; then
104+ final_message="$final_message\n MythTV:\tYes" 127+ final_message="$final_message\n MythTV:\tYes"
105+else 128+else
106+ final_message="$final_message\n MythTV:\tNo" 129+ final_message="$final_message\n MythTV:\tNo"
107+fi 130+fi
108+ 131+
109 # DVDCSS 132 # DVDCSS
110 if test "$use_dvdcss" = "yes"; then 133 if test "$use_dvdcss" = "yes"; then
111 AC_MSG_NOTICE($dvdcss_enabled) 134 AC_MSG_NOTICE($dvdcss_enabled)
112@@ -1490,6 +1510,7 @@ AC_SUBST(USE_EXTERNAL_FFMPEG) 135@@ -1490,6 +1532,8 @@ AC_SUBST(USE_EXTERNAL_FFMPEG)
113 AC_SUBST(PYTHON_VERSION) 136 AC_SUBST(PYTHON_VERSION)
114 AC_SUBST(OUTPUT_FILES) 137 AC_SUBST(OUTPUT_FILES)
115 AC_SUBST(HAVE_XBMC_NONFREE) 138 AC_SUBST(HAVE_XBMC_NONFREE)
139+AC_SUBST(BUILD_MYSQL)
116+AC_SUBST(BUILD_MYTHTV) 140+AC_SUBST(BUILD_MYTHTV)
117 AC_SUBST(USE_ASAP_CODEC) 141 AC_SUBST(USE_ASAP_CODEC)
118 AC_SUBST(LIBCURL_BASENAME) 142 AC_SUBST(LIBCURL_BASENAME)
119 AC_SUBST(LIBFLAC_BASENAME) 143 AC_SUBST(LIBFLAC_BASENAME)
120--- a/xbmc/dbwrappers/Database.cpp 144--- a/xbmc/dbwrappers/Database.cpp
121+++ b/xbmc/dbwrappers/Database.cpp 145+++ b/xbmc/dbwrappers/Database.cpp
122@@ -29,7 +29,9 @@ 146@@ -29,7 +29,9 @@
123 #include "utils/AutoPtrHandle.h" 147 #include "utils/AutoPtrHandle.h"
124 #include "utils/log.h" 148 #include "utils/log.h"
125 #include "utils/URIUtils.h" 149 #include "utils/URIUtils.h"
126+#ifdef BUILD_MYTHTV 150+#ifdef BUILD_MYSQL
127 #include "mysqldataset.h" 151 #include "mysqldataset.h"
128+#endif /* BUILD_MYTHTV */ 152+#endif /* BUILD_MYSQL */
129 #include "sqlitedataset.h" 153 #include "sqlitedataset.h"
130 154
131 155
132@@ -265,6 +267,7 @@ bool CDatabase::Open(const DatabaseSettings &settings) 156@@ -266,6 +268,7 @@
133 157
134 m_sqlite = true; 158 m_sqlite = true;
135 159
136+#ifdef BUILD_MYTHTV 160+#ifdef BUILD_MYSQL
137 if ( dbSettings.type.Equals("mysql") ) 161 if ( dbSettings.type.Equals("mysql") )
138 { 162 {
139 // check we have all information before we cancel the fallback 163 // check we have all information before we cancel the fallback
140@@ -274,6 +277,7 @@ bool CDatabase::Open(const DatabaseSettings &settings) 164@@ -276,7 +279,8 @@
141 else
142 CLog::Log(LOGINFO, "essential mysql database information is missing (eg. host, name, user, pass)"); 165 CLog::Log(LOGINFO, "Essential mysql database information is missing. Require at least host, user and pass defined.");
143 } 166 }
167 else
144+#endif /* BUILD_MYTHTV */ 168+#endif /* BUILD_MYSQL */
145 169 {
146 // always safely fallback to sqlite3, and use separate, versioned database 170 dbSettings.type = "sqlite3";
147 if (m_sqlite) 171 dbSettings.host = _P(g_settings.GetDatabaseFolder());
148@@ -339,10 +343,12 @@ bool CDatabase::Connect(const DatabaseSettings &dbSettings, bool create) 172 dbSettings.name = GetBaseDBName();
173@@ -369,10 +373,12 @@
149 { 174 {
150 m_pDB.reset( new SqliteDatabase() ) ; 175 m_pDB.reset( new SqliteDatabase() ) ;
151 } 176 }
152+#ifdef BUILD_MYTHTV 177+#ifdef BUILD_MYSQL
153 else if (dbSettings.type.Equals("mysql")) 178 else if (dbSettings.type.Equals("mysql"))
154 { 179 {
155 m_pDB.reset( new MysqlDatabase() ) ; 180 m_pDB.reset( new MysqlDatabase() ) ;
156 } 181 }
157+#endif /* BUILD_MYTHTV */ 182+#endif /* BUILD_MYSQL */
158 else 183 else
159 { 184 {
160 CLog::Log(LOGERROR, "Unable to determine database type: %s", dbSettings.type.c_str()); 185 CLog::Log(LOGERROR, "Unable to determine database type: %s", dbSettings.type.c_str());
161--- a/xbmc/dbwrappers/Makefile 186--- a/xbmc/dbwrappers/Makefile
162+++ b/xbmc/dbwrappers/Makefile 187+++ b/xbmc/dbwrappers/Makefile
165 dataset.cpp \ 190 dataset.cpp \
166- mysqldataset.cpp \ 191- mysqldataset.cpp \
167 qry_dat.cpp \ 192 qry_dat.cpp \
168 sqlitedataset.cpp \ 193 sqlitedataset.cpp \
169 194
170+ifeq (@BUILD_MYTHTV@,1) 195+ifeq (@BUILD_MYSQL@,1)
171+SRCS+=\ 196+SRCS+=\
172+ mysqldataset.cpp 197+ mysqldataset.cpp
173+endif 198+endif
174+ 199+
175 LIB=dbwrappers.a 200 LIB=dbwrappers.a

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20