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

Split packages from cmake_modules when adding them as buildreqs #853

Conversation

bwarden
Copy link
Member

@bwarden bwarden commented Oct 1, 2024

When parsing cmake files for find_package dependencies, we match against entries in cmake_modules. Many of the entries of this file list multiple packages, separated by space. Split on whitespace so we actually feed only individual package names to each add_buildreq call.

Otherwise, if cmake_modules provides "extra-cmake-modules png2ico", for example, and you have "png2ico" in buildreq_ban, the specfile would still list both extra-cmake-modules and png2ico as build dependencies, because add_buildreq only compared exact matches.

When parsing cmake files for find_package dependencies, we match against
entries in cmake_modules. Many of the entries of this file list
multiple packages, separated by space. Split on whitespace so we
actually feed only individual package names to each add_buildreq call.

Otherwise, if cmake_modules provides "extra-cmake-modules png2ico", for
example, and you have "png2ico" in buildreq_ban, the specfile would still
list both extra-cmake-modules and png2ico as build dependencies, because
add_buildreq only compared exact matches.
If a cmake file defines a pkgconfig dependency with a hypen in it, make
sure we can handle it:
pkg_check_modules(DBUS-1 REQUIRED dbus-1 IMPORTED_TARGET)

Previously we used \w to match the first term (DBUS-1), which does *not*
match hyphens.
@bwarden bwarden requested a review from bryteise October 1, 2024 18:24
@bryteise bryteise merged commit 4d02964 into clearlinux:master Oct 1, 2024
2 checks passed
@bwarden bwarden deleted the fix-buildreq_ban-for-cmake_modules-with-whitespace branch October 1, 2024 18:51
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.

2 participants