Open djerius opened 5 months ago
Here's my horrible work around. Force a share static install by using the PkgConfig plugin and an impossible exact version:
plugin PkgConfig => ( pkg_name => 'qhullstatic_r', exact_version => 0 );
The probe always fails(🤞), but PkgConfig is now set up to use the proper .pc file for a static share install and I don't have to reimplement its guts. This avoids dealing with the separate .pc files at the cost of not being able to take advantage of a system install.
I'm running into some issues with using the PkgConfig plugin with qhull. The root of this is that
qhull
uses separate pc files for static and dynamic linking, and because of how some Linux distributions (e.g. Debian 12) link their "system" static libraries, they are unable to be linked against the Perl .so file for an XS module. So, system installs need to use dynamic libraries and share installs should use static.Unfortunately, the use of distinct pc files (qhull_r for dynamic, qhullstatic_r for static) breaks the assumptions of PkgConfig, which assumes it can get both static and dynamic flags from the same pc file.
Here's the gist of the workflow:
so, conceptually, this is
But this doesn't work because PkgConfig
An alternative approach might be to write it all out explicitly:
But now the code can no longer take advantage of Plugin::PkgConfig::Negotiate[^1], and I'm also replicating all of the code in the PkgConfig plugin.
I think it would be worth considering
The first could be accomplished by an additional parameter to the plugin, and each plugin's init would react accordingly. The second could be accomplished by paying attention to the
$meta->{phase}
attribute (at least if the plugin is instantiated from an alienfile). I don't foresee a downside to this being the default behavior.[^1]: I note that PkgConfig::Negotiate explicitly refuses to use PkgConfig::CommandLine on Solaris & Windows