diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 074657546..488f6b1c8 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -915,9 +915,8 @@ jobs: path: bin/clementine_*.deb build_mac: - if: false name: Build Mac DMG - runs-on: macos-10.15 + runs-on: macos-11 steps: - uses: actions/checkout@v1.2.0 - name: git hackery @@ -957,7 +956,6 @@ jobs: Qt5LinguistTools_DIR: /usr/local/opt/qt5/lib/cmake/Qt5LinguistTools GST_SCANNER_PATH: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0 - DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer working-directory: bin run: > cmake .. @@ -967,6 +965,7 @@ jobs: -DGETTEXT_MSGMERGE_EXECUTABLE=/usr/local/opt/gettext/bin/msgmerge -DGETTEXT_MSGFMT_EXECUTABLE=/usr/local/opt/gettext/bin/msgfmt -DGETTEXT_XGETTEXT_EXECUTABLE=/usr/local/opt/gettext/bin/xgettext + -DDEVELOPER_DIR=$(xcode-select -p) - name: make working-directory: bin run: make -j2 diff --git a/3rdparty/libprojectm/CMakeLists.txt b/3rdparty/libprojectm/CMakeLists.txt index ce5834448..67b6a2778 100644 --- a/3rdparty/libprojectm/CMakeLists.txt +++ b/3rdparty/libprojectm/CMakeLists.txt @@ -175,7 +175,7 @@ if(BUNDLE_PROJECTM_PRESETS) configure_file( "${preset}" "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources/projectm-presets/${PRESET_NAME}" - COPY_ONLY + COPYONLY ) endforeach (preset) else (APPLE) diff --git a/3rdparty/libprojectm/Renderer/Waveform.cpp b/3rdparty/libprojectm/Renderer/Waveform.cpp index da1e47f68..3199d5fea 100644 --- a/3rdparty/libprojectm/Renderer/Waveform.cpp +++ b/3rdparty/libprojectm/Renderer/Waveform.cpp @@ -17,8 +17,11 @@ #include "Waveform.hpp" #include +#include #include "BeatDetect.hpp" +using std::placeholders::_1; + typedef float floatPair[2]; typedef float floatTriple[3]; typedef float floatQuad[4]; @@ -65,8 +68,8 @@ void Waveform::Draw(RenderContext &context) float mult= scaling*( spectrum ? 0.015f :1.0f); - std::transform(&value1[0],&value1[samples],&value1[0],std::bind2nd(std::multiplies(),mult)); - std::transform(&value2[0],&value2[samples],&value2[0],std::bind2nd(std::multiplies(),mult)); + std::transform(&value1[0],&value1[samples],&value1[0],std::bind(std::multiplies(),_1, mult)); + std::transform(&value2[0],&value2[samples],&value2[0],std::bind(std::multiplies(),_1,mult)); WaveformContext waveContext(samples, context.beatDetect); diff --git a/3rdparty/libprojectm/omptl/omptl_algorithm_ser.h b/3rdparty/libprojectm/omptl/omptl_algorithm_ser.h index 61c596690..296b90529 100644 --- a/3rdparty/libprojectm/omptl/omptl_algorithm_ser.h +++ b/3rdparty/libprojectm/omptl/omptl_algorithm_ser.h @@ -15,6 +15,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#include namespace omptl { @@ -463,14 +464,15 @@ template void random_shuffle(RandomAccessIterator first, RandomAccessIterator last, const unsigned P) { - return ::std::random_shuffle(first, last); + std::random_device rd; + return ::std::shuffle(first, last, std::mt19937(rd())); } template void random_shuffle(RandomAccessIterator first, RandomAccessIterator last, RandomNumberGenerator &rgen, const unsigned P) { - return ::std::random_shuffle(first, last, rgen); + return ::std::shuffle(first, last, rgen); } template diff --git a/Brewfile b/Brewfile index b4bc45959..6084a809b 100644 --- a/Brewfile +++ b/Brewfile @@ -9,11 +9,6 @@ brew 'glew' brew 'glib' brew 'gnome-common' brew 'google-sparsehash' -brew 'gst-libav' -brew 'gst-plugins-bad' -brew 'gst-plugins-base' -brew 'gst-plugins-good' -brew 'gst-plugins-ugly' brew 'gstreamer' brew 'gtk-doc' brew 'intltool' diff --git a/CMakeLists.txt b/CMakeLists.txt index 806d7ff8a..8991d6ffd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,11 @@ endif(OPENGL_FOUND) find_package(Boost REQUIRED) find_package(Gettext REQUIRED) find_package(PkgConfig REQUIRED) -find_package(Protobuf REQUIRED) +if (APPLE) + find_package(protobuf REQUIRED CONFIG) +else() + find_package(Protobuf REQUIRED) +endif() find_package(FFTW3) find_package(ALSA) if (NOT APPLE) diff --git a/dist/macdeploy.py b/dist/macdeploy.py index 898462ec8..7f0603a4d 100755 --- a/dist/macdeploy.py +++ b/dist/macdeploy.py @@ -35,11 +35,11 @@ STRIP_PREFIX = [ '@@HOMEBREW_CELLAR@@/qt5/5.8.0_1/lib/', ] -LIBRARY_SEARCH_PATH = ['/target', '/target/lib', '/usr/local/lib', '/sw/lib'] +LIBRARY_SEARCH_PATH = ['/opt/homebrew/lib', '/target', '/target/lib', '/usr/local/lib', '/sw/lib'] GSTREAMER_PLUGINS = [ # Core plugins - 'libgstapp.dylib', + 'libgstapp-1.0.dylib', 'libgstaudioconvert.dylib', 'libgstaudiofx.dylib', 'libgstaudiotestsrc.dylib', @@ -88,10 +88,13 @@ GSTREAMER_PLUGINS = [ ] GSTREAMER_SEARCH_PATH = [ + '/opt/homebrew/lib', + '/opt/homebrew/opt/gstreamer/libexec/gstreamer-1.0', + '/usr/local/lib', '/usr/local/lib/gstreamer-1.0', + '/usr/local/opt/gstreamer/libexec/gstreamer-1.0', '/target/lib/gstreamer-1.0', '/target/libexec/gstreamer-1.0', - '/usr/local/opt/gstreamer/libexec/gstreamer-1.0', ] QT_PLUGINS = [ @@ -110,6 +113,7 @@ QT_PLUGINS = [ 'styles/libqmacstyle.dylib', ] QT_PLUGINS_SEARCH_PATH = [ + '/opt/homebrew/Cellar/qt@5/5.15.10/plugins', '/usr/local/opt/qt5/plugins', '/target/plugins', '/usr/local/Trolltech/Qt-4.7.0/plugins', @@ -117,6 +121,7 @@ QT_PLUGINS_SEARCH_PATH = [ ] GIO_MODULES_SEARCH_PATH = [ + '/opt/homebrew/lib/gio/modules', '/usr/local/lib/gio/modules', '/target/lib/gio/modules', ] @@ -204,6 +209,12 @@ def GetBrokenLibraries(binary): *os.path.split(line)[1:], ) broken_libs['libs'].append(abs_path) + elif re.match(r'^\s*@rpath', line): + abs_path = os.path.join( + os.path.dirname(binary), + *os.path.split(line)[1:], + ) + broken_libs['libs'].append(abs_path) elif re.match(r'^\s*@executable_path', line): # Potentially already fixed library relative_path = os.path.join(*line.split('/')[3:]) diff --git a/ext/clementine-tagreader/CMakeLists.txt b/ext/clementine-tagreader/CMakeLists.txt index 998f9fe46..38979a000 100644 --- a/ext/clementine-tagreader/CMakeLists.txt +++ b/ext/clementine-tagreader/CMakeLists.txt @@ -32,6 +32,11 @@ target_link_libraries(clementine-tagreader z ) +set_property( + TARGET clementine-tagreader + PROPERTY CXX_STANDARD 17 +) + if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") target_link_libraries(clementine-tagreader execinfo diff --git a/ext/libclementine-common/CMakeLists.txt b/ext/libclementine-common/CMakeLists.txt index ad35a515c..b74887a95 100644 --- a/ext/libclementine-common/CMakeLists.txt +++ b/ext/libclementine-common/CMakeLists.txt @@ -33,6 +33,11 @@ add_library(libclementine-common STATIC ${MOC} ) +set_property( + TARGET libclementine-common + PROPERTY CXX_STANDARD 17 +) + target_link_libraries(libclementine-common Qt5::Core Qt5::Network diff --git a/ext/libclementine-remote/CMakeLists.txt b/ext/libclementine-remote/CMakeLists.txt index 70761b493..9e0390806 100644 --- a/ext/libclementine-remote/CMakeLists.txt +++ b/ext/libclementine-remote/CMakeLists.txt @@ -6,14 +6,27 @@ set(MESSAGES remotecontrolmessages.proto ) -protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES}) +add_library(libclementine-remote STATIC) -add_library(libclementine-remote STATIC - ${PROTO_SOURCES} +protobuf_generate( + LANGUAGE cpp + TARGET libclementine-remote + PROTOS ${MESSAGES} ) +set_property( + TARGET libclementine-remote + PROPERTY CXX_STANDARD 17 +) + +get_cmake_property(_variableNames VARIABLES) +list (SORT _variableNames) +foreach (_variableName ${_variableNames}) + message(STATUS "${_variableName}=${${_variableName}}") +endforeach() + target_link_libraries(libclementine-remote - ${PROTOBUF_LIBRARY} + protobuf::libprotobuf libclementine-common ) diff --git a/ext/libclementine-tagreader/CMakeLists.txt b/ext/libclementine-tagreader/CMakeLists.txt index d7ae9f684..e074d6c21 100644 --- a/ext/libclementine-tagreader/CMakeLists.txt +++ b/ext/libclementine-tagreader/CMakeLists.txt @@ -28,16 +28,24 @@ optional_source(HAVE_GOOGLE_DRIVE qt5_wrap_cpp(MOC ${HEADERS}) -protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES}) - add_library(libclementine-tagreader STATIC - ${PROTO_SOURCES} ${SOURCES} ${MOC} ) +protobuf_generate( + LANGUAGE cpp + TARGET libclementine-tagreader + PROTOS ${MESSAGES} +) + +set_property( + TARGET libclementine-tagreader + PROPERTY CXX_STANDARD 17 +) + target_link_libraries(libclementine-tagreader - ${PROTOBUF_LIBRARY} + protobuf::libprotobuf libclementine-common ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ead2df889..3201a0bf2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1244,6 +1244,11 @@ add_library(clementine_lib STATIC ${OTHER_UIC_SOURCES} ) +set_property( + TARGET clementine_lib + PROPERTY CXX_STANDARD 17 +) + target_link_libraries(clementine_lib libclementine-common libclementine-tagreader diff --git a/src/covers/musicbrainzcoverprovider.cpp b/src/covers/musicbrainzcoverprovider.cpp index 1c7f7b71c..f3e6548fd 100644 --- a/src/covers/musicbrainzcoverprovider.cpp +++ b/src/covers/musicbrainzcoverprovider.cpp @@ -26,7 +26,7 @@ #include "core/closure.h" #include "core/network.h" -using std::mem_fun; +using std::mem_fn; namespace { @@ -89,7 +89,7 @@ void MusicbrainzCoverProvider::ReleaseSearchFinished(QNetworkReply* reply, void MusicbrainzCoverProvider::ImageCheckFinished(int id) { QList replies = image_checks_.values(id); int finished_count = std::count_if(replies.constBegin(), replies.constEnd(), - mem_fun(&QNetworkReply::isFinished)); + mem_fn(&QNetworkReply::isFinished)); if (finished_count == replies.size()) { QString cover_name = cover_names_.take(id); QList results; diff --git a/src/globalsearch/globalsearch.cpp b/src/globalsearch/globalsearch.cpp index cc7da18ec..c68753989 100644 --- a/src/globalsearch/globalsearch.cpp +++ b/src/globalsearch/globalsearch.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "core/application.h" #include "core/logging.h" @@ -371,7 +372,9 @@ QStringList GlobalSearch::GetSuggestions(int count) { } // Randomize the suggestions - std::random_shuffle(ret.begin(), ret.end()); + std::random_device rd; + std::mt19937 g(rd()); + std::shuffle(ret.begin(), ret.end(), g); // Only return the first count while (ret.length() > count) { diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 5bc16ba4c..984f97e4c 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) @@ -2077,6 +2078,8 @@ void Playlist::ReshuffleIndices() { if (current_virtual_index_ != -1) std::advance(begin, current_virtual_index_ + 1); + std::random_device rd; + switch (playlist_sequence_->shuffle_mode()) { case PlaylistSequence::Shuffle_Off: // Handled above. @@ -2084,7 +2087,7 @@ void Playlist::ReshuffleIndices() { case PlaylistSequence::Shuffle_All: case PlaylistSequence::Shuffle_InsideAlbum: - std::random_shuffle(begin, end); + std::shuffle(begin, end, std::mt19937(rd())); break; case PlaylistSequence::Shuffle_Albums: { @@ -2101,8 +2104,8 @@ void Playlist::ReshuffleIndices() { // Shuffle them QStringList shuffled_album_keys = album_key_set.values(); - std::random_shuffle(shuffled_album_keys.begin(), - shuffled_album_keys.end()); + std::shuffle(shuffled_album_keys.begin(), shuffled_album_keys.end(), + std::mt19937(rd())); // If the user is currently playing a song, force its album to be first // Or if the song was not playing but it was selected, force its album