Merge pull request #55 from atehxx/patch-1
Change Qt WebEngine resources path, addresses #57
This commit is contained in:
+54
-16
@@ -889,28 +889,42 @@ void deployPlugins(const AppDirInfo &appDirInfo, const QString &pluginSourcePath
|
|||||||
// especially since stuff that is supposed to come from resources actually
|
// especially since stuff that is supposed to come from resources actually
|
||||||
// seems to come in libexec in the upstream Qt binary distribution
|
// seems to come in libexec in the upstream Qt binary distribution
|
||||||
if (containsHowOften(deploymentInfo.deployedLibraries, "libQt5WebEngineCore")) {
|
if (containsHowOften(deploymentInfo.deployedLibraries, "libQt5WebEngineCore")) {
|
||||||
QDir().mkpath(appDirInfo.path + "/resources");
|
// Find directories with needed files:
|
||||||
QDir().mkpath(appDirInfo.path + "/libexec");
|
QString qtLibexecPath = qtToBeBundledInfo.value("QT_INSTALL_LIBEXECS");
|
||||||
sourcePath = pluginSourcePath + "/../libexec/QtWebEngineProcess";
|
QString qtDataPath = qtToBeBundledInfo.value("QT_INSTALL_DATA");
|
||||||
destinationPath = pluginDestinationPath + "/../libexec/QtWebEngineProcess";
|
QString qtTranslationsPath = qtToBeBundledInfo.value("QT_INSTALL_TRANSLATIONS");
|
||||||
|
// create destination directories:
|
||||||
|
QString dstLibexec = appDirInfo.path + "/libexec";
|
||||||
|
QString dstResources = appDirInfo.path + "/resources";
|
||||||
|
QString dstTranslations = appDirInfo.path + "/translations";
|
||||||
|
QDir().mkpath(dstLibexec);
|
||||||
|
QDir().mkpath(dstResources);
|
||||||
|
QDir().mkpath(dstTranslations);
|
||||||
|
// WebEngine executable:
|
||||||
|
sourcePath = QDir::cleanPath(qtLibexecPath + "/QtWebEngineProcess");
|
||||||
|
destinationPath = QDir::cleanPath(dstLibexec + "/QtWebEngineProcess");
|
||||||
copyFilePrintStatus(sourcePath, destinationPath);
|
copyFilePrintStatus(sourcePath, destinationPath);
|
||||||
sourcePath = pluginSourcePath + "/../libexec/qtwebengine_resources.pak";
|
// put qt.conf file next to browser process so it can also make use of our local Qt resources
|
||||||
destinationPath = pluginDestinationPath + "/../resources/qtwebengine_resources.pak";
|
createQtConfForQtWebEngineProcess(dstLibexec);
|
||||||
|
// Resources:
|
||||||
|
sourcePath = QDir::cleanPath(qtDataPath + "/resources/qtwebengine_resources.pak");
|
||||||
|
destinationPath = QDir::cleanPath(dstResources + "/qtwebengine_resources.pak");
|
||||||
copyFilePrintStatus(sourcePath, destinationPath);
|
copyFilePrintStatus(sourcePath, destinationPath);
|
||||||
sourcePath = pluginSourcePath + "/../libexec/qtwebengine_devtools_resources.pak";
|
sourcePath = QDir::cleanPath(qtDataPath + "/resources/qtwebengine_devtools_resources.pak");
|
||||||
destinationPath = pluginDestinationPath + "/../resources/qtwebengine_devtools_resources.pak";
|
destinationPath = QDir::cleanPath(dstResources + "/qtwebengine_devtools_resources.pak");
|
||||||
copyFilePrintStatus(sourcePath, destinationPath);
|
copyFilePrintStatus(sourcePath, destinationPath);
|
||||||
sourcePath = pluginSourcePath + "/../libexec/qtwebengine_resources_100p.pak";
|
sourcePath = QDir::cleanPath(qtDataPath + "/resources/qtwebengine_resources_100p.pak");
|
||||||
destinationPath = pluginDestinationPath + "/../resources/qtwebengine_resources_100p.pak";
|
destinationPath = QDir::cleanPath(dstResources + "/qtwebengine_resources_100p.pak");
|
||||||
copyFilePrintStatus(sourcePath, destinationPath);
|
copyFilePrintStatus(sourcePath, destinationPath);
|
||||||
sourcePath = pluginSourcePath + "/../libexec/qtwebengine_resources_200p.pak";
|
sourcePath = QDir::cleanPath(qtDataPath + "/resources/qtwebengine_resources_200p.pak");
|
||||||
destinationPath = pluginDestinationPath + "/../resources/qtwebengine_resources_200p.pak";
|
destinationPath = QDir::cleanPath(dstResources + "/qtwebengine_resources_200p.pak");
|
||||||
copyFilePrintStatus(sourcePath, destinationPath);
|
copyFilePrintStatus(sourcePath, destinationPath);
|
||||||
sourcePath = pluginSourcePath + "/../libexec/icudtl.dat";
|
sourcePath = QDir::cleanPath(qtDataPath + "/resources/icudtl.dat");
|
||||||
destinationPath = pluginDestinationPath + "/../resources/icudtl.dat";
|
destinationPath = QDir::cleanPath(dstResources + "/icudtl.dat");
|
||||||
copyFilePrintStatus(sourcePath, destinationPath);
|
copyFilePrintStatus(sourcePath, destinationPath);
|
||||||
sourcePath = pluginSourcePath + "/../libexec/qtwebengine_locales";
|
// Translations:
|
||||||
destinationPath = pluginDestinationPath + "/../resources/";
|
sourcePath = QDir::cleanPath(qtTranslationsPath + "/qtwebengine_locales");
|
||||||
|
destinationPath = QDir::cleanPath(dstTranslations + "/qtwebengine_locales");
|
||||||
recursiveCopy(sourcePath, destinationPath);
|
recursiveCopy(sourcePath, destinationPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -964,6 +978,30 @@ void createQtConf(const QString &appDirPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void createQtConfForQtWebEngineProcess(const QString &appDirPath)
|
||||||
|
{
|
||||||
|
QByteArray contents = "# Generated by linuxdeployqt\n"
|
||||||
|
"# https://github.com/probonopd/linuxdeployqt/\n"
|
||||||
|
"[Paths]\n"
|
||||||
|
"Prefix = ../\n";
|
||||||
|
QString filePath = appDirPath + "/";
|
||||||
|
QString fileName = filePath + "qt.conf";
|
||||||
|
|
||||||
|
QDir().mkpath(filePath);
|
||||||
|
|
||||||
|
QFile qtconf(fileName);
|
||||||
|
if (qtconf.exists() && !alwaysOwerwriteEnabled) {
|
||||||
|
LogWarning() << fileName << "already exists, will not overwrite.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qtconf.open(QIODevice::WriteOnly);
|
||||||
|
if (qtconf.write(contents) != -1) {
|
||||||
|
LogNormal() << "Created configuration file for Qt WebEngine process:" << fileName;
|
||||||
|
LogNormal() << "This file sets the prefix option to parent directory of browser process executable";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo)
|
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo)
|
||||||
{
|
{
|
||||||
AppDirInfo applicationBundle;
|
AppDirInfo applicationBundle;
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ QString copyLibrary(const LibraryInfo &library, const QString path);
|
|||||||
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables);
|
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables);
|
||||||
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useLoaderPath);
|
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useLoaderPath);
|
||||||
void createQtConf(const QString &appDirPath);
|
void createQtConf(const QString &appDirPath);
|
||||||
|
void createQtConfForQtWebEngineProcess(const QString &appDirPath);
|
||||||
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo);
|
void deployPlugins(const QString &appDirPath, DeploymentInfo deploymentInfo);
|
||||||
bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs);
|
bool deployQmlImports(const QString &appDirPath, DeploymentInfo deploymentInfo, QStringList &qmlDirs);
|
||||||
void changeIdentification(const QString &id, const QString &binaryPath);
|
void changeIdentification(const QString &id, const QString &binaryPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user