[amarok] /: Make OpenGL (and thus the analyzer applet) an optional dependency.

Mark Kretschmann kretschmann at kde.org
Thu Jul 11 09:04:25 UTC 2013


Git commit 3c4a6f324aef29c08bc1d5222f5dd2adc1dd4f8d by Mark Kretschmann.
Committed on 09/07/2013 at 13:53.
Pushed by markey into branch 'master'.

Make OpenGL (and thus the analyzer applet) an optional dependency.

Kubuntu packagers have informed me that OpenGL support is not yet
readily available for desktop Linux on ARM platforms. Therefore I've
decided to do the (still quite small) Linux-on-ARM community a favor.

Please test!

CCMAIL: amarok-devel at kde.org
CCMAIL: sitter at kde.org

M  +3    -1    CMakeLists.txt
M  +3    -1    README
M  +3    -0    shared/config.h.cmake
M  +4    -1    src/context/ContextView.cpp
M  +4    -1    src/context/applets/CMakeLists.txt

http://commits.kde.org/amarok/3c4a6f324aef29c08bc1d5222f5dd2adc1dd4f8d

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd2f051..4c04e5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,7 +84,7 @@ include_directories(
     ${CMAKE_CURRENT_BINARY_DIR}/shared
 )
 
-find_package( Qt4 4.8.2 COMPONENTS QtCore QtGui QtOpenGL QtScript QtSvg QtXml QtWebKit REQUIRED )
+find_package( Qt4 4.8.2 COMPONENTS QtCore QtGui QtScript QtSvg QtXml QtWebKit REQUIRED )
 find_package( KDE4 4.8.4 REQUIRED )
 
 include( KDE4Defaults )
@@ -130,6 +130,8 @@ if( WITH_PLAYER )
 
     macro_log_feature( KDE4_FOUND "kdelibs" "The toolkit Amarok uses to build" "http://www.kde.org" TRUE ${KDE_MIN_VERSION} "" )
 
+    macro_log_feature( QT_QTOPENGL_FOUND "QtOpenGL" "Required for the spectrum analyzer" "http://qt-project.org" FALSE "" "" )
+
     macro_log_feature( QTSCRIPTQTBINDINGS_FOUND "qtscript-qt" "QtScript Qt Bindings" "http://code.google.com/p/qtscriptgenerator/" FALSE "" "" )
 
     find_package(MySQLAmarok REQUIRED)
diff --git a/README b/README
index a1ec623..9f84fba 100644
--- a/README
+++ b/README
@@ -66,7 +66,6 @@ Required
       http://delta.affinix.com/qca/
 
 Optional
-
     * Taglib 1.8 for support of MOD, IT, S3M and XM files
     * Taglib 1.9 for support of Opus files
       http://developer.kde.org/~wheeler/taglib.html
@@ -83,6 +82,9 @@ Optional
       (MTP device support)
       http://libmtp.sourceforge.net/
 
+    * Spectrum analyzer requires:
+      * QtOpenGL
+
     * Mp3tunes.com integration (including syncronization) requires:
       * OpenSSL http://www.openssl.org
       * libxml2 http://xmlsoft.org
diff --git a/shared/config.h.cmake b/shared/config.h.cmake
index 685462f..5313384 100644
--- a/shared/config.h.cmake
+++ b/shared/config.h.cmake
@@ -18,6 +18,9 @@
 /* have Qt bindings */
 #cmakedefine QTSCRIPTQTBINDINGS_FOUND 1
 
+/* have QtOpenGL */
+#cmakedefine QT_QTOPENGL_FOUND 1
+
 /* If liblastfm is found */
 #cmakedefine HAVE_LIBLASTFM 1
 
diff --git a/src/context/ContextView.cpp b/src/context/ContextView.cpp
index 152f8da..d50f3a3 100644
--- a/src/context/ContextView.cpp
+++ b/src/context/ContextView.cpp
@@ -24,6 +24,8 @@
 
 #include "ContextView.h"
 
+#include "config.h"
+
 #include "Context.h"
 #include "ContextScene.h"
 #include "Svg.h"
@@ -211,7 +213,7 @@ ContextView::loadConfig()
         if( containment )
         {
             KConfigGroup cg( &conf, QString( "Containment %1" ).arg( i ) );
-
+#ifdef QT_QTOPENGL_FOUND
             // Special case: If this is the first time that the user runs an Amarok version
             // containing the Analyzer applet, modify the user's config so that the applet
             // will become active. We do this for discoverability and prettiness.
@@ -235,6 +237,7 @@ ContextView::loadConfig()
                     cg.writeEntry( "plugins", plugins );
                 }
             }
+#endif
             containment->loadConfig( cg );
         }
     }
diff --git a/src/context/applets/CMakeLists.txt b/src/context/applets/CMakeLists.txt
index 3387a92..f4d5456 100644
--- a/src/context/applets/CMakeLists.txt
+++ b/src/context/applets/CMakeLists.txt
@@ -1,5 +1,4 @@
 add_subdirectory( albums )
-add_subdirectory( analyzer )
 add_subdirectory( currenttrack )
 add_subdirectory( info )
 add_subdirectory( labels )
@@ -8,6 +7,10 @@ add_subdirectory( photos )
 add_subdirectory( tabs )
 add_subdirectory( wikipedia )
 
+if( QT_QTOPENGL_FOUND )
+    add_subdirectory( analyzer )
+endif()
+
 if( LIBLASTFM_FOUND )
     add_subdirectory( upcomingevents )
     add_subdirectory( similarartists )



More information about the Amarok-devel mailing list