forked from probonopd/linuxdeployqt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared.h
128 lines (116 loc) · 4.31 KB
/
shared.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#pragma once
#include <QDebug>
#include <QSet>
#include <QString>
#include <QStringList>
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() << "INFO:"
#define LogDebug() if (logLevel < 3) {} else qDebug() << "DEBUG:"
extern QString appBinaryPath;
extern bool runStripEnabled;
extern bool bundleAllButBlacklistedLibs;
extern bool bundleEverything;
extern bool fhsLikeMode;
extern QString fhsPrefix;
extern QStringList extraQtPlugins;
extern QStringList excludedLibraries;
class LibraryInfo
{
public:
bool isDylib;
QString libraryDirectory;
QString libraryName;
QString libraryPath;
QString binaryDirectory;
QString binaryName;
QString binaryPath;
QString rpathUsed;
QString version;
QString installName;
QString deployedInstallName;
QString sourceFilePath;
QString libraryDestinationDirectory;
QString binaryDestinationDirectory;
};
class DylibInfo
{
public:
QString binaryPath;
};
class LddInfo
{
public:
QString installName;
QString binaryPath;
QList<DylibInfo> dependencies;
};
bool operator==(const LibraryInfo& a, const LibraryInfo& b);
QDebug operator<<(QDebug debug, const LibraryInfo& info);
class AppDirInfo
{
public:
QString path;
QString binaryPath;
QStringList libraryPaths;
};
class DeploymentInfo
{
public:
QString qtPath;
QString pluginPath;
QStringList deployedLibraries;
quint64 usedModulesMask;
QSet<QString> rpathsUsed;
bool useLoaderPath;
bool isLibrary;
bool requiresQtWidgetsLibrary;
};
inline QDebug operator<<(QDebug debug, const AppDirInfo& info);
void changeQtLibraries(const QString appPath, const QString& qtPath);
void changeQtLibraries(const QList<LibraryInfo> libraries,
const QStringList& binaryPaths,
const QString& qtPath);
LddInfo findDependencyInfo(const QString& binaryPath);
LibraryInfo parseLddLibraryLine(const QString& line,
const QString& appDirPath,
const QSet<QString>& rpaths);
QString findAppBinary(const QString& appDirPath);
QList<LibraryInfo> getQtLibraries(const QString& path,
const QString& appDirPath,
const QSet<QString>& rpaths);
QList<LibraryInfo> getQtLibraries(const QStringList& lddLines,
const QString& appDirPath,
const QSet<QString>& rpaths);
QString copyLibrary(const LibraryInfo& library, const QString path);
DeploymentInfo deployQtLibraries(const QString& appDirPath,
const QStringList& additionalExecutables,
const QString& qmake);
DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,
const QString& bundlePath,
const QStringList& binaryPaths,
bool useLoaderPath);
void createQtConf(const QString& appDirPath);
void createQtConfForQtWebEngineProcess(const QString& appDirPath);
void deployPlugins(const QString& appDirPath, DeploymentInfo deploymentInfo);
bool deployQmlImports(const QString& appDirPath,
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& appDirPath);
QStringList findAppLibraries(const QString& appDirPath);
bool patchQtCore(const QString& path, const QString& variable, const QString& value);
int createAppImage(const QString& appBundlePath);
bool checkAppImagePrerequisites(const QString& appBundlePath);
void findUsedModules(DeploymentInfo& info);
void deployTranslations(const QString& appDirPath, quint64 usedQtModules);
bool deployTranslations(const QString& sourcePath,
const QString& target,
quint64 usedQtModules);