Thanks to visit codestin.com
Credit goes to github.com

Skip to content

use CMAKE_INSTALL_FULL in pkg-config file (fixes nix package) #1473

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

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

babbaj
Copy link
Contributor

@babbaj babbaj commented Aug 22, 2022

CMAKE_INSTALL_LIBDIR/INCLUDEDIR can be and are absolute paths when being built by nix which causes the absolute path to the lib and include dirs being appended to the absolute prefix path which completely breaks the pkg-config file.

babbaj@nixos:~ ❯ nix build nixpkgs#gbenchmark
babbaj@nixos:~ ❯ cat result/lib/pkgconfig/benchmark.pc
prefix=/nix/store/yf25swipsphj343waql8pf2qszg65wjs-gbenchmark-1.6.1
exec_prefix=${prefix}
libdir=${prefix}//nix/store/yf25swipsphj343waql8pf2qszg65wjs-gbenchmark-1.6.1/lib
includedir=${prefix}//nix/store/yf25swipsphj343waql8pf2qszg65wjs-gbenchmark-1.6.1/include

Name: benchmark
Description: Google microbenchmark framework
Version: 1.6.1

Libs: -L${libdir} -lbenchmark
Libs.private: -lpthread
Cflags: -I${includedir}

CMAKE_INSTALL_FULL dirs are documented at being the same as CMAKE_INSTALL dirs except prefixed with the CMAKE_INSTALL_PREFIX only if necessary to make them absolute paths.

Copy link
Collaborator

@LebedevRI LebedevRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems wrong, but meh, SGTM.

@LebedevRI LebedevRI merged commit 2a78e8c into google:main Aug 23, 2022
emilazy added a commit to emilazy/nixpkgs that referenced this pull request Oct 1, 2024
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