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

cglm: install correct include/lib dir in pkg-config #190982

Merged

Conversation

bobvanderlinden
Copy link
Member

Description of changes

Currently the cglm package has the following pkgconfig:

$ nix build nixpkgs#cglm && cat result/lib/pkgconfig/cglm.pc
prefix=/nix/store/3b25lbw0vnglfar91mich3mliqchxmiy-cglm-0.8.5
exec_prefix=/nix/store/3b25lbw0vnglfar91mich3mliqchxmiy-cglm-0.8.5
libdir=${prefix}//nix/store/3b25lbw0vnglfar91mich3mliqchxmiy-cglm-0.8.5/lib
includedir=${prefix}//nix/store/3b25lbw0vnglfar91mich3mliqchxmiy-cglm-0.8.5/include

Name: cglm
Description: OpenGL Mathematics (glm) for C
URL: https://github.com/recp/cglm
Version: 0.8.5
Cflags: -I${includedir}
Libs: -L${libdir} -lcglm 

The includedir and libdir resolve into /nix/store/3b25lbw0vnglfar91mich3mliqchxmiy-cglm-0.8.5//nix/store/3b25lbw0vnglfar91mich3mliqchxmiy-cglm-0.8.5/{include,lib}. This is incorrect.

I attempted to fix this by setting CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_LIBDIR.

After the change it results in correct pkgconfig:

$ nix build .#cglm && cat result/lib/pkgconfig/cglm.pc
prefix=/nix/store/g29bhhjrnb2mwm6l4n38f1k8aspcsr47-cglm-0.8.5
exec_prefix=/nix/store/g29bhhjrnb2mwm6l4n38f1k8aspcsr47-cglm-0.8.5
libdir=${prefix}/lib
includedir=${prefix}/include

Name: cglm
Description: OpenGL Mathematics (glm) for C
URL: https://github.com/recp/cglm
Version: 0.8.5
Cflags: -I${includedir}
Libs: -L${libdir} -lcglm 

The only package that depends on cglm seems to be taisei. I was able to successfully build taisei with these changes.

The reason to do this change is to be able to build wxrc, which currently fails.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Copy link
Member

@IvarWithoutBones IvarWithoutBones left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 190982 run on x86_64-darwin 1

1 package marked as broken and skipped:
  • taisei
1 package built:
  • cglm

@IvarWithoutBones IvarWithoutBones merged commit 36c3f1f into NixOS:master Sep 14, 2022
@vcunat
Copy link
Member

vcunat commented Sep 15, 2022

I think the expression will need some cleanup after this PR collided with 3bf5a3c. (Currently not in master branch yet, just in staging-next.)

@bobvanderlinden
Copy link
Member Author

I think the expression will need some cleanup after this PR collided with 3bf5a3c. (Currently not in master branch yet, just in staging-next.)

Ah, so more people ran into this problem 😅

The fix in 3bf5a3c seems to be functionally equal to this PR. Which patch should be accepted?

I'm fine with creating a revert for my PR, but the other patch should then still be applied to master as well?

@vcunat
Copy link
Member

vcunat commented Sep 16, 2022

The clash has only reached staging-next for now (and it will remain so for at least a few more days), so at this point it's best resolved on that branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants