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

Updated wxwin.m4 macro regex to detect x.x.x[...] versions #23402

Closed
wants to merge 1 commit into from
Closed

Updated wxwin.m4 macro regex to detect x.x.x[...] versions #23402

wants to merge 1 commit into from

Conversation

mehw
Copy link

@mehw mehw commented Mar 30, 2023

Hello,

Is it possible to add the possibility to detect wxWidgets versions like 3.2.2.1?

There are problems compiling xCHM on Gentoo GNU/Linux with wxGTK-3.2.2.1 installed: https://bugs.gentoo.org/895982

The current wxwin.m4 macro fails to detect x.x.x[...] versions:

echo "3.2.2.1" | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'

This PR simply adds a capture group to glob the [...] part in x.x.x[...]:

echo "3.2.2.1" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\1/'

Thanks.

This adds the possibility to detect versions like "3.2.2.1".

$ echo "3.2.2.1" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\1/'
$ echo "3.2.2.1" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\2/'
$ echo "3.2.2.1" | sed -r 's/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\3/'
@vadz
Copy link
Contributor

vadz commented Mar 30, 2023

This seems to be the same as #23289. As mentioned there, it's due to some change to wx-config in Gentoo, but I still don't know why did they change it nor where exactly.

But I still suggest submitting your fix to Gentoo developers because it doesn't make sense for wx itself, because our wx-config is never going to output the 4th version component, but they should be willing to take it (if they're not willing to simply revert this change). They also should have no problem with using sed -r, while we can't do this in wx itself because it is not portable and, for example, wouldn't work at all under macOS.

@mehw
Copy link
Author

mehw commented Mar 30, 2023

Thank you for the precise answer. I completely missed the #23289 PR.

Gentoo's devs fixed the problem just minutes ago:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86d51f8fb503db6f6f023efdb1ebca4590404fa7

Simply put, the fix drops the 4th version component from the release string, so it's never printed by the installed wx-config.

I just installed the Gentoo's wxGTK-3.2.2.1 fixed version and xCHM configures and compiles fine now.

I'm closing the PR. Thanks ;)

@rzvncj
Copy link

rzvncj commented Mar 30, 2023

Great! Thanks for researching it. I'm glad it's all sorted out.

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

3 participants