From 9dcd0604f2e48c0e804af56467f042feaa9a4a14 Mon Sep 17 00:00:00 2001 From: Colin Edwards Date: Thu, 18 Jan 2024 12:33:16 -0600 Subject: [PATCH] android: Install the libmpd.so output on android libmpd.so was getting written as a file called `arm64-v8a` instead of `arm64-v8a/libmpd.so` --- android/apk/meson.build | 13 ------------- android/build.py | 2 ++ meson.build | 29 ++++++++++++++++------------- 3 files changed, 18 insertions(+), 26 deletions(-) delete mode 100644 android/apk/meson.build diff --git a/android/apk/meson.build b/android/apk/meson.build deleted file mode 100644 index 72fefa102..000000000 --- a/android/apk/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -android_abi = get_option('android_abi') - -mpd_so = custom_target( - 'libmpd.so', - output: 'libmpd.so', - input: mpd, - command: [ - 'cp', - '@INPUT@', - join_paths(meson.current_source_dir(), '../app/src/main/jnilibs/', android_abi), - ], - build_by_default: true -) diff --git a/android/build.py b/android/build.py index 62225a19a..69ac74730 100755 --- a/android/build.py +++ b/android/build.py @@ -68,3 +68,5 @@ run_meson(toolchain, mpd_path, '.', configure_args) ninja = shutil.which("ninja") subprocess.check_call([ninja], env=toolchain.env) + +subprocess.check_call([ninja, 'install'], env=toolchain.env) diff --git a/meson.build b/meson.build index e54250839..a1308d96f 100644 --- a/meson.build +++ b/meson.build @@ -597,9 +597,13 @@ if is_android declare_dependency(sources: [bridge_header]), java_dep, ] + + android_abi = get_option('android_abi') + install_dir = meson.current_source_dir() / 'android/app/src/main/jnilibs' / android_abi else target_type = 'executable' target_name = 'mpd' + install_dir = '' endif mpd = build_target( @@ -637,28 +641,27 @@ mpd = build_target( ], link_args: link_args, build_by_default: not get_option('fuzzer'), - install: not is_android + install : true, + install_dir: install_dir ) -if is_android - subdir('android/apk') -endif - configure_file(output: 'config.h', configuration: conf) if systemd_dep.found() subdir('systemd') endif -install_data( - 'mpd.svg', - install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'), -) +if not is_android + install_data( + 'mpd.svg', + install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'), + ) -install_data( - 'AUTHORS', 'COPYING', 'NEWS', 'README.md', - install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), -) + install_data( + 'AUTHORS', 'COPYING', 'NEWS', 'README.md', + install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), + ) +endif subdir('doc')