cmake: handle absolute install dirs in libsecp256k1.pc #2015

pull willcl-ark wants to merge 1 commits into bitcoin-core:master from willcl-ark:cmake-pkgconfig-abs-install-dirs changing 1 files +10 −2
  1. willcl-ark commented at 4:32 PM on December 2, 2026: member

    GNUInstallDirs allows CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR to be absolute paths (as used by Nixpkgs, and other split-prefix installations).

    Previously, GeneratePkgConfigFile.cmake unconditionally prepended ${exec_prefix}/ and ${prefix}/, producing broken double-prefixed paths such as ${exec_prefix}//custom/lib in libsecp256k1.pc.

    Check IS_ABSOLUTE on CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR before prepending the prefix variables, preserving relocatable ${exec_prefix}/... and ${prefix}/... paths when relative values are used and matching Autotools behavior in both cases.

  2. cmake: handle absolute install dirs in libsecp256k1.pc
    GNUInstallDirs allows CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR
    to be absolute paths (as used by Nixpkgs, and other split-prefix
    installations).
    
    Previously, GeneratePkgConfigFile.cmake unconditionally prepended
    ${exec_prefix}/ and ${prefix}/, producing broken double-prefixed paths
    such as ${exec_prefix}//custom/lib in libsecp256k1.pc.
    
    Check IS_ABSOLUTE on CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR
    before prepending the prefix variables, preserving relocatable
    ${exec_prefix}/... and ${prefix}/... paths when relative values are used
    and matching Autotools behavior in both cases.
    b365ff0c7a
  3. willcl-ark commented at 4:34 PM on December 2, 2026: member

    This seems to be a regression vs autotools.

    Guix does not bump into this packaging (as I suspected they might) because they use relative directories: https://codeberg.org/guix/guix/src/commit/299f83d8e70a3828975397cefb78d93252ba0f30/guix/build/cmake-build-system.scm#L74

    It looks like there is a nixpkgs tracker for packages who bump into this: https://github.com/NixOS/nixpkgs/issues/144170

Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-12-04 01:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me