mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
Make QCA2 an optional dep, it's only required for HMAC(md5) for resolvers
This commit is contained in:
@@ -103,7 +103,7 @@ macro_optional_find_package(Boost)
|
||||
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explaination
|
||||
|
||||
macro_optional_find_package(QCA2)
|
||||
macro_log_feature(QCA2_FOUND "QCA2" "Provides encryption and signing functions required for Grooveshark resolver" "http://delta.affinix.com/qca/" TRUE "" "")
|
||||
macro_log_feature(QCA2_FOUND "QCA2" "Provides encryption and signing functions required for Grooveshark resolver" "http://delta.affinix.com/qca/" FALSE "" "")
|
||||
|
||||
# required
|
||||
#While we distribute our own liblastfm2, don't need to look for it
|
||||
|
@@ -163,7 +163,6 @@ INCLUDE_DIRECTORIES(
|
||||
${QJSON_INCLUDE_DIR}
|
||||
${LIBECHONEST_INCLUDE_DIR}
|
||||
${LIBECHONEST_INCLUDE_DIR}/..
|
||||
${QCA2_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES "" )
|
||||
@@ -195,6 +194,10 @@ IF(GLOOX_FOUND)
|
||||
ENDIF(GLOOX_FOUND)
|
||||
ADD_SUBDIRECTORY( sip )
|
||||
|
||||
IF(QCA2_FOUND)
|
||||
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
|
||||
ENDIF(QCA2_FOUND)
|
||||
|
||||
kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
|
||||
qt4_add_resources( RC_SRCS "../resources.qrc" )
|
||||
qt4_wrap_cpp( tomahawkMoc ${tomahawkHeaders} )
|
||||
@@ -235,6 +238,10 @@ IF(GLOOX_FOUND)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${GLOOX_LIBRARIES} )
|
||||
ENDIF(GLOOX_FOUND)
|
||||
|
||||
IF(QCA2_FOUND)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${QCA2_LIBRARIES} )
|
||||
ENDIF(QCA2_FOUND)
|
||||
|
||||
TARGET_LINK_LIBRARIES( tomahawk
|
||||
${LINK_LIBRARIES}
|
||||
${TOMAHAWK_LIBRARIES}
|
||||
@@ -246,10 +253,8 @@ TARGET_LINK_LIBRARIES( tomahawk
|
||||
${QXTWEB_LIBRARIES}
|
||||
${QJSON_LIBRARIES}
|
||||
${TAGLIB_LIBRARIES}
|
||||
${QCA2_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
IF( APPLE )
|
||||
IF(HAVE_SPARKLE)
|
||||
MESSAGE("Sparkle Found, installing framekwork in bundle")
|
||||
|
@@ -17,5 +17,6 @@
|
||||
|
||||
#cmakedefine LIBLASTFM_FOUND
|
||||
#cmakedefine GLOOX_FOUND
|
||||
#cmakedefine QCA2_FOUND
|
||||
|
||||
#endif // CONFIG_H_IN
|
||||
|
@@ -123,6 +123,7 @@ QtScriptResolverHelper::setResolverConfig( const QVariantMap& config )
|
||||
QString
|
||||
QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input )
|
||||
{
|
||||
#ifdef QCA2_FOUND
|
||||
if ( !QCA::isSupported( "hmac(md5)" ) )
|
||||
{
|
||||
tLog() << "HMAC(md5) not supported with qca-ossl plugin, or qca-ossl plugin is not installed! Unable to generate signature!";
|
||||
@@ -138,6 +139,10 @@ QtScriptResolverHelper::hmac( const QByteArray& key, const QByteArray &input )
|
||||
|
||||
QString result = QCA::arrayToHex( resultArray.toByteArray() );
|
||||
return result.toUtf8();
|
||||
#else
|
||||
tLog() << "Tomahawk compiled without QCA support, cannot generate HMAC signature";
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
QString
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "query.h"
|
||||
#include "result.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
@@ -30,7 +31,10 @@
|
||||
#include <QThread>
|
||||
#include <QtWebKit/QWebPage>
|
||||
#include <QtWebKit/QWebFrame>
|
||||
|
||||
#ifdef QCA2_FOUND
|
||||
#include <QtCrypto>
|
||||
#endif
|
||||
|
||||
class QtScriptResolver;
|
||||
|
||||
@@ -63,7 +67,9 @@ private:
|
||||
QString m_scriptPath;
|
||||
QVariantMap m_resolverConfig;
|
||||
QtScriptResolver* m_resolver;
|
||||
#ifdef QCA2_FOUND
|
||||
QCA::Initializer m_qcaInit;
|
||||
#endif
|
||||
};
|
||||
|
||||
class ScriptEngine : public QWebPage
|
||||
|
Reference in New Issue
Block a user