Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pkgconfig: fix handling of prefixes containing whitespaces#4193

Merged
ethomson merged 1 commit intolibgit2:masterlibgit2/libgit2:masterfrom
pks-t:pks/libdirpks-t/libgit2:pks/libdirCopy head branch name to clipboard
Apr 7, 2017
Merged

pkgconfig: fix handling of prefixes containing whitespaces#4193
ethomson merged 1 commit intolibgit2:masterlibgit2/libgit2:masterfrom
pks-t:pks/libdirpks-t/libgit2:pks/libdirCopy head branch name to clipboard

Conversation

@pks-t
Copy link
Member

@pks-t pks-t commented Apr 5, 2017

Our libgit2.pc.in file is quoting the libdir variable in our declared
"Libs:" line. The intention is to handle whitespaces here, but pkgconfig
already does so by automatically escaping whitespace with backslashes.
The correct thing to do is to instead quote the prefix, as this is the
one which is being substituted by CMake upon installation. As both
libdir and includedir will be expanded to "${prefix}/lib" and
"${prefix}/include", respectively, pkgconfig will also correctly escape
whitespaces.

Note that this will actually break when a user manually wants to
override libdir and includedir with a path containing whitespace. But
actually, this cannot be helped, as always quoting these variables will
actuall break the common case of being prefixed with "${prefix}". So we
just bail out here and declare this as unsupported out of the box.

Our libgit2.pc.in file is quoting the `libdir` variable in our declared
"Libs:" line. The intention is to handle whitespaces here, but pkgconfig
already does so by automatically escaping whitespace with backslashes.
The correct thing to do is to instead quote the prefix, as this is the
one which is being substituted by CMake upon installation. As both
libdir and includedir will be expanded to "${prefix}/lib" and
"${prefix}/include", respectively, pkgconfig will also correctly escape
whitespaces.

Note that this will actually break when a user manually wants to
override libdir and includedir with a path containing whitespace. But
actually, this cannot be helped, as always quoting these variables will
actuall break the common case of being prefixed with "${prefix}". So we
just bail out here and declare this as unsupported out of the box.
@pks-t
Copy link
Member Author

pks-t commented Apr 5, 2017

This supersedes #4110

@ethomson ethomson merged commit 44998cd into libgit2:master Apr 7, 2017
@ethomson
Copy link
Member

ethomson commented Apr 7, 2017

Thanks! :D

@pks-t pks-t deleted the pks/libdir branch April 7, 2017 09:20
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.