Skip to content

Commit

Permalink
Make the installed pkg-config files relocatable (astral-sh/uv#11028) (#…
Browse files Browse the repository at this point in the history
…507)

This ensures that e.g. `PKG_CONFIG_PATH=/wherever/python/lib/pkgconfig
pkg-config --cflags` gets you existent paths in /wherever/python instead
of nonexistent paths in /install.
  • Loading branch information
geofft authored Jan 30, 2025
1 parent cb32f8d commit dfb68b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1116,5 +1116,10 @@ else
cp -av Tools/scripts/run_tests.py ${ROOT}/out/python/build/
fi

# Don't hard-code the build-time prefix into the pkg-config files. See
# the description of `pcfiledir` in `man pkg-config`.
find ${ROOT}/out/python/install/lib/pkgconfig -name \*.pc -type f -exec \
sed ${sed_args} 's|^prefix=/install|prefix=${pcfiledir}/../..|' {} +

mkdir ${ROOT}/out/python/licenses
cp ${ROOT}/LICENSE.*.txt ${ROOT}/out/python/licenses/
1 change: 0 additions & 1 deletion docs/quirks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ build-time configuration in a handful of files:
``lib/python3.10/_sysconfigdata__linux_x86_64-linux-gnu.py``.
* In a ``Makefile`` under a ``config-*`` directory in the standard library.
e.g. ``lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile``.
* In ``pkgconfig`` files. e.g. ``lib/pkgconfig/python3.pc``.
* In ``python*-config`` files. e.g. ``bin/python3.10-config``.
* In ``PYTHON.json`` (mostly reflected values from ``_sysconfigdata_*.py``.

Expand Down

0 comments on commit dfb68b2

Please sign in to comment.