meson: use pkg-config from art-standalone instead of manual library search

Replace manual cc.find_library() calls for libart, libnativebridge, and
libandroidfw with a single pkg-config dependency on art-standalone.

This simplifies the build, removes hardcoded library paths, and allows
android-translation-layer to automatically pick up the correct ART
libraries provided by the art-standalone package.
This commit is contained in:
Jonas Heinrich
2025-09-01 12:24:39 +02:00
committed by Mis012
parent e7318f0757
commit a24ab435a8

View File

@@ -9,20 +9,13 @@ add_project_dependencies(incdir_dep, language: 'c')
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
dir_base = meson.current_source_dir() dir_base = meson.current_source_dir()
builddir_base = meson.current_build_dir() builddir_base = meson.current_build_dir()
# FIXME: make art install a pkgconfig file libart_dep = dependency('art-standalone')
libart_dep = [
cc.find_library('art', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]),
cc.find_library('nativebridge', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ])
]
libdl_bio_dep = [ libdl_bio_dep = [
cc.find_library('dl_bio') cc.find_library('dl_bio')
] ]
libc_bio_dep = [ libc_bio_dep = [
cc.find_library('c_bio') cc.find_library('c_bio')
] ]
libandroidfw_dep = [
cc.find_library('androidfw', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]),
]
if fs.is_file('/usr' / get_option('libdir') / 'java/core-all_classes.jar') if fs.is_file('/usr' / get_option('libdir') / 'java/core-all_classes.jar')
bootclasspath_dir = '/usr' / get_option('libdir') / 'java' bootclasspath_dir = '/usr' / get_option('libdir') / 'java'
elif fs.is_file('/usr/local' / get_option('libdir') / 'java/core-all_classes.jar') elif fs.is_file('/usr/local' / get_option('libdir') / 'java/core-all_classes.jar')
@@ -179,7 +172,7 @@ libtranslationlayer_so = shared_library('translation_layer_main', [
dependency('gtk4', version: '>=4.14'), dependency('gl'), dependency('egl'), dependency('wayland-client'), dependency('jni'), dependency('gtk4', version: '>=4.14'), dependency('gl'), dependency('egl'), dependency('wayland-client'), dependency('jni'),
dependency('libportal'), dependency('sqlite3'), dependency('libavcodec', version: '>=59'), dependency('libdrm'), dependency('libportal'), dependency('sqlite3'), dependency('libavcodec', version: '>=59'), dependency('libdrm'),
dependency('gudev-1.0'), dependency('libswscale'), dependency('webkitgtk-6.0'), dependency('gudev-1.0'), dependency('libswscale'), dependency('webkitgtk-6.0'),
libandroidfw_dep, wayland_protos_dep libart_dep, wayland_protos_dep
], ],
link_with: [ libandroid_so ], link_with: [ libandroid_so ],
link_args: [ link_args: [