Bug 98364 - pkg-config returning 1 incorrectly when checking a package version
Summary: pkg-config returning 1 incorrectly when checking a package version
Status: RESOLVED NOTOURBUG
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: high normal
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-20 22:36 UTC by Jessi Mon'e
Modified: 2016-10-22 17:43 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jessi Mon'e 2016-10-20 22:36:12 UTC
On Arch with all current updates when attempting to build a package from the AUR, i3-gaps-next-git, there is a check as so:

ifneq ($(shell $(PKG_CONFIG) --atleast-version=1.14.4 cairo 2>/dev/null && echo 1),1)
$(error "cairo >= 1.14.4 missing")

This returns 1 causing the build to fail

Running the basic check outside of the context of the code still returns one:

pkg-config --atleast-version=1.14.4 cairo ; echo $?
1

Running the pkg-config version check returns the correct version:

pkg-config --modversion cairo
1.14.6


Why is pkg-config returning one to this check when the build of the package being checked is clearly within the requirements?

You can view the source where the first check I stated is implemented here:

https://github.com/Airblader/i3/blob/gaps-next/common.mk

The maintainer is also confused as to this behavior, as seen here:

https://github.com/Airblader/i3/issues/102
Comment 1 Jessi Mon'e 2016-10-21 21:18:07 UTC
Now also appearing for Users on Fedora as the latest release is beginning to be used elsewhere.

Source: https://github.com/Airblader/i3/issues/102

Hopefully this user follows my advice and relays the exact specs of what is happening here.
Comment 2 Dan Nicholson 2016-10-22 06:26:01 UTC
Seems to work fine on my system. Can you run again with --debug and --print-errors? Something like "pkg-config --atleast-version=1.14.4 --debug --print-errors"?

Alternatively, the normal way to do this is "pkg-config --exists 'cairo >= 1.14.4'". The --atleast/exact/max-version options are legacy interfaces.
Comment 3 Jessi Mon'e 2016-10-22 17:43:07 UTC
pkg-config --exists 'cairo >= 1.14.4' still returns one.


Looking through the debug commands you gave though I see it can't find the package "egl.pc". After some searching, I found this to be a component given by Mesa. Reinstalling the Mesa package and dependencies seems to have given me the required file. This should be good now. Thank you for the help!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.