Skip to content
Snippets Groups Projects
Commit 3225f90c authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

misc: deploy and use ringtones on macOS

Gitlab: #1619
Change-Id: I7c19dfa4556f4f9dae827a1d0c967c9ebce7cc86
parent df3e76a1
No related branches found
No related tags found
No related merge requests found
...@@ -819,12 +819,20 @@ else() ...@@ -819,12 +819,20 @@ else()
"-framework Security" "-framework Security"
compression compression
resolv resolv
) )
set(APP_CONTAINER "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents")
# ringtones. Copy the entire directory to the app bundle.
# daemon/ringtones -> Jami.app/Contents/Resources/ringtones
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory
${DAEMON_DIR}/ringtones
${APP_CONTAINER}/Resources/ringtones
)
# translations # translations
if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND) if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
set(APP_CONTAINER
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents")
file(GLOB TS_FILES ${PROJECT_SOURCE_DIR}/translations/*.ts) file(GLOB TS_FILES ${PROJECT_SOURCE_DIR}/translations/*.ts)
# Generate lproj folders. # Generate lproj folders.
...@@ -864,7 +872,6 @@ else() ...@@ -864,7 +872,6 @@ else()
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE) XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE)
endif() endif()
if(DEPLOY) if(DEPLOY)
message("Qt deploying in dir " ${QML_SRC_DIR})
execute_process(COMMAND execute_process(COMMAND
"${CMAKE_PREFIX_PATH}/bin/macdeployqt" "${CMAKE_PREFIX_PATH}/bin/macdeployqt"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"
......
...@@ -24,11 +24,27 @@ ...@@ -24,11 +24,27 @@
#ifdef ENABLE_VIDEO #ifdef ENABLE_VIDEO
#include "videomanager.h" #include "videomanager.h"
#endif // ENABLE_VIDEO #endif // ENABLE_VIDEO
#include <QDir>
static int ringFlags = 0; static int ringFlags = 0;
InstanceManagerInterface::InstanceManagerInterface(bool muteDaemon) InstanceManagerInterface::InstanceManagerInterface(bool muteDaemon)
{ {
// The following code is used to set the resource directory for libjami, and is required
// for the ringtones to work properly on platforms where the resource directory path is not
// fixed (e.g. macOS).
#if defined(Q_OS_WIN)
// On Windows, the resource directory is set to the application's directory.
libjami::setResourceDirPath(QCoreApplication::applicationDirPath().toStdString());
#elif defined(Q_OS_MAC)
// On macOS, the resource directory is set to the application bundle's path + "/Resources".
// The application bundle's path is the application's directory.
QDir execDir(qApp->applicationDirPath()); // executable directory points to the app bundle + /Contents/MacOS/
execDir.cdUp(); // navigate up to add resources to /Contents
auto resourceDir = execDir.absolutePath() + QDir::separator() + "Resources";
libjami::setResourceDirPath(resourceDir.toStdString());
#endif
using namespace std::placeholders; using namespace std::placeholders;
using std::bind; using std::bind;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment