mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-05 03:47:51 +01:00
Use system macdeployqt
This commit is contained in:
parent
0bc29f0563
commit
878148ac32
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@ -974,10 +974,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 11.0
|
MACOSX_DEPLOYMENT_TARGET: 11.0
|
||||||
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
|
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
|
||||||
GIO_EXTRA_MODULES: /usr/local/lib/gio/modules
|
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON -DBUILD_WERROR=OFF -DUSE_BUNDLE=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/lib/cmake -DICU_ROOT=/usr/local/opt/icu4c -DPROTOBUF_INCLUDE_DIRS=/usr/local/include
|
||||||
GST_PLUGIN_SCANNER: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
|
|
||||||
GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0
|
|
||||||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON -DBUILD_WERROR=OFF -DUSE_BUNDLE=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/lib/cmake -DICU_ROOT=/usr/local/opt/icu4c -DENABLE_DBUS=OFF -DPROTOBUF_INCLUDE_DIRS=/usr/local/include
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build --config Release --parallel 4
|
run: cmake --build build --config Release --parallel 4
|
||||||
@ -998,6 +995,10 @@ jobs:
|
|||||||
cp /usr/local/lib/{libsoup-3.0.0.dylib,libswresample.4.dylib,libswscale.7.dylib,libpostproc.57.dylib} strawberry.app/Contents/Frameworks/
|
cp /usr/local/lib/{libsoup-3.0.0.dylib,libswresample.4.dylib,libswscale.7.dylib,libpostproc.57.dylib} strawberry.app/Contents/Frameworks/
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
env:
|
||||||
|
GIO_EXTRA_MODULES: /usr/local/lib/gio/modules
|
||||||
|
GST_PLUGIN_SCANNER: /usr/local/opt/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
|
||||||
|
GST_PLUGIN_PATH: /usr/local/lib/gstreamer-1.0
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: make deploy
|
run: make deploy
|
||||||
|
|
||||||
@ -1074,9 +1075,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 11.0
|
MACOSX_DEPLOYMENT_TARGET: 11.0
|
||||||
PKG_CONFIG_PATH: /opt/local/lib/pkgconfig
|
PKG_CONFIG_PATH: /opt/local/lib/pkgconfig
|
||||||
GIO_EXTRA_MODULES: /opt/local/lib/gio/modules
|
|
||||||
GST_PLUGIN_SCANNER: /opt/local/libexec/gstreamer-1.0/gst-plugin-scanner
|
|
||||||
GST_PLUGIN_PATH: /opt/local/lib/gstreamer-1.0
|
|
||||||
run: /opt/local/libexec/qt6/bin/qt-cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON -DBUILD_WERROR=OFF -DUSE_BUNDLE=ON -DENABLE_DBUS=OFF
|
run: /opt/local/libexec/qt6/bin/qt-cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON -DBUILD_WERROR=OFF -DUSE_BUNDLE=ON -DENABLE_DBUS=OFF
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@ -1087,6 +1085,10 @@ jobs:
|
|||||||
run: make install
|
run: make install
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
env:
|
||||||
|
GIO_EXTRA_MODULES: /opt/local/lib/gio/modules
|
||||||
|
GST_PLUGIN_SCANNER: /opt/local/libexec/gstreamer-1.0/gst-plugin-scanner
|
||||||
|
GST_PLUGIN_PATH: /opt/local/lib/gstreamer-1.0
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: make deploy
|
run: make deploy
|
||||||
|
|
||||||
|
7
3rdparty/README.md
vendored
7
3rdparty/README.md
vendored
@ -16,13 +16,6 @@ Used on macOS to exclusively enable strawberry to grab global media shortcuts.
|
|||||||
Can safely be deleted on other platforms.
|
Can safely be deleted on other platforms.
|
||||||
|
|
||||||
|
|
||||||
macdeployqt
|
|
||||||
-----------
|
|
||||||
A modified version of Qt's official macdeployqt utility that fixes some issues,
|
|
||||||
this version also deploys gstreamer plugins.
|
|
||||||
Can safely be deleted on other platforms.
|
|
||||||
|
|
||||||
|
|
||||||
getopt
|
getopt
|
||||||
------
|
------
|
||||||
getopt included only when compiling on Windows.
|
getopt included only when compiling on Windows.
|
||||||
|
7
3rdparty/macdeployqt/CMakeLists.txt
vendored
7
3rdparty/macdeployqt/CMakeLists.txt
vendored
@ -1,7 +0,0 @@
|
|||||||
add_executable(macdeployqt main.cpp shared.cpp)
|
|
||||||
target_link_libraries(macdeployqt PRIVATE
|
|
||||||
"-framework AppKit"
|
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
|
||||||
)
|
|
||||||
|
|
||||||
#execute_process(COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/macdeployqt ${CMAKE_BINARY_DIR})
|
|
286
3rdparty/macdeployqt/main.cpp
vendored
286
3rdparty/macdeployqt/main.cpp
vendored
@ -1,286 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the tools applications of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#undef QT_NO_DEBUG_OUTPUT
|
|
||||||
#undef QT_NO_WARNING_OUTPUT
|
|
||||||
#undef QT_NO_INFO_OUTPUT
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QLibraryInfo>
|
|
||||||
|
|
||||||
#include "shared.h"
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
QCoreApplication app(argc, argv);
|
|
||||||
|
|
||||||
QString appBundlePath;
|
|
||||||
if (argc > 1)
|
|
||||||
appBundlePath = QString::fromLocal8Bit(argv[1]);
|
|
||||||
|
|
||||||
if (argc < 2 || appBundlePath.startsWith("-")) {
|
|
||||||
qDebug() << "Usage: macdeployqt app-bundle [options]";
|
|
||||||
qDebug() << "";
|
|
||||||
qDebug() << "Options:";
|
|
||||||
qDebug() << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug";
|
|
||||||
qDebug() << " -no-plugins : Skip plugin deployment";
|
|
||||||
qDebug() << " -dmg : Create a .dmg disk image";
|
|
||||||
qDebug() << " -no-strip : Don't run 'strip' on the binaries";
|
|
||||||
qDebug() << " -use-debug-libs : Deploy with debug versions of frameworks and plugins (implies -no-strip)";
|
|
||||||
qDebug() << " -executable=<path> : Let the given executable use the deployed frameworks too";
|
|
||||||
qDebug() << " -qmldir=<path> : Scan for QML imports in the given path";
|
|
||||||
qDebug() << " -qmlimport=<path> : Add the given path to the QML module search locations";
|
|
||||||
qDebug() << " -always-overwrite : Copy files even if the target file exists";
|
|
||||||
qDebug() << " -codesign=<ident> : Run codesign with the given identity on all executables";
|
|
||||||
qDebug() << " -hardened-runtime : Enable Hardened Runtime when code signing";
|
|
||||||
qDebug() << " -timestamp : Include a secure timestamp when code signing (requires internet connection)";
|
|
||||||
qDebug() << " -sign-for-notarization=<ident>: Activate the necessary options for notarization (requires internet connection)";
|
|
||||||
qDebug() << " -appstore-compliant : Skip deployment of components that use private API";
|
|
||||||
qDebug() << " -libpath=<path> : Add the given path to the library search path";
|
|
||||||
qDebug() << " -fs=<filesystem> : Set the filesystem used for the .dmg disk image (defaults to HFS+)";
|
|
||||||
qDebug() << "";
|
|
||||||
qDebug() << "macdeployqt takes an application bundle as input and makes it";
|
|
||||||
qDebug() << "self-contained by copying in the Qt frameworks and plugins that";
|
|
||||||
qDebug() << "the application uses.";
|
|
||||||
qDebug() << "";
|
|
||||||
qDebug() << "Plugins related to a framework are copied in with the";
|
|
||||||
qDebug() << "framework. The accessibility, image formats, and text codec";
|
|
||||||
qDebug() << "plugins are always copied, unless \"-no-plugins\" is specified.";
|
|
||||||
qDebug() << "";
|
|
||||||
qDebug() << "Qt plugins may use private API and will cause the app to be";
|
|
||||||
qDebug() << "rejected from the Mac App store. MacDeployQt will print a warning";
|
|
||||||
qDebug() << "when known incompatible plugins are deployed. Use -appstore-compliant ";
|
|
||||||
qDebug() << "to skip these plugins. Currently two SQL plugins are known to";
|
|
||||||
qDebug() << "be incompatible: qsqlodbc and qsqlpsql.";
|
|
||||||
qDebug() << "";
|
|
||||||
qDebug() << "See the \"Deploying Applications on OS X\" topic in the";
|
|
||||||
qDebug() << "documentation for more information about deployment on OS X.";
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
appBundlePath = QDir::cleanPath(appBundlePath);
|
|
||||||
|
|
||||||
if (!QDir(appBundlePath).exists()) {
|
|
||||||
qDebug() << "Error: Could not find app bundle" << appBundlePath;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool plugins = true;
|
|
||||||
bool dmg = false;
|
|
||||||
QByteArray filesystem("HFS+");
|
|
||||||
bool useDebugLibs = false;
|
|
||||||
extern bool runStripEnabled;
|
|
||||||
extern bool alwaysOwerwriteEnabled;
|
|
||||||
extern QStringList librarySearchPath;
|
|
||||||
QStringList additionalExecutables;
|
|
||||||
bool qmldirArgumentUsed = false;
|
|
||||||
QStringList qmlDirs;
|
|
||||||
QStringList qmlImportPaths;
|
|
||||||
extern bool runCodesign;
|
|
||||||
extern QString codesignIdentiy;
|
|
||||||
extern bool hardenedRuntime;
|
|
||||||
extern bool appstoreCompliant;
|
|
||||||
extern bool deployFramework;
|
|
||||||
extern bool secureTimestamp;
|
|
||||||
|
|
||||||
for (int i = 2; i < argc; ++i) {
|
|
||||||
QByteArray argument = QByteArray(argv[i]);
|
|
||||||
if (argument == QByteArray("-no-plugins")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
plugins = false;
|
|
||||||
} else if (argument == QByteArray("-dmg")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
dmg = true;
|
|
||||||
} else if (argument == QByteArray("-no-strip")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
runStripEnabled = false;
|
|
||||||
} else if (argument == QByteArray("-use-debug-libs")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
useDebugLibs = true;
|
|
||||||
runStripEnabled = false;
|
|
||||||
} else if (argument.startsWith(QByteArray("-verbose"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf("=");
|
|
||||||
bool ok = false;
|
|
||||||
int number = argument.mid(index+1).toInt(&ok);
|
|
||||||
if (!ok)
|
|
||||||
LogError() << "Could not parse verbose level";
|
|
||||||
else
|
|
||||||
logLevel = number;
|
|
||||||
} else if (argument.startsWith(QByteArray("-executable"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf('=');
|
|
||||||
if (index == -1)
|
|
||||||
LogError() << "Missing executable path";
|
|
||||||
else
|
|
||||||
additionalExecutables << argument.mid(index+1);
|
|
||||||
} else if (argument.startsWith(QByteArray("-qmldir"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
qmldirArgumentUsed = true;
|
|
||||||
int index = argument.indexOf('=');
|
|
||||||
if (index == -1)
|
|
||||||
LogError() << "Missing qml directory path";
|
|
||||||
else
|
|
||||||
qmlDirs << argument.mid(index+1);
|
|
||||||
} else if (argument.startsWith(QByteArray("-qmlimport"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf('=');
|
|
||||||
if (index == -1)
|
|
||||||
LogError() << "Missing qml import path";
|
|
||||||
else
|
|
||||||
qmlImportPaths << argument.mid(index+1);
|
|
||||||
} else if (argument.startsWith(QByteArray("-libpath"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf('=');
|
|
||||||
if (index == -1)
|
|
||||||
LogError() << "Missing library search path";
|
|
||||||
else
|
|
||||||
librarySearchPath << argument.mid(index+1);
|
|
||||||
} else if (argument == QByteArray("-always-overwrite")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
alwaysOwerwriteEnabled = true;
|
|
||||||
} else if (argument.startsWith(QByteArray("-codesign"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf("=");
|
|
||||||
if (index < 0 || index >= argument.size()) {
|
|
||||||
LogError() << "Missing code signing identity";
|
|
||||||
} else {
|
|
||||||
runCodesign = true;
|
|
||||||
codesignIdentiy = argument.mid(index+1);
|
|
||||||
}
|
|
||||||
} else if (argument.startsWith(QByteArray("-sign-for-notarization"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf("=");
|
|
||||||
if (index < 0 || index >= argument.size()) {
|
|
||||||
LogError() << "Missing code signing identity";
|
|
||||||
} else {
|
|
||||||
runCodesign = true;
|
|
||||||
hardenedRuntime = true;
|
|
||||||
secureTimestamp = true;
|
|
||||||
codesignIdentiy = argument.mid(index+1);
|
|
||||||
}
|
|
||||||
} else if (argument.startsWith(QByteArray("-hardened-runtime"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
hardenedRuntime = true;
|
|
||||||
} else if (argument.startsWith(QByteArray("-timestamp"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
secureTimestamp = true;
|
|
||||||
} else if (argument == QByteArray("-appstore-compliant")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
appstoreCompliant = true;
|
|
||||||
|
|
||||||
// Undocumented option, may not work as intended
|
|
||||||
} else if (argument == QByteArray("-deploy-framework")) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
deployFramework = true;
|
|
||||||
|
|
||||||
} else if (argument.startsWith(QByteArray("-fs"))) {
|
|
||||||
LogDebug() << "Argument found:" << argument;
|
|
||||||
int index = argument.indexOf('=');
|
|
||||||
if (index == -1)
|
|
||||||
LogError() << "Missing filesystem type";
|
|
||||||
else
|
|
||||||
filesystem = argument.mid(index+1);
|
|
||||||
} else if (argument.startsWith("-")) {
|
|
||||||
LogError() << "Unknown argument" << argument << "\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DeploymentInfo deploymentInfo = deployQtFrameworks(appBundlePath, additionalExecutables, useDebugLibs);
|
|
||||||
|
|
||||||
if (deploymentInfo.isDebug)
|
|
||||||
useDebugLibs = true;
|
|
||||||
|
|
||||||
if (deployFramework && deploymentInfo.isFramework)
|
|
||||||
fixupFramework(appBundlePath);
|
|
||||||
|
|
||||||
// Convenience: Look for .qml files in the current directory if no -qmldir specified.
|
|
||||||
if (qmlDirs.isEmpty()) {
|
|
||||||
QDir dir;
|
|
||||||
if (!dir.entryList(QStringList() << QStringLiteral("*.qml")).isEmpty()) {
|
|
||||||
qmlDirs += QStringLiteral(".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!qmlDirs.isEmpty()) {
|
|
||||||
bool ok = deployQmlImports(appBundlePath, deploymentInfo, qmlDirs, qmlImportPaths);
|
|
||||||
if (!ok && qmldirArgumentUsed)
|
|
||||||
return 1; // exit if the user explicitly asked for qml import deployment
|
|
||||||
|
|
||||||
// Update deploymentInfo.deployedFrameworks - the QML imports
|
|
||||||
// may have brought in extra frameworks as dependencies.
|
|
||||||
deploymentInfo.deployedFrameworks += findAppFrameworkNames(appBundlePath);
|
|
||||||
deploymentInfo.deployedFrameworks =
|
|
||||||
QSet<QString>(deploymentInfo.deployedFrameworks.begin(),
|
|
||||||
deploymentInfo.deployedFrameworks.end()).values();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle plugins
|
|
||||||
if (plugins) {
|
|
||||||
// Set the plugins search directory
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
deploymentInfo.pluginPath = QLibraryInfo::path(QLibraryInfo::PluginsPath);
|
|
||||||
#else
|
|
||||||
deploymentInfo.pluginPath = QLibraryInfo::location(QLibraryInfo::PluginsPath);
|
|
||||||
#endif
|
|
||||||
// Sanity checks
|
|
||||||
if (deploymentInfo.pluginPath.isEmpty()) {
|
|
||||||
LogError() << "Missing Qt plugins path\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!QDir(deploymentInfo.pluginPath).exists()) {
|
|
||||||
LogError() << "Plugins path does not exist" << deploymentInfo.pluginPath << "\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deploy plugins
|
|
||||||
Q_ASSERT(!deploymentInfo.pluginPath.isEmpty());
|
|
||||||
if (!deploymentInfo.pluginPath.isEmpty()) {
|
|
||||||
LogNormal();
|
|
||||||
deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
|
|
||||||
createQtConf(appBundlePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (runStripEnabled)
|
|
||||||
stripAppBinary(appBundlePath);
|
|
||||||
|
|
||||||
if (runCodesign)
|
|
||||||
codesign(codesignIdentiy, appBundlePath);
|
|
||||||
|
|
||||||
if (dmg) {
|
|
||||||
LogNormal();
|
|
||||||
createDiskImage(appBundlePath, filesystem);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
1802
3rdparty/macdeployqt/shared.cpp
vendored
1802
3rdparty/macdeployqt/shared.cpp
vendored
File diff suppressed because it is too large
Load Diff
141
3rdparty/macdeployqt/shared.h
vendored
141
3rdparty/macdeployqt/shared.h
vendored
@ -1,141 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the tools applications of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
#ifndef MAC_DEPLOMYMENT_SHARED_H
|
|
||||||
#define MAC_DEPLOMYMENT_SHARED_H
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QSet>
|
|
||||||
#include <QVersionNumber>
|
|
||||||
|
|
||||||
extern int logLevel;
|
|
||||||
#define LogError() if (logLevel < 0) {} else qDebug() << "ERROR:"
|
|
||||||
#define LogWarning() if (logLevel < 1) {} else qDebug() << "WARNING:"
|
|
||||||
#define LogNormal() if (logLevel < 2) {} else qDebug() << "Log:"
|
|
||||||
#define LogDebug() if (logLevel < 3) {} else qDebug() << "Log:"
|
|
||||||
|
|
||||||
extern bool runStripEnabled;
|
|
||||||
|
|
||||||
class FrameworkInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
bool isDylib;
|
|
||||||
QString frameworkDirectory;
|
|
||||||
QString frameworkName;
|
|
||||||
QString frameworkPath;
|
|
||||||
QString binaryDirectory;
|
|
||||||
QString binaryName;
|
|
||||||
QString binaryPath;
|
|
||||||
QString rpathUsed;
|
|
||||||
QString version;
|
|
||||||
QString installName;
|
|
||||||
QString deployedInstallName;
|
|
||||||
QString sourceFilePath;
|
|
||||||
QString frameworkDestinationDirectory;
|
|
||||||
QString binaryDestinationDirectory;
|
|
||||||
|
|
||||||
bool isDebugLibrary() const
|
|
||||||
{
|
|
||||||
return binaryName.endsWith(QStringLiteral("_debug"));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class DylibInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QString binaryPath;
|
|
||||||
QVersionNumber currentVersion;
|
|
||||||
QVersionNumber compatibilityVersion;
|
|
||||||
};
|
|
||||||
|
|
||||||
class OtoolInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QString installName;
|
|
||||||
QString binaryPath;
|
|
||||||
QVersionNumber currentVersion;
|
|
||||||
QVersionNumber compatibilityVersion;
|
|
||||||
QList<DylibInfo> dependencies;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool operator==(const FrameworkInfo &a, const FrameworkInfo &b);
|
|
||||||
QDebug operator<<(QDebug debug, const FrameworkInfo &info);
|
|
||||||
|
|
||||||
class ApplicationBundleInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QString path;
|
|
||||||
QString binaryPath;
|
|
||||||
QStringList libraryPaths;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DeploymentInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QString qtPath;
|
|
||||||
QString pluginPath;
|
|
||||||
QStringList deployedFrameworks;
|
|
||||||
QList<QString> rpathsUsed;
|
|
||||||
bool useLoaderPath;
|
|
||||||
bool isFramework;
|
|
||||||
bool isDebug;
|
|
||||||
|
|
||||||
bool containsModule(const QString &module, const QString &libInFix) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info);
|
|
||||||
|
|
||||||
OtoolInfo findDependencyInfo(const QString &binaryPath);
|
|
||||||
FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundlePath, const QList<QString> &rpaths, bool useDebugLibs);
|
|
||||||
QString findAppBinary(const QString &appBundlePath);
|
|
||||||
QList<FrameworkInfo> getQtFrameworks(const QString &path, const QString &appBundlePath, const QList<QString> &rpaths, bool useDebugLibs);
|
|
||||||
QList<FrameworkInfo> getQtFrameworks(const QStringList &otoolLines, const QString &appBundlePath, const QList<QString> &rpaths, bool useDebugLibs);
|
|
||||||
QString copyFramework(const FrameworkInfo &framework, const QString path);
|
|
||||||
DeploymentInfo deployQtFrameworks(const QString &appBundlePath, const QStringList &additionalExecutables, bool useDebugLibs);
|
|
||||||
DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks,const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath);
|
|
||||||
void createQtConf(const QString &appBundlePath);
|
|
||||||
void deployPlugins(const QString &appBundlePath, DeploymentInfo deploymentInfo, bool useDebugLibs);
|
|
||||||
bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs, QStringList &qmlImportPaths);
|
|
||||||
void changeIdentification(const QString &id, const QString &binaryPath);
|
|
||||||
void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath);
|
|
||||||
void runStrip(const QString &binaryPath);
|
|
||||||
void stripAppBinary(const QString &bundlePath);
|
|
||||||
QString findAppBinary(const QString &appBundlePath);
|
|
||||||
QStringList findAppFrameworkNames(const QString &appBundlePath);
|
|
||||||
QStringList findAppFrameworkPaths(const QString &appBundlePath);
|
|
||||||
void codesignFile(const QString &identity, const QString &filePath);
|
|
||||||
QSet<QString> codesignBundle(const QString &identity,
|
|
||||||
const QString &appBundlePath,
|
|
||||||
QList<QString> additionalBinariesContainingRpaths);
|
|
||||||
void codesign(const QString &identity, const QString &appBundlePath);
|
|
||||||
void createDiskImage(const QString &appBundlePath, const QString &filesystemType);
|
|
||||||
void fixupFramework(const QString &appBundlePath);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -309,7 +309,6 @@ if(APPLE)
|
|||||||
add_subdirectory(3rdparty/SPMediaKeyTap)
|
add_subdirectory(3rdparty/SPMediaKeyTap)
|
||||||
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
||||||
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
||||||
add_subdirectory(3rdparty/macdeployqt)
|
|
||||||
add_subdirectory(ext/macdeploycheck)
|
add_subdirectory(ext/macdeploycheck)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -407,7 +406,7 @@ optional_component(GIO ON "Devices: GIO device backend"
|
|||||||
|
|
||||||
optional_component(GIO_UNIX ON "Devices: GIO device backend (Unix support)"
|
optional_component(GIO_UNIX ON "Devices: GIO device backend (Unix support)"
|
||||||
DEPENDS "libgio-unix" GIO_UNIX_FOUND
|
DEPENDS "libgio-unix" GIO_UNIX_FOUND
|
||||||
DEPENDS "Unix" "UNIX"
|
DEPENDS "Unix or Windows" "NOT APPLE"
|
||||||
)
|
)
|
||||||
|
|
||||||
optional_component(LIBGPOD ON "Devices: iPod classic support"
|
optional_component(LIBGPOD ON "Devices: iPod classic support"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#find_program(MACDEPLOYQT_EXECUTABLE NAMES macdeployqt PATHS /usr/local/opt/qt6/bin /usr/local/opt/qt5/bin /usr/local/bin REQUIRED)
|
find_program(MACDEPLOYQT_EXECUTABLE NAMES macdeployqt PATHS /usr/bin /usr/local/bin /opt/local/bin /usr/local/opt/qt6/bin /usr/local/opt/qt5/bin REQUIRED)
|
||||||
set(MACDEPLOYQT_EXECUTABLE "${CMAKE_BINARY_DIR}/3rdparty/macdeployqt/macdeployqt")
|
|
||||||
if(MACDEPLOYQT_EXECUTABLE)
|
if(MACDEPLOYQT_EXECUTABLE)
|
||||||
message(STATUS "Found macdeployqt: ${MACDEPLOYQT_EXECUTABLE}")
|
message(STATUS "Found macdeployqt: ${MACDEPLOYQT_EXECUTABLE}")
|
||||||
else()
|
else()
|
||||||
@ -14,16 +13,14 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MACDEPLOYQT_EXECUTABLE)
|
if(MACDEPLOYQT_EXECUTABLE)
|
||||||
add_custom_target(copy_gstreamer_plugins
|
|
||||||
#COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macgstcopy.sh strawberry.app
|
|
||||||
)
|
|
||||||
add_custom_target(deploy
|
add_custom_target(deploy
|
||||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/strawberry.app/Contents/{Frameworks,Resources}
|
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/strawberry.app/Contents/{Frameworks,Resources}
|
||||||
COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/Info.plist ${CMAKE_BINARY_DIR}/strawberry.app/Contents/
|
COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/Info.plist ${CMAKE_BINARY_DIR}/strawberry.app/Contents/
|
||||||
COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/strawberry.icns ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Resources/
|
COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/strawberry.icns ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Resources/
|
||||||
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -verbose=3 -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader
|
COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macgstcopy.sh ${CMAKE_BINARY_DIR}/strawberry.app
|
||||||
|
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -verbose=3 -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/gst-plugin-scanner -executable=strawberry.app/Contents/PlugIns/gio-modules/libgioopenssl.so -executable=strawberry.app/Contents/PlugIns/gio-modules/libgiognutls.so
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
DEPENDS strawberry strawberry-tagreader copy_gstreamer_plugins macdeployqt
|
DEPENDS strawberry strawberry-tagreader
|
||||||
)
|
)
|
||||||
add_custom_target(deploycheck
|
add_custom_target(deploycheck
|
||||||
COMMAND ${CMAKE_BINARY_DIR}/ext/macdeploycheck/macdeploycheck strawberry.app
|
COMMAND ${CMAKE_BINARY_DIR}/ext/macdeploycheck/macdeploycheck strawberry.app
|
||||||
|
52
dist/macos/macgstcopy.sh
vendored
52
dist/macos/macgstcopy.sh
vendored
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Script to copy gstreamer plugins before macdeployqt is run.
|
# Script to copy gio modules and gstreamer plugins before macdeployqt is run.
|
||||||
|
|
||||||
if [ "$1" = "" ]; then
|
if [ "$1" = "" ]; then
|
||||||
echo "Usage: $0 <bundledir>"
|
echo "Usage: $0 <bundledir>"
|
||||||
@ -8,17 +8,17 @@ if [ "$1" = "" ]; then
|
|||||||
fi
|
fi
|
||||||
bundledir=$1
|
bundledir=$1
|
||||||
|
|
||||||
if [ "$GIO_EXTRA_MODULES" = "" ]; then
|
if [ "${GIO_EXTRA_MODULES}" = "" ]; then
|
||||||
echo "Error: Set the GIO_EXTRA_MODULES environment variable to the path containing libgiognutls.so."
|
echo "Error: Set the GIO_EXTRA_MODULES environment variable to the path containing gio modules."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$GST_PLUGIN_SCANNER" = "" ]; then
|
if [ "${GST_PLUGIN_SCANNER}" = "" ]; then
|
||||||
echo "Error: Set the GST_PLUGIN_SCANNER environment variable to the gst-plugin-scanner."
|
echo "Error: Set the GST_PLUGIN_SCANNER environment variable to the gst-plugin-scanner."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$GST_PLUGIN_PATH" = "" ]; then
|
if [ "${GST_PLUGIN_PATH}" = "" ]; then
|
||||||
echo "Error: Set the GST_PLUGIN_PATH environment variable to the path containing gstreamer plugins."
|
echo "Error: Set the GST_PLUGIN_PATH environment variable to the path containing gstreamer plugins."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -26,18 +26,29 @@ fi
|
|||||||
mkdir -p "${bundledir}/Contents/PlugIns/gio-modules" || exit 1
|
mkdir -p "${bundledir}/Contents/PlugIns/gio-modules" || exit 1
|
||||||
mkdir -p "${bundledir}/Contents/PlugIns/gstreamer" || exit 1
|
mkdir -p "${bundledir}/Contents/PlugIns/gstreamer" || exit 1
|
||||||
|
|
||||||
if ! [ -f "${GIO_EXTRA_MODULES}/libgiognutls.so" ]; then
|
if [ -e "${GIO_EXTRA_MODULES}/libgiognutls.so" ]; then
|
||||||
echo "Error: Missing ${GIO_EXTRA_MODULES}/libgiognutls.so."
|
cp -v -f "${GIO_EXTRA_MODULES}/libgiognutls.so" "${bundledir}/Contents/PlugIns/gio-modules/" || exit 1
|
||||||
exit 1
|
else
|
||||||
|
echo "Warning: Missing ${GIO_EXTRA_MODULES}/libgiognutls.so."
|
||||||
fi
|
fi
|
||||||
cp -v -f "${GIO_EXTRA_MODULES}/libgiognutls.so" "${bundledir}/Contents/PlugIns/gio-modules/" || exit 1
|
|
||||||
|
|
||||||
if ! [ -f "${GST_PLUGIN_SCANNER}" ]; then
|
if [ -e "${GIO_EXTRA_MODULES}/libgioopenssl.so" ]; then
|
||||||
|
cp -v -f "${GIO_EXTRA_MODULES}/libgioopenssl.so" "${bundledir}/Contents/PlugIns/gio-modules/" || exit 1
|
||||||
|
else
|
||||||
|
echo "Warning: Missing ${GIO_EXTRA_MODULES}/libgioopenssl.so"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -e "${GST_PLUGIN_SCANNER}" ]; then
|
||||||
echo "Error: Missing ${GST_PLUGIN_SCANNER}"
|
echo "Error: Missing ${GST_PLUGIN_SCANNER}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cp -v -f "${GST_PLUGIN_SCANNER}" "${bundledir}/Contents/PlugIns/" || exit 1
|
cp -v -f "${GST_PLUGIN_SCANNER}" "${bundledir}/Contents/PlugIns/" || exit 1
|
||||||
|
|
||||||
|
if ! [ -d "${GST_PLUGIN_PATH}" ]; then
|
||||||
|
echo "Error: GStreamer plugins path ${GST_PLUGIN_PATH} does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
gst_plugins="
|
gst_plugins="
|
||||||
libgstaes.dylib
|
libgstaes.dylib
|
||||||
libgstaiff.dylib
|
libgstaiff.dylib
|
||||||
@ -58,13 +69,15 @@ libgstcdio.dylib
|
|||||||
libgstcoreelements.dylib
|
libgstcoreelements.dylib
|
||||||
libgstdash.dylib
|
libgstdash.dylib
|
||||||
libgstequalizer.dylib
|
libgstequalizer.dylib
|
||||||
libgstflac.dylib
|
|
||||||
libgstfaac.dylib
|
libgstfaac.dylib
|
||||||
libgstfaad.dylib
|
libgstfaad.dylib
|
||||||
libgstfdkaac.dylib
|
libgstfdkaac.dylib
|
||||||
|
libgstflac.dylib
|
||||||
libgstgio.dylib
|
libgstgio.dylib
|
||||||
|
libgsthls.dylib
|
||||||
libgsticydemux.dylib
|
libgsticydemux.dylib
|
||||||
libgstid3demux.dylib
|
libgstid3demux.dylib
|
||||||
|
libgstid3tag.dylib
|
||||||
libgstisomp4.dylib
|
libgstisomp4.dylib
|
||||||
libgstlame.dylib
|
libgstlame.dylib
|
||||||
libgstlibav.dylib
|
libgstlibav.dylib
|
||||||
@ -85,27 +98,22 @@ libgstspectrum.dylib
|
|||||||
libgstspeex.dylib
|
libgstspeex.dylib
|
||||||
libgsttaglib.dylib
|
libgsttaglib.dylib
|
||||||
libgsttcp.dylib
|
libgsttcp.dylib
|
||||||
|
libgsttwolame.dylib
|
||||||
libgsttypefindfunctions.dylib
|
libgsttypefindfunctions.dylib
|
||||||
libgstudp.dylib
|
libgstudp.dylib
|
||||||
libgstvolume.dylib
|
libgstvolume.dylib
|
||||||
libgstvorbis.dylib
|
libgstvorbis.dylib
|
||||||
|
libgstwavenc.dylib
|
||||||
libgstwavpack.dylib
|
libgstwavpack.dylib
|
||||||
libgstwavparse.dylib
|
libgstwavparse.dylib
|
||||||
libgstxingmux.dylib;
|
libgstxingmux.dylib
|
||||||
"
|
"
|
||||||
|
|
||||||
gst_plugins=$(echo "$gst_plugins" | tr '\n' ' ' | sed -e 's/^ //g' | sed -e 's/ / /g')
|
gst_plugins=$(echo "$gst_plugins" | tr '\n' ' ' | sed -e 's/^ //g' | sed -e 's/ / /g')
|
||||||
|
for gst_plugin in $gst_plugins; do
|
||||||
for gst_plugin in $gst_plugins
|
if [ -e "${GST_PLUGIN_PATH}/${gst_plugin}" ]; then
|
||||||
do
|
|
||||||
if [ -f "${GST_PLUGIN_PATH}/${gst_plugin}" ]; then
|
|
||||||
cp -v -f "${GST_PLUGIN_PATH}/${gst_plugin}" "${bundledir}/Contents/PlugIns/gstreamer/" || exit 1
|
cp -v -f "${GST_PLUGIN_PATH}/${gst_plugin}" "${bundledir}/Contents/PlugIns/gstreamer/" || exit 1
|
||||||
else
|
else
|
||||||
echo "Warning: Missing gstreamer plugin ${GST_PLUGIN_PATH}/${gst_plugin}"
|
echo "Warning: Missing gstreamer plugin ${gst_plugin}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f "/usr/local/lib/libbrotlicommon.1.dylib" ]; then
|
|
||||||
mkdir -p ${bundledir}/Contents/Frameworks
|
|
||||||
cp -v -f "/usr/local/lib/libbrotlicommon.1.dylib" "${bundledir}/Contents/Frameworks/"
|
|
||||||
fi
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user