From 99445345816f9451d4c6b8f9b402960334725fa4 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Sat, 7 May 2011 17:36:49 -0400 Subject: [PATCH 1/4] deposx fixes for osx --- admin/mac/add-Qt-to-bundle.sh | 8 ++++++ admin/mac/add-spotify.sh | 16 ++++++++++++ admin/mac/build-release-osx.sh | 21 ++++++++++++---- admin/mac/deposx.sh | 46 +++++++++++++++++++++++++++++++--- thirdparty/jreen | 2 +- 5 files changed, 83 insertions(+), 10 deletions(-) create mode 100755 admin/mac/add-spotify.sh diff --git a/admin/mac/add-Qt-to-bundle.sh b/admin/mac/add-Qt-to-bundle.sh index fee822d38..e5c8f319f 100755 --- a/admin/mac/add-Qt-to-bundle.sh +++ b/admin/mac/add-Qt-to-bundle.sh @@ -46,10 +46,18 @@ shift mkdir -p Contents/MacOS mkdir -p Contents/MacOS/sqldrivers mkdir -p Contents/MacOS/imageformats +mkdir -p Contents/MacOS/phonon_backend +mkdir -p Contents/MacOS/crypto cp -R $QT_PLUGINS_DIR/sqldrivers/libqsqlite.dylib Contents/MacOS/sqldrivers/ cp -R $QT_PLUGINS_DIR/imageformats/libqgif.dylib Contents/MacOS/imageformats/ cp -R $QT_PLUGINS_DIR/imageformats/libqjpeg.dylib Contents/MacOS/imageformats/ +cp -R $QT_PLUGINS_DIR/imageformats/libqico.dylib Contents/MacOS/imageformats/ +cp -R $QT_PLUGINS_DIR/imageformats/libqmng.dylib Contents/MacOS/imageformats/ +cp -R $QT_PLUGINS_DIR/imageformats/libqsvg.dylib Contents/MacOS/imageformats/ +cp -R $QT_PLUGINS_DIR/imageformats/libqtiff.dylib Contents/MacOS/imageformats/ +cp -R $QT_PLUGINS_DIR/crypto/libqca-ossl.dylib Contents/MacOS/crypto/ +cp -R $QT_PLUGINS_DIR/phonon_backend/phonon_vlc.so Contents/MacOS/phonon_backend/ #cleanup find Contents/Frameworks -name Headers -o -name \*.prl -o -name \*_debug | xargs rm -rf diff --git a/admin/mac/add-spotify.sh b/admin/mac/add-spotify.sh new file mode 100755 index 000000000..5f440f051 --- /dev/null +++ b/admin/mac/add-spotify.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# author: lfranchi@kde.org +# usage: Run from inside the bundle root directory, eg. Tomahawk.app +# The first parameter should be the spotify resolver binary to copy. +# eg: add-spotify.sh /path/to/tomahawk_spotify +################################################################################ + +mkdir -p Contents/Frameworks +cp -R /Library/Frameworks/libspotify.framework Contents/Frameworks + +install_name_tool -change /usr/local/Cellar/qt/4.7.3/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore $1 +install_name_tool -change /usr/local/Cellar/qt/4.7.3/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $1 +install_name_tool -change libqjson.0.dylib @executable_path/libqjson.0.7.1.dylib $1 + +mkdir -p Contents/MacOS +cp $1 Contents/MacOS/ diff --git a/admin/mac/build-release-osx.sh b/admin/mac/build-release-osx.sh index b283a2e44..e065ce697 100755 --- a/admin/mac/build-release-osx.sh +++ b/admin/mac/build-release-osx.sh @@ -36,7 +36,7 @@ echo "Goes here: $QTDIR" export QMAKESPEC='macx-g++' export QTDIR export VERSION -export QTVERSION='4.7.2' +export QTVERSION='4.7.3' ################################################################################ @@ -49,21 +49,32 @@ VERSION=$1 header "Adding Qt to app bundle" cd tomahawk.app $ROOT/../admin/mac/add-Qt-to-bundle.sh \ - 'QtCore QtGui QtXml QtNetwork QtSql QtXmlPatterns QtWebKit phonon' - - header "Running install_name_tool" - $ROOT/../admin/mac/deposx.sh + 'QtCore QtGui QtXml QtNetwork QtSql QtXmlPatterns QtWebKit QtDbus phonon' header "Renaming files" mv Contents/Resources/tomahawkSources.icns Contents/Resources/Tomahawk.icns mv Contents/MacOS/tomahawk Contents/MacOS/Tomahawk # cp $ROOT/../admin/mac/Info.plist Contents/Info.plist + header "Copying VLC plugins into bundle" + mkdir -p Contents/PlugIns + cp -R /usr/local/Cellar/vlc-git/HEAD/lib/vlc/plugins/* Contents/PlugIns + + header "Running install_name_tool" + $ROOT/../admin/mac/deposx.sh + header "Copying Sparkle pubkey & framework, and qt.conf" cp $ROOT/../admin/mac/sparkle_pub.pem Contents/Resources cp -R /Library/Frameworks/Sparkle.framework Contents/Frameworks cp $ROOT/../admin/mac/qt.conf Contents/Resources + header "Adding spotify resolver to bundle if tomahawk_spotify found in $ROOT" + if [ -e $ROOT/tomahawk_spotify ] + then + header "Found, so adding spotify resolver." + $ROOT/../admin/mac/add-spotify.sh $ROOT/tomahawk_spotify + fi + header "Creating DMG" cd .. mv tomahawk.app Tomahawk.app diff --git a/admin/mac/deposx.sh b/admin/mac/deposx.sh index 8a8332936..d37e00500 100755 --- a/admin/mac/deposx.sh +++ b/admin/mac/deposx.sh @@ -23,6 +23,8 @@ cd Contents QTLIBS=`ls Frameworks | cut -d. -f1` LIBS=`cd MacOS && ls -fR1 | grep dylib` +PLUGINFOLDERS=`ls PlugIns | cut -d. -f1` + ################################################################################ @@ -67,21 +69,34 @@ function deplib_change install_name_tool -change /usr/local/lib/libclucene-core.0.9.23.dylib @executable_path/libclucene-core.0.9.23.dylib $1 install_name_tool -change /usr/local/lib/libclucene-shared.0.9.23.dylib @executable_path/libclucene-shared.0.9.23.dylib $1 install_name_tool -change /usr/local/Cellar/gloox/1.0/lib/libgloox.8.dylib @executable_path/libgloox.8.dylib $1 - install_name_tool -change /usr/local/Cellar/taglib/1.6.3/lib/libtag.1.dylib @executable_path/libtag.1.dylib $1 + install_name_tool -change /usr/local/Cellar/taglib/1.7/lib/libtag.1.7.0.dylib @executable_path/libtag.1.7.0.dylib $1 install_name_tool -change /usr/local/Cellar/libogg/1.2.0/lib/libogg.0.dylib @executable_path/libogg.0.dylib $1 install_name_tool -change /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbis.0.dylib @executable_path/libvorbis.0.dylib $1 install_name_tool -change /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbisfile.3.dylib @executable_path/libvorbisfile.3.dylib $1 install_name_tool -change /usr/local/Cellar/mad/0.15.1b/lib/libmad.0.dylib @executable_path/libmad.0.dylib $1 install_name_tool -change /usr/local/Cellar/flac/1.2.1/lib/libFLAC++.6.dylib @executable_path/libFLAC++.6.dylib $1 install_name_tool -change /usr/local/Cellar/flac/1.2.1/lib/libFLAC.8.dylib @executable_path/libFLAC.8.dylib $1 + install_name_tool -change /usr/local/Cellar/kde-phonon/4.5.0/lib/libphonon.4.dylib @executable_path/libphonon.4.dylib $1 + install_name_tool -change /usr/local/Cellar/kde-phonon/4.5.0/lib/libphonon.4.5.0.dylib @executable_path/libphonon.4.dylib $1 install_name_tool -change $ORIGROOT/src/libtomahawk/libtomahawklib.dylib @executable_path/libtomahawklib.dylib $1 install_name_tool -change $ORIGROOT/libtomahawk_sipjabber.dylib @executable_path/libtomahawk_sipjabber.dylib $1 install_name_tool -change $ORIGROOT/libtomahawk_siptwitter.dylib @executable_path/libtomahawk_siptwitter.dylib $1 install_name_tool -change $ORIGROOT/libtomahawk_sipzeroconf.dylib @executable_path/libtomahawk_sipzeroconf.dylib $1 install_name_tool -change $ORIGROOT/thirdparty/jdns/libtomahawk_jdns.dylib @executable_path/libtomahawk_jdns.dylib $1 install_name_tool -change $ORIGROOT/thirdparty/qtweetlib/libtomahawk_qtweetlib.dylib @executable_path/libtomahawk_qtweetlib.dylib $1 + install_name_tool -change /usr/local/Cellar/kde-phonon/4.5.0/lib/libphonon.4.5.0.dylib @executable_path/libphonon.4.dylib $1 + install_name_tool -change /Users/leo/kde/tomahawk/build/thirdparty/jreen/libjreen.0.dylib @executable_path/libjreen.0.dylib $1 + install_name_tool -change /usr/local/Cellar/jreen/HEAD/lib/libjreen.dylib @executable_path/libjreen.0.dylib $1 + install_name_tool -change /usr/local/Cellar/qca/2.0.2/lib/qca.framework/Versions/2/qca @executable_path/../Frameworks/qca.framework/Versions/2/qca $1 - install_name_tool -change libqjson.0.7.1.dylib @executable_path/libqjson.0.7.1.dylib $1 + install_name_tool -change /usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib @executable_path/libintl.8.dylib $1 + install_name_tool -change /usr/local/Cellar/vlc-git/HEAD/lib/libvlc.5.dylib @executable_path/libvlc.5.dylib $1 + install_name_tool -change /usr/local/Cellar/vlc-git/HEAD/lib/libvlccore.4.dylib @executable_path/libvlccore.4.dylib $1 + + install_name_tool -change /usr/local/Cellar/qt/4.7.3/lib/QtDBus.framework/Versions/4/QtDBus @executable_path/../Frameworks/QtDBus.framework/Versions/4/QtDBus $1 + install_name_tool -change /Users/leo/kde/tomahawk/build/libtomahawk_sipgoogle.dylib libtomahawk_sipgoogle.dylib $1 + install_name_tool -change /Users/leo/kde/tomahawk/build/libtomahawk_sipjabber.dylib libtomahawk_sipgoogle.dylib $1 + install_name_tool -change libqjson.0.dylib @executable_path/libqjson.0.7.1.dylib $1 install_name_tool -change libechonest.1.1.dylib @executable_path/libechonest.1.1.dylib $1 install_name_tool -change libclucene-core.0.9.23.dylib @executable_path/libclucene-core.0.9.23.dylib $1 install_name_tool -change libclucene-shared.0.9.23.dylib @executable_path/libclucene-shared.0.9.23.dylib $1 @@ -100,9 +115,9 @@ do done import_lib /usr/local/Cellar/qjson/0.7.1/lib/libqjson.0.7.1.dylib -import_lib /usr/local/Cellar/liblastfm/0.3.3/lib/liblastfm.0.dylib +#import_lib /usr/local/Cellar/liblastfm/0.3.3/lib/liblastfm.0.dylib import_lib /usr/local/Cellar/gloox/1.0/lib/libgloox.8.dylib -import_lib /usr/local/Cellar/taglib/1.6.3/lib/libtag.1.dylib +import_lib /usr/local/Cellar/taglib/1.7/lib/libtag.1.7.0.dylib import_lib /usr/local/Cellar/libogg/1.2.0/lib/libogg.0.dylib import_lib /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbis.0.dylib import_lib /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbisfile.3.dylib @@ -112,14 +127,25 @@ import_lib /usr/local/Cellar/flac/1.2.1/lib/libFLAC.8.dylib import_lib /usr/local/lib/libechonest.1.1.dylib import_lib /usr/local/lib/libclucene-core.0.9.23.dylib import_lib /usr/local/lib/libclucene-shared.0.9.23.dylib +import_lib /usr/local/Cellar/kde-phonon/4.5.0/lib/libphonon.4.dylib +import_lib /Users/leo/kde/tomahawk/build/thirdparty/jreen/libjreen.0.dylib +import_lib /usr/local/Cellar/vlc-git/HEAD/lib/libvlc.5.dylib +import_lib /usr/local/Cellar/vlc-git/HEAD/lib/libvlccore.4.dylib +import_lib /usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib import_lib ../../libtomahawk_sipjabber.dylib +import_lib ../../libtomahawk_sipgoogle.dylib import_lib ../../libtomahawk_siptwitter.dylib import_lib ../../libtomahawk_sipzeroconf.dylib import_lib ../../src/libtomahawk/libtomahawklib.dylib import_lib ../../thirdparty/jdns/libtomahawk_jdns.dylib import_lib ../../thirdparty/qtweetlib/libtomahawk_qtweetlib.dylib +cp -R /usr/local/Cellar/qca/2.0.2/lib/qca.framework Frameworks/ +chmod 644 Frameworks/qca.framework/Versions/2/qca +deplib_change Frameworks/qca.framework/Versions/2/qca +deposx_change Frameworks/qca.framework/Versions/2/qca + # now Qt for x in $QTLIBS do @@ -128,4 +154,16 @@ do deposx_change Frameworks/$x.framework/Versions/4/$x install_name_tool -id @executable_path/../Frameworks/$x.framework/Versions/4/$x \ Frameworks/$x.framework/Versions/4/$x + deplib_change "Frameworks/$x.framework/Versions/4/$x" +done + +# now VLC plugins +for x in PlugIns/$PLUGINFOLDERS +do + for plugin in `ls PlugIns/$x | cut -f1` + do + echo "Fixing VLC plugin: $plugin" + chmod 644 PlugIns/$x/$plugin + deplib_change PlugIns/$x/$plugin + done done diff --git a/thirdparty/jreen b/thirdparty/jreen index 40fd6b0a3..58fb2d4bc 160000 --- a/thirdparty/jreen +++ b/thirdparty/jreen @@ -1 +1 @@ -Subproject commit 40fd6b0a3dbc729fdf1db8490848b43d5b1f57f5 +Subproject commit 58fb2d4bc2abebdf778ca230a84042c7f5694583 From 66c6cd56a8b730d0ec2b9d538e9482df2002553d Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 9 May 2011 16:57:07 +0200 Subject: [PATCH 2/4] slim vlc plugins and check for new resolver name format --- CMakeLists.txt | 2 +- admin/mac/add-spotify.sh | 2 +- admin/mac/build-release-osx.sh | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2adfba3a5..4007ce216 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ ENDIF( ${CMAKE_VERSION} VERSION_GREATER 2.8.3 ) SET( TOMAHAWK_ORGANIZATION_NAME "Tomahawk" ) SET( TOMAHAWK_ORGANIZATION_DOMAIN "tomahawk-player.org" ) SET( TOMAHAWK_APPLICATION_NAME "Tomahawk" ) -SET( TOMAHAWK_VERSION "0.0.3" ) +SET( TOMAHAWK_VERSION "0.1.0" ) # set paths diff --git a/admin/mac/add-spotify.sh b/admin/mac/add-spotify.sh index 5f440f051..651ce1a60 100755 --- a/admin/mac/add-spotify.sh +++ b/admin/mac/add-spotify.sh @@ -2,7 +2,7 @@ # author: lfranchi@kde.org # usage: Run from inside the bundle root directory, eg. Tomahawk.app # The first parameter should be the spotify resolver binary to copy. -# eg: add-spotify.sh /path/to/tomahawk_spotify +# eg: add-spotify.sh /path/to/spotify_tomahawkresolver ################################################################################ mkdir -p Contents/Frameworks diff --git a/admin/mac/build-release-osx.sh b/admin/mac/build-release-osx.sh index e065ce697..5773ad2c7 100755 --- a/admin/mac/build-release-osx.sh +++ b/admin/mac/build-release-osx.sh @@ -58,7 +58,10 @@ VERSION=$1 header "Copying VLC plugins into bundle" mkdir -p Contents/PlugIns - cp -R /usr/local/Cellar/vlc-git/HEAD/lib/vlc/plugins/* Contents/PlugIns + cp -R /usr/local/Cellar/vlc-git/HEAD/lib/vlc/plugins/ Contents/PlugIns + rm -rf Contents/PlugIns/video_* Contents/PlugIns/gui Contents/PlugIns/*/libold* Contents/PlugIns/*/libvcd* Contents/PlugIns/*/libdvd* \ + Contents/PlugIns/*/liblibass* Contents/PlugIns/*/libx264* Contents/PlugIns/*/libschroe* Contents/PlugIns/*/liblibmpeg2* \ + Contents/PlugIns/*/libstream_out_* Contents/PlugIns/*/libmjpeg_plugin* Contents/PlugIns/*/libh264_plugin* Contents/PlugIns/*/libzvbi_plugin* Contents/PlugIns/*/lib*sub* header "Running install_name_tool" $ROOT/../admin/mac/deposx.sh @@ -68,11 +71,11 @@ VERSION=$1 cp -R /Library/Frameworks/Sparkle.framework Contents/Frameworks cp $ROOT/../admin/mac/qt.conf Contents/Resources - header "Adding spotify resolver to bundle if tomahawk_spotify found in $ROOT" - if [ -e $ROOT/tomahawk_spotify ] + header "Adding spotify resolver to bundle if spotify_tomahawkresolver found in $ROOT" + if [ -e $ROOT/spotify_tomahawkresolver ] then - header "Found, so adding spotify resolver." - $ROOT/../admin/mac/add-spotify.sh $ROOT/tomahawk_spotify + header "Found, so adding spotify resolver."ac + $ROOT/../admin/mac/add-spotify.sh $ROOT/spotify_tomahawkresolver fi header "Creating DMG" From 15c02540d61440e4824060b80c17a1758c69dcb6 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Wed, 11 May 2011 14:08:42 +0200 Subject: [PATCH 3/4] Immediately update delegate with widget config change --- src/libtomahawk/resolver.h | 4 ++++ src/resolvers/scriptresolver.cpp | 2 ++ src/resolversmodel.cpp | 18 ++++++++++++++++++ src/resolversmodel.h | 5 +++++ src/settingsdialog.cpp | 2 +- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/resolver.h b/src/libtomahawk/resolver.h index c3a3bae7e..2d574898f 100644 --- a/src/libtomahawk/resolver.h +++ b/src/libtomahawk/resolver.h @@ -65,9 +65,13 @@ public: virtual QWidget* configUI() const = 0; virtual void saveConfig() = 0; + public slots: virtual void stop() = 0; +signals: + void changed(); // if config widget was added/removed + protected: QWidget* widgetFromData( QByteArray& data, QWidget* parent = 0 ); QVariant configMsgFromWidget( QWidget* w ); diff --git a/src/resolvers/scriptresolver.cpp b/src/resolvers/scriptresolver.cpp index d119e9e4e..0c57ff2cf 100644 --- a/src/resolvers/scriptresolver.cpp +++ b/src/resolvers/scriptresolver.cpp @@ -257,6 +257,8 @@ ScriptResolver::setupConfWidget( const QVariantMap& m ) if( m.contains( "images" ) ) uiData = fixDataImagePaths( uiData, compressed, m[ "images" ].toMap() ); m_configWidget = QWeakPointer< QWidget >( widgetFromData( uiData, 0 ) ); + + emit changed(); } diff --git a/src/resolversmodel.cpp b/src/resolversmodel.cpp index f3664cef9..0094dad79 100644 --- a/src/resolversmodel.cpp +++ b/src/resolversmodel.cpp @@ -125,6 +125,12 @@ ResolversModel::addResolver( const QString& resolver, bool enable ) m_allResolvers << resolver; if( enable ) m_enabledResolvers << resolver; + if( Tomahawk::ExternalResolver* res = TomahawkApp::instance()->resolverForPath( resolver ) ) { + qDebug() << "Added resolver with config and stuff:" << res->configUI(); + connect( res, SIGNAL( changed() ), this, SLOT( resolverChanged() ) ); + } else + qDebug() << "No resolver object for path yet:" << resolver; + endInsertRows(); } @@ -153,6 +159,18 @@ ResolversModel::enabledResolvers() const return m_enabledResolvers; } +void +ResolversModel::resolverChanged() +{ + Q_ASSERT( qobject_cast< Tomahawk::ExternalResolver* >( sender() ) ); + Tomahawk::ExternalResolver* res = qobject_cast< Tomahawk::ExternalResolver* >( sender() ); + qDebug() << "Got resolverChanged signal, does it have a config UI yet?" << res->configUI(); + if( m_enabledResolvers.contains( res->filePath() ) ) { + QModelIndex idx = index( m_allResolvers.indexOf( res->filePath() ), 0, QModelIndex() ); + emit dataChanged( idx, idx ); + } +} + void ResolversModel::addInstalledResolvers() { diff --git a/src/resolversmodel.h b/src/resolversmodel.h index e7890fabf..d19d0d474 100644 --- a/src/resolversmodel.h +++ b/src/resolversmodel.h @@ -26,6 +26,7 @@ class ResolversModel : public QAbstractListModel { + Q_OBJECT public: enum Roles { ResolverName = Qt::UserRole + 15, @@ -47,6 +48,10 @@ public: QStringList allResolvers() const; QStringList enabledResolvers() const; + +private slots: + void resolverChanged(); + private: void addInstalledResolvers(); diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 4bed6ae1f..3f5871aff 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -440,8 +440,8 @@ SettingsDialog::addScriptResolver() { QString resolver = QFileDialog::getOpenFileName( this, tr( "Load script resolver file" ), qApp->applicationDirPath() ); if( !resolver.isEmpty() ) { - m_resolversModel->addResolver( resolver, true ); TomahawkApp::instance()->enableScriptResolver( resolver ); + m_resolversModel->addResolver( resolver, true ); } } From e2fac74d1d7e39e2456ee4c807afe219c8a0e317 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Wed, 11 May 2011 15:44:47 +0200 Subject: [PATCH 4/4] install_name_tool_ize_to_make_shit_work_kthxbbq --- admin/mac/add-spotify.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/mac/add-spotify.sh b/admin/mac/add-spotify.sh index 651ce1a60..170c67e18 100755 --- a/admin/mac/add-spotify.sh +++ b/admin/mac/add-spotify.sh @@ -11,6 +11,6 @@ cp -R /Library/Frameworks/libspotify.framework Contents/Frameworks install_name_tool -change /usr/local/Cellar/qt/4.7.3/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore $1 install_name_tool -change /usr/local/Cellar/qt/4.7.3/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $1 install_name_tool -change libqjson.0.dylib @executable_path/libqjson.0.7.1.dylib $1 - +install_name_tool -change /usr/local/Cellar/qjson/0.7.1/lib/libqjson.0.7.1.dylib @executable_path/libqjson.0.7.1.dylib $1 mkdir -p Contents/MacOS cp $1 Contents/MacOS/