From cde93480099454b46cc5398c4f1cd4bd4b44062a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 26 Mar 2019 23:13:54 +0100 Subject: Haiku: fix adding resources The custom_command was run in src/haiku/ and created a file with only resources inside. Since xres edits the file in-place and meson doesn't like it, we have to run a shell script for now. Maybe later I'll add proper support in meson. --- meson.build | 13 ++++++++++++- src/haiku/add_resources.sh | 3 +++ src/haiku/meson.build | 9 +-------- 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100755 src/haiku/add_resources.sh diff --git a/meson.build b/meson.build index 2133c56ed..203191c80 100644 --- a/meson.build +++ b/meson.build @@ -390,6 +390,7 @@ more_deps = [] if is_android subdir('src/java') target_type = 'shared_library' + target_name = 'mpd' link_args += [ '-Wl,--no-undefined,-shared,-Bsymbolic', '-llog', @@ -401,16 +402,18 @@ if is_android ] elif is_haiku target_type = 'executable' + target_name = 'mpd.nores' link_args += [ '-lnetwork', '-lbe', ] else target_type = 'executable' + target_name = 'mpd' endif mpd = build_target( - 'mpd', + target_name, sources, target_type: target_type, include_directories: inc, @@ -449,6 +452,14 @@ endif if is_haiku subdir('src/haiku') + custom_target( + 'mpd', + output: 'mpd', + input: [mpd, rsrc], + command: [addres, '@OUTPUT@', '@INPUT0@', '@INPUT1@'], + install: true, + install_dir: get_option('bindir'), + ) endif configure_file(output: 'config.h', configuration: conf) diff --git a/src/haiku/add_resources.sh b/src/haiku/add_resources.sh new file mode 100755 index 000000000..3303233f2 --- /dev/null +++ b/src/haiku/add_resources.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cp "$2" "$1" && xres -o "$1" -- "$3" && mimeset -f "$1" || (rm -f "$1"; exit 1) diff --git a/src/haiku/meson.build b/src/haiku/meson.build index 7fa0fc108..ff321d60e 100644 --- a/src/haiku/meson.build +++ b/src/haiku/meson.build @@ -8,11 +8,4 @@ rsrc = custom_target( command: [rc, '-o', '@OUTPUT@', '@INPUT@'], ) -custom_target( - 'mpd.xres', - output: 'mpd', - input: [mpd, rsrc], - command: [xres, '-o', '@OUTPUT@', '--', '@INPUT@'], - install: true, - install_dir: get_option('bindir'), -) +addres = files('add_resources.sh') -- cgit v1.2.3