meson: work around broken pkg-config file with private requires
In addition to the general issue of staticlibs linkage, linking a static lib to a library() does not seem to generate the needed Libs.private. Rework how we handle this entirely. Instead of relying on convenience libraries, we will *sigh* go extract a boatload of .o files again, then relink those to the installable libalpm, while mentioning our dependencies again. We still have our guaranteed static library for linking arbitrary programs with (e.g. vercmp), and we still only generate one identical copy of the .o files, but now we potentially `ar` it up twice, which isn't so bad. And linking still works, and pkg-config files also still work. One alternative would be to explicitly list our dependencies to pkgconfig.generate with requires_private, but since gpgme might be an elevated config-tool dependency, this can fail with: meson.build:341:10: ERROR: requires argument not a string, library with pkgconfig-generated file or pkgconfig-dependency object, got <GpgmeDependency gpgme: True> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
facd9533b0
commit
0e3a4bd1fb
1 changed files with 10 additions and 12 deletions
16
meson.build
16
meson.build
|
@ -314,24 +314,22 @@ libcommon = static_library(
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
install : false)
|
install : false)
|
||||||
|
|
||||||
|
alpm_deps = [crypto_provider, libarchive, libcurl, gpgme]
|
||||||
|
|
||||||
libalpm_a = static_library(
|
libalpm_a = static_library(
|
||||||
'alpm',
|
'alpm_objlib',
|
||||||
libalpm_sources,
|
libalpm_sources,
|
||||||
# https://github.com/mesonbuild/meson/issues/3937
|
# https://github.com/mesonbuild/meson/issues/3937
|
||||||
objects : libcommon.extract_all_objects(),
|
objects : libcommon.extract_all_objects(),
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
dependencies : [crypto_provider, libarchive, libcurl, gpgme],
|
dependencies : alpm_deps)
|
||||||
install : true)
|
|
||||||
|
|
||||||
if get_option('default_library') != 'static'
|
libalpm = library(
|
||||||
libalpm = library(
|
|
||||||
'alpm',
|
'alpm',
|
||||||
version : libalpm_version,
|
version : libalpm_version,
|
||||||
link_whole: [libalpm_a],
|
objects: libalpm_a.extract_all_objects(recursive: true),
|
||||||
|
dependencies : alpm_deps,
|
||||||
install : true)
|
install : true)
|
||||||
else
|
|
||||||
libalpm = libalpm_a
|
|
||||||
endif
|
|
||||||
|
|
||||||
install_headers(
|
install_headers(
|
||||||
'lib/libalpm/alpm.h',
|
'lib/libalpm/alpm.h',
|
||||||
|
|
Loading…
Add table
Reference in a new issue