Add auditor pass to make pkgconfig files more relocatable
We can have
prefix=${pcfiledir}/../..
in pkgconfig files, instead of
prefix=<absolute path to ${prefix}>
to make pkgconfig files relocatable, see https://manpages.debian.org/stretch/pkg-config/pkg-config.1.en.html. We should have an audit pass to replace that.
How can this be done on a global level? Where should I look trying to fix this?
The auditor code is at https://github.com/JuliaPackaging/BinaryBuilder.jl/blob/49f57bf81242e44c01689a483399c2e2fd7249bf/src/Auditor.jl, but most auditor passes live in https://github.com/JuliaPackaging/BinaryBuilder.jl/tree/49f57bf81242e44c01689a483399c2e2fd7249bf/src/auditor. Basically you need to write a function which looks for the pkgconfig files and edits them on the fly.
A somewhat similar pass (in the sense that it looks for some files based on their name and does something with them) is the one which deletes the libtool files: https://github.com/JuliaPackaging/BinaryBuilder.jl/blob/49f57bf81242e44c01689a483399c2e2fd7249bf/src/Auditor.jl#L189-L210 PR which implemented this pass: #1105