Skip to content

Commit

Permalink
Steam Deck compatbility layer
Browse files Browse the repository at this point in the history
Add support SteamRuntimeSniper container
Add support SteamRuntimeSoldier container
Add support SteamRuntimeScout container
Add support BottlesDevs container
  • Loading branch information
hitman249 committed Jun 15, 2023
1 parent 55c1265 commit d5dfca8
Show file tree
Hide file tree
Showing 17 changed files with 607 additions and 75 deletions.
20 changes: 10 additions & 10 deletions src/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import ProtonTKG from "./modules/repositories/proton-tkg";
import ProtonTkgGardotd426 from "./modules/repositories/proton-tkg-gardotd426";
import Steam from "./modules/repositories/steam";
import BottlesDevs from "./modules/repositories/bottlesdevs";
import Runtime from "./modules/repositories/runtime";
import FacadeContainer from "./modules/containers/facade-container";
import MediaFoundation from "./modules/media-foundation";
import Errors from "./helpers/errors";
import Cache from "./modules/cache";
Expand Down Expand Up @@ -79,8 +79,8 @@ class App {
PROTON_TKG = new ProtonTKG(this.APP_FOLDERS, this.FILE_SYSTEM, this.NETWORK);
PROTON_TKG_GARDOTD426 = new ProtonTkgGardotd426(this.APP_FOLDERS, this.FILE_SYSTEM, this.NETWORK);
BOTTLES_DEVS = new BottlesDevs(this.APP_FOLDERS, this.FILE_SYSTEM, this.NETWORK);
RUNTIME = new Runtime(this.APP_FOLDERS, this.FILE_SYSTEM, this.NETWORK);
STEAM = new Steam(this.APP_FOLDERS, this.FILE_SYSTEM, this.NETWORK, this.SYSTEM);
CONTAINER = new FacadeContainer(this.APP_FOLDERS, this.FILE_SYSTEM, this.NETWORK, this.SYSTEM, this.PREFIX, this.COMMAND);
DRIVER = new Driver(this.COMMAND, this.SYSTEM, this.FILE_SYSTEM);
MONITOR = new Monitor(this.APP_FOLDERS, this.PREFIX, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM);
REPLACES = new Replaces(this.APP_FOLDERS, this.SYSTEM, this.FILE_SYSTEM, this.MONITOR);
Expand All @@ -95,7 +95,7 @@ class App {
MANGO_HUD = new MangoHud(this.APP_FOLDERS, this.PREFIX, this.FILE_SYSTEM, this.NETWORK);
VK_BASALT = new VkBasalt(this.APP_FOLDERS, this.PREFIX, this.FILE_SYSTEM, this.NETWORK);
FIXES = new Fixes(this.PREFIX);
WINE_PREFIX = new WinePrefix(this.APP_FOLDERS, this.PREFIX, this.CONFIG, this.SYSTEM, this.FILE_SYSTEM, this.REPLACES, this.REGISTRY, this.PATCHES, this.DXVK, this.FIXES, this.MF, this.VKD3D_PROTON, this.UPDATE, this.RUNTIME);
WINE_PREFIX = new WinePrefix(this.APP_FOLDERS, this.PREFIX, this.CONFIG, this.SYSTEM, this.FILE_SYSTEM, this.REPLACES, this.REGISTRY, this.PATCHES, this.DXVK, this.FIXES, this.MF, this.VKD3D_PROTON, this.UPDATE, this.CONTAINER);
DIAGNOSTICS = new Diagnostics(this.APP_FOLDERS, this.COMMAND, this.SYSTEM, this.FILE_SYSTEM);
MOUNT_WINE = new Mount(this.APP_FOLDERS, this.COMMAND, this.FILE_SYSTEM, this.UPDATE, this.SYSTEM, this.APP_FOLDERS.getWineDir());
MOUNT_DATA = new Mount(this.APP_FOLDERS, this.COMMAND, this.FILE_SYSTEM, this.UPDATE, this.SYSTEM, this.APP_FOLDERS.getGamesDir());
Expand Down Expand Up @@ -467,13 +467,6 @@ class App {
return this.BOTTLES_DEVS;
}

/**
* @return {Runtime}
*/
getRuntime() {
return this.RUNTIME;
}

/**
* @return {Steam}
*/
Expand Down Expand Up @@ -530,6 +523,13 @@ class App {
return this.KERNEL;
}

/**
* @return {FacadeContainer}
*/
getFacadeContainer() {
return this.CONTAINER;
}

/**
* @return {Api}
*/
Expand Down
16 changes: 8 additions & 8 deletions src/src/components/Prefix/PopupEditPrefix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ export default {
type: 'archFiltered',
required: true,
},
'wine.container': {
tab: 'main',
name: this.$t('prefix.form-prefix.container'),
description_title: '',
description: this.$t('prefix.form-prefix.containers-desc'),
type: 'containers',
required: false,
},
'app.sandbox': {
Expand Down Expand Up @@ -364,14 +372,6 @@ export default {
type: 'bool',
required: false,
},
'libs.runtime.install': {
tab: 'libs',
name: 'Runtime',
description_title: '',
description: this.$t('prefix.form-prefix.runtime-desc'),
type: 'bool',
required: false,
},
'fixes-form': {
tab: 'fixes',
Expand Down
6 changes: 6 additions & 0 deletions src/src/components/UI/FormItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<OnlySelect v-else-if="has(field, 'fsr')" class="m-b-0"
:selected.sync="item[key]"
:items="getFsr()"/>
<OnlySelect v-else-if="has(field, 'containers')" class="m-b-0"
:selected.sync="item[key]"
:items="getContainers()"/>
<OnlySelect v-else-if="has(field, 'select')" class="m-b-0"
:selected.sync="item[key]"
:items="field.items"/>
Expand Down Expand Up @@ -217,6 +220,9 @@ export default {
getFsr() {
return collects.getToSelect('fsr');
},
getContainers() {
return collects.getToSelect('containers');
},
},
computed: {
leftClass() {
Expand Down
10 changes: 9 additions & 1 deletion src/src/helpers/collects.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class Collects {
};

static fsr = {
'': 'Disabled',
'': window.i18n.t('collects.off'),
'fsr-0': '0 - Max blur',
'fsr-1': '1',
'fsr-2': '2',
Expand All @@ -51,6 +51,14 @@ export default class Collects {
'fsr-5': '5 - Max sharp',
};

static containers = {
'': window.i18n.t('collects.off'),
'sniper': 'SteamLinuxRuntime Sniper (Debian 11) (Recommended)',
'soldier': 'SteamLinuxRuntime Soldier (Debian 10)',
'scout': 'SteamLinuxRuntime Scout (Ubuntu 12.04)',
'bottlesdev': 'BottlesDev (Ubuntu 20.04)',
};

static commands = {
build: window.i18n.t('collects.save'),
install: window.i18n.t('collects.install'),
Expand Down
3 changes: 2 additions & 1 deletion src/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ export default {
'mangohud-desc': 'Beautiful HUD to display FPS\n[F12] - Show / Hide',
'mf-desc': 'Multimedia framework (x86_64 only prefix)',
'vkbasalt-desc': 'Texture Improvement in Vulkan Games\n[HOME] - Enable / Disable',
'runtime-desc': 'This is a set of libraries from Ubuntu 20.04 to ensure wine compatibility',
'container': 'Сontainer',
'containers-desc': 'Container that will run wine or proton',
'mono': 'Disable installation of .NET Framework compatible counterpart',
'gecko': 'Disable installation of the Gecko browser engine (needed to emulate IE WebView inside Wine)',
'gstreamer': 'Disable winegstreamer (helps in cases where the prefix creation process hangs)',
Expand Down
3 changes: 2 additions & 1 deletion src/src/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ export default {
'mangohud-desc': 'Красивый HUD для отображения FPS.\n[F12] - Показать/скрыть',
'mf-desc': 'Мультимедийный фреймворк (только для x86_64 префикса)',
'vkbasalt-desc': 'Улучшение текстур в Vulkan играх.\n[HOME] - Включить/отключить',
'runtime-desc': 'This is a set of librarires from Ubuntu 20.04 to ensure wine compatibility',
'container': 'Контейнер',
'containers-desc': 'Контейнер в котором будет запущен wine или proton',
'mono': 'Отключить установку совместимого с .NET Framework аналога',
'gecko': 'Отключить установку браузерного движка Gecko (нужен для эмуляции IE WebView внутри Wine)',
'gstreamer': 'Отключить winegstreamer (помогает в случаях зависания процесса создания префикса)',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import AppFolders from "../app-folders";
import FileSystem from "../file-system";
import Network from "../network";
import System from "../system";
import Command from "../command";
import Utils from "../utils";

export default class Runtime {
export default class BottlesDevs {
/**
* @type {string}
*/
url = 'https://api.github.com/repos/bottlesdevs/runtime/releases';

/**
* @type {string}
*/
version = 'Ubuntu 20.04';

data = null;

/**
Expand All @@ -26,29 +33,47 @@ export default class Runtime {
*/
network = null;

/**
* @type {System}
*/
system = null;

/**
* @type {Command}
*/
command = null;

/**
* @param {AppFolders} appFolders
* @param {FileSystem} fs
* @param {Network} network
* @param {System} system
* @param {Command} command
*/
constructor(appFolders, fs, network) {
constructor(appFolders, fs, network, system, command) {
this.appFolders = appFolders;
this.fs = fs;
this.network = network;
this.system = system;
this.command = command;
}

/**
* @returns {string}
*/
getName() {
return 'bottlesdev';
}

/**
* @return {{name: string, type: string, nested: (function(): Promise)}}
* @returns {boolean}
*/
getElement() {
return {
name: 'Runtime',
type: 'dir',
nested: () => this.getList(),
};
check() {
return Boolean(this.getInfo('runtime'));
}

/**
* @private
* @return {Promise}
*/
getList() {
Expand All @@ -74,6 +99,7 @@ export default class Runtime {
}

/**
* @private
* @param {string} url
* @return Promise<string>
*/
Expand All @@ -88,6 +114,12 @@ export default class Runtime {
* @return {Promise<*>}
*/
install() {
if (this.getInfo('runtime')) {
return Promise.resolve();
}

this.setInfo('runtime', true);

return this.getList()
.then((item) => item.download())
.then((filename) => {
Expand Down Expand Up @@ -134,6 +166,7 @@ export default class Runtime {
}

/**
* @private
* @param {string} field
* @returns {*|undefined}
*/
Expand All @@ -146,6 +179,7 @@ export default class Runtime {
}

/**
* @private
* @param {string} field
* @param {*} value
* @returns {*|null}
Expand All @@ -155,19 +189,17 @@ export default class Runtime {
this.fs.filePutContents(path, Utils.jsonEncode(value));
}

update() {
let prefix = window.app.getPrefix();

if (prefix.isRuntime()) {
if (this.getInfo('runtime')) {
return;
}

this.setInfo('runtime', true);

return this.install();
}
/**
* @returns {boolean}
*/
isSupportLdLibraryPath() {
return true;
}

return Promise.resolve();
/**
* @param {string} cmd
*/
run(cmd) {
return cmd;
}
}
Loading

0 comments on commit d5dfca8

Please sign in to comment.