Skip to content
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

Validate Minimum Wine Version 8.0 for .NET 8 #8220

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

AristurtleDev
Copy link
Contributor

Description

This updates the mgfxc_wine_setup.sh script to validate that at minimum Wine version 8.0 is installed.

References

# see https://github.com/MonoGame/MonoGame/issues/8103
# wine --version will output 'wine-#.# (Ubuntu #.#.#)'
# grep to find only the 'wine-#' then use sed to remove the 'wine-' prefix
WINE_VERSION=$(wine --version 2>&1 | grep -oP 'wine-\d+' | sed 's/wine-//')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is grep needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wine --version will output something like

wine-#.# (Ubuntu #.#.#)

grep is used to pattern match the wine-# string specifically from thr output, then sed to remove the wine- prefix which just leaves the major version number of wine detected.

Since it's an integer value and not the #.# floating point value, that makes the version check a simple if statement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sed does support regex, but I guess this is fine as well.

Modify comment to:

# wine 8 is the minimum requirement for dotnet 8
# wine --version will output "wine-#.# (Distro #.#.#)" or "wine-#.#"

The rest is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harry-cpp comment modified.

@harry-cpp harry-cpp merged commit 76fb878 into MonoGame:develop Mar 5, 2024
3 checks passed
viniciusjarina pushed a commit to codefoco/MonoGame that referenced this pull request Mar 6, 2024
@AristurtleDev AristurtleDev deleted the net8/wine-version-check branch March 12, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants