Skip to content

Conversation

@jopejoe1
Copy link
Contributor

@jopejoe1 jopejoe1 commented Sep 9, 2025

Using @CMAKE_INSTALL_FULL_*DIR@ instead of using ${prefix}/@CMAKE_INSTALL_*DIR@ makes it possible to install to absolute paths and not just relative paths. Which we need in nixpkgs to correctly build the package.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Walkthrough

Updated libchromaprint.pc.cmake to use absolute install paths for exec_prefix, libdir, and includedir via CMAKE_INSTALL_FULL_* variables. prefix remains CMAKE_INSTALL_PREFIX. No other lines changed.

Changes

Cohort / File(s) Summary
Pkg-config template update
libchromaprint.pc.cmake
Replaced exec_prefix, libdir, includedir with @CMAKE_INSTALL_FULL_BINDIR@, @CMAKE_INSTALL_FULL_LIBDIR@, @CMAKE_INSTALL_FULL_INCLUDEDIR@; kept prefix=@CMAKE_INSTALL_PREFIX@. No change to Libs/Cflags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately summarizes the primary change of enabling absolute installation paths and is concise and focused on the main improvement without unnecessary detail.
Description Check ✅ Passed The description clearly explains the change from prefix-relative to full-install path variables and why it’s needed for nixpkgs, directly reflecting the code modifications.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 655c26f and 782ef6b.

📒 Files selected for processing (1)
  • libchromaprint.pc.cmake (1 hunks)
🔇 Additional comments (2)
libchromaprint.pc.cmake (2)

3-4: LGTM on switching to FULL_ for absolute paths.*

Using @CMAKE_INSTALL_FULL_LIBDIR@ and @CMAKE_INSTALL_FULL_INCLUDEDIR@ solves the absolute install path need (e.g., nix) and keeps Libs/Cflags correct.


3-4: No action needed: include(GNUInstallDirs) is present in CMakeLists.txt (line 24) and cmake_minimum_required(VERSION 3.10) ≥ 3.4, which introduced CMAKE_INSTALL_FULL_* variables. (manpages.debian.org)

@lalinsky
Copy link
Member

lalinsky commented Sep 9, 2025

@jopejoe1 Explain this to me, please. You are only changing the pkg-config file, and in there, it's standard to define the prefix as absolute path, and then use the prefix for other paths. Why do you need absolute paths there? It seems that you would only need them if you are using some broken parser for the pkg-config files, as pkg-config itself should be able to evaluate this correctly.

Maybe you wanted to change where the files are actually installed? What do you need that you can't achieve by just setting the CMAKE_INSTALL_* variables?

@jopejoe1
Copy link
Contributor Author

jopejoe1 commented Sep 9, 2025

That would generate a broken path in the case where @CMAKE_INSTALL_*DIR@ is an absolute path which is the case in nixpkgs where we install headers, bins and libs into diffrent locations which do not fall under the same prefix.

@lalinsky
Copy link
Member

lalinsky commented Sep 9, 2025

@jopejoe1 why don't you use the prefix and set that to absolute path? can you show me how you build other cmake projects?

@lalinsky
Copy link
Member

lalinsky commented Sep 9, 2025

Oh, I see, you use different prefixes for include dirs than the library, NixOS/nixpkgs#144170 (comment)

Well, I don't like this, but I think it doesn't hurt to change it, so I'll do it.

@lalinsky lalinsky merged commit 9b6a0c6 into acoustid:master Sep 9, 2025
14 checks passed
@jopejoe1 jopejoe1 deleted the fix-install-prefix branch September 15, 2025 19:07
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