Added support for QT6
Be warned, support for QT6 remain untested. Fixed up build.py to be forgiving if some lib files are missing. Removed the use of QRegExp since it has been deprecated.
This commit is contained in:
parent
2d1eef3700
commit
d268fcb2ee
40
build.py
40
build.py
|
@ -109,21 +109,27 @@ def verbose_copy(src, dst):
|
||||||
print("cpy: " + src + " --> " + dst)
|
print("cpy: " + src + " --> " + dst)
|
||||||
|
|
||||||
if os.path.isdir(src):
|
if os.path.isdir(src):
|
||||||
files = os.listdir(src)
|
if os.path.exists(dst) and os.path.isdir(dst):
|
||||||
|
shutil.rmtree(dst)
|
||||||
for file in files:
|
|
||||||
tree_src = src + os.path.sep + file
|
|
||||||
tree_dst = dst + os.path.sep + file
|
|
||||||
|
|
||||||
if os.path.isdir(tree_src):
|
try:
|
||||||
if not os.path.exists(tree_dst):
|
# ignore errors thrown by shutil.copytree()
|
||||||
os.makedirs(tree_dst)
|
# it's likely not actually failing to copy
|
||||||
|
# the directory but still throws errors if
|
||||||
|
# it fails to apply the same file stats as
|
||||||
|
# the source. this type of errors can be
|
||||||
|
# ignored.
|
||||||
|
shutil.copytree(src, dst)
|
||||||
|
|
||||||
verbose_copy(tree_src, tree_dst)
|
except:
|
||||||
|
pass
|
||||||
else:
|
|
||||||
|
elif os.path.exists(src):
|
||||||
shutil.copyfile(src, dst)
|
shutil.copyfile(src, dst)
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("wrn: " + src + " does not exists. skipping.")
|
||||||
|
|
||||||
def linux_build_app_dir(app_ver, app_name, app_target, qt_bin):
|
def linux_build_app_dir(app_ver, app_name, app_target, qt_bin):
|
||||||
if not os.path.exists("app_dir/linux/platforms"):
|
if not os.path.exists("app_dir/linux/platforms"):
|
||||||
os.makedirs("app_dir/linux/platforms")
|
os.makedirs("app_dir/linux/platforms")
|
||||||
|
@ -169,10 +175,14 @@ def linux_build_app_dir(app_ver, app_name, app_target, qt_bin):
|
||||||
if "/usr/lib/x86_64-linux-gnu/qt5/bin" == qt_bin:
|
if "/usr/lib/x86_64-linux-gnu/qt5/bin" == qt_bin:
|
||||||
verbose_copy(qt_bin + "/../../libQt5DBus.so.5", "app_dir/linux/lib/libQt5DBus.so.5")
|
verbose_copy(qt_bin + "/../../libQt5DBus.so.5", "app_dir/linux/lib/libQt5DBus.so.5")
|
||||||
verbose_copy(qt_bin + "/../../libQt5XcbQpa.so.5", "app_dir/linux/lib/libQt5XcbQpa.so.5")
|
verbose_copy(qt_bin + "/../../libQt5XcbQpa.so.5", "app_dir/linux/lib/libQt5XcbQpa.so.5")
|
||||||
|
verbose_copy(qt_bin + "/../../libQt6DBus.so.6", "app_dir/linux/lib/libQt6DBus.so.6")
|
||||||
|
verbose_copy(qt_bin + "/../../libQt6XcbQpa.so.6", "app_dir/linux/lib/libQt6XcbQpa.so.6")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
verbose_copy(qt_bin + "/../lib/libQt5DBus.so.5", "app_dir/linux/lib/libQt5DBus.so.5")
|
verbose_copy(qt_bin + "/../lib/libQt5DBus.so.5", "app_dir/linux/lib/libQt5DBus.so.5")
|
||||||
verbose_copy(qt_bin + "/../lib/libQt5XcbQpa.so.5", "app_dir/linux/lib/libQt5XcbQpa.so.5")
|
verbose_copy(qt_bin + "/../lib/libQt5XcbQpa.so.5", "app_dir/linux/lib/libQt5XcbQpa.so.5")
|
||||||
|
verbose_copy(qt_bin + "/../lib/libQt6DBus.so.6", "app_dir/linux/lib/libQt6DBus.so.6")
|
||||||
|
verbose_copy(qt_bin + "/../lib/libQt6XcbQpa.so.6", "app_dir/linux/lib/libQt5XcbQpa.so.6")
|
||||||
|
|
||||||
verbose_copy("templates/linux_run_script.sh", "app_dir/linux/" + app_target + ".sh")
|
verbose_copy("templates/linux_run_script.sh", "app_dir/linux/" + app_target + ".sh")
|
||||||
verbose_copy("templates/linux_uninstall.sh", "app_dir/linux/uninstall.sh")
|
verbose_copy("templates/linux_uninstall.sh", "app_dir/linux/uninstall.sh")
|
||||||
|
@ -253,6 +263,14 @@ def main():
|
||||||
else:
|
else:
|
||||||
cd()
|
cd()
|
||||||
|
|
||||||
|
if platform.system() == "Linux":
|
||||||
|
if os.path.exists("build/linux"):
|
||||||
|
shutil.rmtree("build/linux")
|
||||||
|
|
||||||
|
elif platform.system() == "Windows":
|
||||||
|
if os.path.exists("build/windows"):
|
||||||
|
shutil.rmtree("build/windows")
|
||||||
|
|
||||||
result = subprocess.run([qt_bin + os.sep + "qmake", "-config", "release"])
|
result = subprocess.run([qt_bin + os.sep + "qmake", "-config", "release"])
|
||||||
|
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
|
|
|
@ -94,6 +94,8 @@ For Linux you need the following packages to successfully build/install:
|
||||||
```
|
```
|
||||||
qtbase5-dev
|
qtbase5-dev
|
||||||
libssl-dev
|
libssl-dev
|
||||||
|
libgl1-mesa-dev
|
||||||
|
libxcb1-dev
|
||||||
gcc
|
gcc
|
||||||
make
|
make
|
||||||
python3
|
python3
|
||||||
|
@ -118,4 +120,4 @@ while running the install script, it will ask you to input 1 of 3 options:
|
||||||
|
|
||||||
***exit*** - Cancel the installation.
|
***exit*** - Cancel the installation.
|
||||||
|
|
||||||
-local or -installer can be passed as command line options for install.py to explicitly select one of the above options without pausing for user input.
|
-local or -installer can be passed as command line options for install.py to explicitly select one of the above options without pausing for user input.
|
||||||
|
|
|
@ -111,12 +111,12 @@ void SaveBookmark::dataIn(const QString &argsLine)
|
||||||
{
|
{
|
||||||
if (activeHook())
|
if (activeHook())
|
||||||
{
|
{
|
||||||
if (QRegExp("y", Qt::CaseInsensitive).exactMatch(argsLine))
|
if ("y" == argsLine.toLower())
|
||||||
{
|
{
|
||||||
run(baseName, baseArgs);
|
run(baseName, baseArgs);
|
||||||
term();
|
term();
|
||||||
}
|
}
|
||||||
else if (QRegExp("n", Qt::CaseInsensitive).exactMatch(argsLine))
|
else if ("n" == argsLine.toLower())
|
||||||
{
|
{
|
||||||
term();
|
term();
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,7 +350,7 @@ QString getParam(const QString &key, const QStringList &args)
|
||||||
|
|
||||||
QString ret;
|
QString ret;
|
||||||
|
|
||||||
int pos = args.indexOf(QRegExp(key, Qt::CaseInsensitive));
|
int pos = args.indexOf(QRegularExpression(key, QRegularExpression::CaseInsensitiveOption));
|
||||||
|
|
||||||
if (pos != -1)
|
if (pos != -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
#include <QTextBlockFormat>
|
#include <QTextBlockFormat>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
|
@ -59,8 +58,7 @@
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFile>
|
#include <QRegularExpression>
|
||||||
#include <QRegExp>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
@ -75,7 +73,7 @@
|
||||||
#define CONFIG_FILENAME "config_v3.json"
|
#define CONFIG_FILENAME "config_v3.json"
|
||||||
#define APP_NAME "Cmdr"
|
#define APP_NAME "Cmdr"
|
||||||
#define APP_TARGET "cmdr"
|
#define APP_TARGET "cmdr"
|
||||||
#define APP_VERSION "3.4"
|
#define APP_VERSION "3.5"
|
||||||
|
|
||||||
enum TypeID : quint8
|
enum TypeID : quint8
|
||||||
{
|
{
|
||||||
|
|
|
@ -259,8 +259,8 @@ void Genfile::setGenfileType(quint8 typeId)
|
||||||
|
|
||||||
QByteArray Genfile::autoFill(const QByteArray &data)
|
QByteArray Genfile::autoFill(const QByteArray &data)
|
||||||
{
|
{
|
||||||
QStringList args = parseArgs(data, -1);
|
auto args = parseArgs(data, -1);
|
||||||
int ind = args.indexOf(QRegExp("-len", Qt::CaseInsensitive));
|
auto ind = args.indexOf(QRegularExpression("-len", QRegularExpression::CaseInsensitiveOption));
|
||||||
|
|
||||||
if (ind == -1)
|
if (ind == -1)
|
||||||
{
|
{
|
||||||
|
@ -374,7 +374,7 @@ void Genfile::dataIn(const QByteArray &data)
|
||||||
{
|
{
|
||||||
auto ans = QString(data);
|
auto ans = QString(data);
|
||||||
|
|
||||||
if (QRegExp("y", Qt::CaseInsensitive).exactMatch(ans))
|
if ("y" == ans.toLower())
|
||||||
{
|
{
|
||||||
emit unsetUserIO(GEN_HOOK);
|
emit unsetUserIO(GEN_HOOK);
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ void Genfile::dataIn(const QByteArray &data)
|
||||||
|
|
||||||
setupForWriting();
|
setupForWriting();
|
||||||
}
|
}
|
||||||
else if (QRegExp("n", Qt::CaseInsensitive).exactMatch(ans))
|
else if ("n" == ans.toLower())
|
||||||
{
|
{
|
||||||
finished();
|
finished();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QAbstractSocket>
|
#include <QAbstractSocket>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QTextCodec>
|
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
#include <QSsl>
|
#include <QSsl>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user