Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try bumping to macOS 11 #7276

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,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/[email protected]
- name: git hackery
Expand Down Expand Up @@ -1020,7 +1019,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 ..
Expand All @@ -1030,6 +1028,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
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libprojectm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions 3rdparty/libprojectm/Renderer/Waveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@

#include "Waveform.hpp"
#include <algorithm>
#include <functional>
#include "BeatDetect.hpp"

using std::placeholders::_1;

typedef float floatPair[2];
typedef float floatTriple[3];
typedef float floatQuad[4];
Expand Down Expand Up @@ -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<float>(),mult));
std::transform(&value2[0],&value2[samples],&value2[0],std::bind2nd(std::multiplies<float>(),mult));
std::transform(&value1[0],&value1[samples],&value1[0],std::bind(std::multiplies<float>(),_1, mult));
std::transform(&value2[0],&value2[samples],&value2[0],std::bind(std::multiplies<float>(),_1,mult));

WaveformContext waveContext(samples, context.beatDetect);

Expand Down
6 changes: 4 additions & 2 deletions 3rdparty/libprojectm/omptl/omptl_algorithm_ser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <random>

namespace omptl
{
Expand Down Expand Up @@ -463,14 +464,15 @@ template <class RandomAccessIterator>
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 <class RandomAccessIterator, class RandomNumberGenerator>
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 <class ForwardIterator, class T>
Expand Down
5 changes: 0 additions & 5 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 14 additions & 3 deletions dist/macdeploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
'@@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',
Expand Down Expand Up @@ -88,10 +88,13 @@
]

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 = [
Expand All @@ -110,13 +113,15 @@
'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',
'/Developer/Applications/Qt/plugins',
]

GIO_MODULES_SEARCH_PATH = [
'/opt/homebrew/lib/gio/modules',
'/usr/local/lib/gio/modules',
'/target/lib/gio/modules',
]
Expand Down Expand Up @@ -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:])
Expand Down
5 changes: 5 additions & 0 deletions ext/clementine-tagreader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ext/libclementine-common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 17 additions & 4 deletions ext/libclementine-remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

16 changes: 12 additions & 4 deletions ext/libclementine-tagreader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/organiseformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "core/song.h"

class TranscoderPreset;
struct TranscoderPreset;

class OrganiseFormat {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/covers/musicbrainzcoverprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "core/closure.h"
#include "core/network.h"

using std::mem_fun;
using std::mem_fn;

namespace {

Expand Down Expand Up @@ -89,7 +89,7 @@ void MusicbrainzCoverProvider::ReleaseSearchFinished(QNetworkReply* reply,
void MusicbrainzCoverProvider::ImageCheckFinished(int id) {
QList<QNetworkReply*> 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<CoverSearchResult> results;
Expand Down
5 changes: 4 additions & 1 deletion src/globalsearch/globalsearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <QTimerEvent>
#include <QUrl>
#include <algorithm>
#include <random>

#include "core/application.h"
#include "core/logging.h"
Expand Down Expand Up @@ -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) {
Expand Down
9 changes: 6 additions & 3 deletions src/playlist/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <algorithm>
#include <functional>
#include <memory>
#include <random>
#include <unordered_map>

#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
Expand Down Expand Up @@ -2079,14 +2080,16 @@ 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.
break;

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: {
Expand All @@ -2103,8 +2106,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
Expand Down