summaryrefslogtreecommitdiffhomepage
path: root/proto-wine/proton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'proto-wine/proton.cpp')
-rw-r--r--proto-wine/proton.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/proto-wine/proton.cpp b/proto-wine/proton.cpp
index 5ecd1f93..998da748 100644
--- a/proto-wine/proton.cpp
+++ b/proto-wine/proton.cpp
@@ -10,32 +10,34 @@
#include <QDebug>
#include <QDir>
#include <QFileInfo>
-#include <QProcessEnvironment>
#include <QtGlobal>
+#include "proton.h"
static const char* steam_paths[] = {
"/.steam/steam/steamapps/compatdata",
"/.local/share/Steam/steamapps/compatdata",
+ "/.steam/debian-installation/steamapps/compatdata",
};
static const char* runtime_paths[] = {
"/.local/share/Steam/ubuntu12_32/steam-runtime",
"/.steam/ubuntu12_32/steam-runtime",
+ "/.steam/debian-installation/ubuntu12_32/steam-runtime",
};
-std::tuple<QProcessEnvironment, QString, bool> make_steam_environ(const QString& proton_path, int appid)
+std::tuple<QProcessEnvironment, QString, bool> make_steam_environ(const QString& proton_dist_path)
{
using ret = std::tuple<QProcessEnvironment, QString, bool>;
auto env = QProcessEnvironment::systemEnvironment();
QString error = "";
QString home = qgetenv("HOME");
- QString runtime_path, app_wineprefix;
+ QString runtime_path;
auto expand = [&](QString x) {
x.replace("HOME", home);
- x.replace("PROTON_PATH", proton_path);
+ x.replace("PROTON_DIST_PATH", proton_dist_path);
x.replace("RUNTIME_PATH", runtime_path);
return x;
};
@@ -49,23 +51,15 @@ std::tuple<QProcessEnvironment, QString, bool> make_steam_environ(const QString&
if (runtime_path.isEmpty())
error = QString("Couldn't find a Steam runtime.");
- for (const char* path : steam_paths) {
- QDir dir(QDir::homePath() + path + expand("/%1/pfx").arg(appid));
- if (dir.exists())
- app_wineprefix = dir.absolutePath();
- }
- if (app_wineprefix.isEmpty())
- error = QString("Couldn't find a Wineprefix for AppId %1").arg(appid);
-
QString path = expand(
- ":PROTON_PATH/dist/bin"
+ ":PROTON_DIST_PATH/bin"
);
path += ':'; path += qgetenv("PATH");
env.insert("PATH", path);
QString library_path = expand(
- ":PROTON_PATH/dist/lib"
- ":PROTON_PATH/dist/lib64"
+ ":PROTON_DIST_PATH/lib"
+ ":PROTON_DIST_PATH/lib64"
":RUNTIME_PATH/pinned_libs_32"
":RUNTIME_PATH/pinned_libs_64"
":RUNTIME_PATH/i386/lib/i386-linux-gnu"
@@ -79,14 +73,25 @@ std::tuple<QProcessEnvironment, QString, bool> make_steam_environ(const QString&
);
library_path += ':'; library_path += qgetenv("LD_LIBRARY_PATH");
env.insert("LD_LIBRARY_PATH", library_path);
- env.insert("WINEPREFIX", app_wineprefix);
return ret(env, error, error.isEmpty());
}
-QString proton_path(const QString& proton_path)
+
+std::tuple<QString, QString, bool> make_wineprefix(int appid)
{
- return proton_path + "/dist/bin/wine";
+ using ret = std::tuple<QString, QString, bool>;
+ QString error = "";
+ QString app_wineprefix;
+ for (const char* path : steam_paths) {
+ QDir dir(QDir::homePath() + path + QString("/%1/pfx").arg(appid));
+ if (dir.exists())
+ app_wineprefix = dir.absolutePath();
+ }
+ if (app_wineprefix.isEmpty())
+ error = QString("Couldn't find a Wineprefix for AppId %1").arg(appid);
+
+ return ret(app_wineprefix, error, error.isEmpty());
}
#endif