question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] self.cpp_info.name breaks pkg-config for some packages

See original GitHub issue

Defining self.cpp_info.name for a package changes (at least) two file names: cmake module FindFOO files, and pkg-config files. The problem is that in the wild, the name used for cmake module files and pkg-config files are not always identical, for example zlib has FindZLIB, but zlib.pc, and expat has FindEXPAT but expat.pc. recipes consuming these two packages via pkg-config are broken since these two recipes set self.cpp_info.name to uppercase, the workaround being to rename generated ZLIB.pc to zlib.pc and EXPAT.pc to expat.pc. If pkg-config files are always the lower-case version of corresponding findFOO cmake file, the simplest fix would be to modify pkg-config generator to use self.cpp_info.name.lower() instead of self.cpp_info.name. If not, a solution would be to make self.cpp_info.name a dictionary mapping generators to name.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
ericLemanissiercommented, Oct 28, 2019

The library name appears in the pkg-config file, and is currently in uppercase, but it does not seem to have an impact(renaming the file without modifying content solves the problem). According to https://people.freedesktop.org/~dbn/pkg-config-guide.html, name is A human-readable name for the library or package. This does not affect usage of the pkg-config tool, which uses the name of the .pc file.

1reaction
ericLemanissiercommented, Oct 29, 2019

This issue is not fixed by https://github.com/conan-io/conan/pull/5988 (eg freetype2 vs freetype is not a simple case change). EDIT: ok, I did not realize that this feature was tracked in https://github.com/conan-io/conan/issues/5993

Read more comments on GitHub >

github_iconTop Results From Across the Web

pkgconfig: Requires.private creates unnecessary depencencies
I think you are vastly underestimating the severity of this bug. * This bug basically voids Requires.Private. * it forces developers and ...
Read more >
Changelog — conan 1.56.0 documentation
Fix: Fixed failure with the alias packages when the name of the package (excluded the version) was different from the aliased package. Now...
Read more >
Guide to pkg-config - FreeDesktop.Org
Name : A human-readable name for the library or package. · Description: A brief description of the package. · URL: An URL where...
Read more >
pkg-config - man pages section 1: User Commands
pkg-config - Return metainformation about installed libraries. ... The package name specified on the pkg-config command line is defined to ...
Read more >
Helping C/C++ Packages be Relocatable - CERN Indico
•How can scripts for CMake/PkgConfig find their ... •How to fix existing non-relocatable packages? ... •Can be arbitrary, or name of first found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found