-
-
Notifications
You must be signed in to change notification settings - Fork 610
[UX] Add proton-cachyos to the wine manager #5463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,19 @@ function getVersionName(type: string, tag_name: string): string { | |
| } | ||
| } | ||
|
|
||
| interface ReleasesData { | ||
| data: { | ||
| tag_name: string | ||
| published_at: string | ||
| html_url: string | ||
| assets: { | ||
| name: string | ||
| browser_download_url: string | ||
| size: number | ||
| }[] | ||
| }[] | ||
| } | ||
|
|
||
| /** | ||
| * Helper to fetch releases from given url. | ||
| * | ||
|
|
@@ -37,7 +50,7 @@ async function fetchReleases({ | |
| return new Promise((resolve, reject) => { | ||
| axiosClient | ||
| .get(url + '?per_page=' + count) | ||
| .then((data) => { | ||
| .then((data: ReleasesData) => { | ||
| for (const release of data.data) { | ||
| const release_data = {} as VersionInfo | ||
| release_data.version = getVersionName(type, release.tag_name) | ||
|
|
@@ -46,15 +59,31 @@ async function fetchReleases({ | |
| release_data.disksize = 0 | ||
| release_data.release_notes_link = release.html_url | ||
|
|
||
| for (const asset of release.assets) { | ||
| if (asset.name.endsWith('sha512sum')) { | ||
| release_data.checksum = asset.browser_download_url | ||
| } else if ( | ||
| asset.name.endsWith('tar.gz') || | ||
| asset.name.endsWith('tar.xz') | ||
| ) { | ||
| release_data.download = asset.browser_download_url | ||
| release_data.downsize = asset.size | ||
| // for proton-cachyos we want to always get the main x86 asset, | ||
| // the other logic sometimes gets the V3, V4 or arm asset incorrectly | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. proton-cachyos releases has many assets (arm and different x86 versions). The recommendation is to not use the |
||
| if (type === 'Proton-Cachyos') { | ||
| const shaAsset = release.assets.find((asset) => | ||
| asset.browser_download_url.endsWith('x86_64.sha512sum') | ||
| ) | ||
| if (shaAsset) release_data.checksum = shaAsset.browser_download_url | ||
| const tarAsset = release.assets.find((asset) => | ||
| asset.browser_download_url.endsWith('x86_64.tar.xz') | ||
| ) | ||
| if (tarAsset) { | ||
| release_data.download = tarAsset.browser_download_url | ||
| release_data.downsize = tarAsset.size | ||
| } | ||
| } else { | ||
| for (const asset of release.assets) { | ||
| if (asset.name.endsWith('sha512sum')) { | ||
| release_data.checksum = asset.browser_download_url | ||
| } else if ( | ||
| asset.name.endsWith('tar.gz') || | ||
| asset.name.endsWith('tar.xz') | ||
| ) { | ||
| release_data.download = asset.browser_download_url | ||
| release_data.downsize = asset.size | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,7 @@ import { UpdateComponent } from 'frontend/components/UI' | |
| import React, { lazy, useContext, useEffect, useMemo, useState } from 'react' | ||
| import { useTranslation } from 'react-i18next' | ||
| import { Tab, Tabs } from '@mui/material' | ||
| import { | ||
| TypeCheckedStoreFrontend, | ||
| wineDownloaderInfoStore | ||
| } from 'frontend/helpers/electronStores' | ||
| import { wineDownloaderInfoStore } from 'frontend/helpers/electronStores' | ||
| import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
| import { | ||
| faCheck, | ||
|
|
@@ -25,10 +22,6 @@ const WineItem = lazy( | |
| async () => import('frontend/screens/WineManager/components/WineItem') | ||
| ) | ||
|
|
||
| const configStore = new TypeCheckedStoreFrontend('wineManagerConfigStore', { | ||
| cwd: 'store' | ||
| }) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to remove the use of this electron store because there's no way to update its stored value and it ignores new repositories added. I understand this was saved in a store to not have to loop through the other OS repositories when rendering the tabs? but it's not really helping |
||
|
|
||
| export default function WineManager(): JSX.Element | null { | ||
| const { t } = useTranslation() | ||
|
|
||
|
|
@@ -87,15 +80,14 @@ export default function WineManager(): JSX.Element | null { | |
| getDefaultRepository() | ||
| ) | ||
|
|
||
| const [wineManagerSettings, setWineManagerSettings] = useState< | ||
| WineManagerUISettings[] | ||
| >([ | ||
| const wineManagerSettings: WineManagerUISettings[] = [ | ||
| protonge, | ||
| { type: 'Proton-Cachyos', value: 'protoncachyos', enabled: isLinux }, | ||
| { type: 'Wine-GE', value: 'winege', enabled: isLinux }, | ||
| gamePortingToolkit, | ||
| wineCrossover, | ||
| wineStagingMacOS | ||
| ]) | ||
| ] | ||
|
|
||
| const getWineVersions = (repo: Type) => { | ||
| let versions = wineDownloaderInfoStore.get('wine-releases', []) | ||
|
|
@@ -120,15 +112,6 @@ export default function WineManager(): JSX.Element | null { | |
| setWineVersions(getWineVersions(repo.type)) | ||
| } | ||
|
|
||
| useEffect(() => { | ||
| const oldWineManagerSettings = configStore.get_nodefault( | ||
| 'wine-manager-settings' | ||
| ) | ||
| if (oldWineManagerSettings) { | ||
| setWineManagerSettings(oldWineManagerSettings) | ||
| } | ||
| }, []) | ||
|
|
||
| useEffect(() => { | ||
| const removeListener = window.api.handleWineVersionsUpdated(() => { | ||
| setWineVersions(getWineVersions(repository.type)) | ||
|
|
@@ -160,10 +143,20 @@ export default function WineManager(): JSX.Element | null { | |
| )} | ||
| </div> | ||
| ) | ||
| case 'Proton-Cachyos': | ||
| return ( | ||
| <div className="infoBox"> | ||
| <FontAwesomeIcon icon={faCheck} color={'green'} /> | ||
| {t( | ||
| 'wineExplanation.proton-cachyos', | ||
| 'Proton-cachyos is a Proton variant maintaned by the CachyOS team. It includes extra tools like DXVK-Sarek and D7VK.' | ||
| )} | ||
| </div> | ||
| ) | ||
| default: | ||
| return <></> | ||
| } | ||
| }, [repository]) | ||
| }, [repository, t]) | ||
|
|
||
| return ( | ||
| <> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This route shouldnt be called when using Proton. What's the intention here?
Do we want a separate feature for enabling this automatically for Proton CachyOS?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are calling
DXVK.getLatest()when heroic opens (and it calls this internally), independent of what we have configured for a game, this prints in the general logs information for the user to know they have a GPU that does not support Vulkan 1.3+.Then if they see that in the logs they know they have to use proton-cachyos instead of ge-proton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also called when running a game with wine I think when it installs DXVK, but I'm adding this information for that use case of the DXVK update when heroic is started
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think we should have something automated in another PR, yes, and make this more visible for the user, I opened an issue here #5425
We could even use this information to default to proton-cachyos with the dxvk-sarek env variable instead of ge-proton if the gpu does not support vulkan 1.3+, but I think all that would be a different feature (would mean moving this check somewhere more global to check once and reuse in other places and also the frontend)