From 9d0bf5e95cb09e3e7ab7c8c46398fdc01c05f646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 26 Mar 2019 21:09:30 +0100 Subject: [PATCH 01/14] Haiku: fix build --- NEWS | 2 ++ src/haiku/meson.build | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 31990d63a..2b44b2909 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.21.7 (not yet released) * require Meson 0.49.0 for native libgcrypt-config support * fix build failure with -Dlocal_socket=false +* Haiku + - fix build ver 0.21.6 (2019/03/17) * protocol diff --git a/src/haiku/meson.build b/src/haiku/meson.build index 36b634420..7fa0fc108 100644 --- a/src/haiku/meson.build +++ b/src/haiku/meson.build @@ -1,5 +1,5 @@ -rc = meson.find_program('rc') -xres = meson.find_program('xres') +rc = find_program('rc') +xres = find_program('xres') rsrc = custom_target( 'mpd.rsrc', @@ -9,7 +9,7 @@ rsrc = custom_target( ) custom_target( - 'mpd.rsrc', + 'mpd.xres', output: 'mpd', input: [mpd, rsrc], command: [xres, '-o', '@OUTPUT@', '--', '@INPUT@'], From 095e6e6ad4808650a5bc6fe0a969de3c491353bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 26 Mar 2019 21:19:20 +0100 Subject: [PATCH 02/14] Haiku: meson.build: fix linking (missing libs) --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index bafe9990e..2133c56ed 100644 --- a/meson.build +++ b/meson.build @@ -399,6 +399,12 @@ if is_android declare_dependency(sources: [classes_jar]), java_dep, ] +elif is_haiku + target_type = 'executable' + link_args += [ + '-lnetwork', + '-lbe', + ] else target_type = 'executable' endif 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: [PATCH 03/14] 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') From 37a0f047122163a23fb8a09ad7a57b6302e2ea40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 26 Mar 2019 23:44:08 +0100 Subject: [PATCH 04/14] Haiku: add version info to the resources like win32 does --- NEWS | 1 + src/haiku/meson.build | 17 ++++++++++++++++- src/haiku/{mpd.rdef => mpd.rdef.in} | 10 +++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) rename src/haiku/{mpd.rdef => mpd.rdef.in} (93%) diff --git a/NEWS b/NEWS index 2b44b2909..b93d711b5 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.21.7 (not yet released) * fix build failure with -Dlocal_socket=false * Haiku - fix build + - add version info ver 0.21.6 (2019/03/17) * protocol diff --git a/src/haiku/meson.build b/src/haiku/meson.build index ff321d60e..390ecff17 100644 --- a/src/haiku/meson.build +++ b/src/haiku/meson.build @@ -1,10 +1,25 @@ +haiku_conf = configuration_data() +haiku_conf.set('VERSION', meson.project_version()) + +splitted_version = meson.project_version().split('~')[0].split('.') +haiku_conf.set('VERSION_MAJOR', splitted_version[0]) +haiku_conf.set('VERSION_MINOR', splitted_version.get(1, '0')) +haiku_conf.set('VERSION_REVISION', splitted_version.get(2, '0')) +haiku_conf.set('VERSION_EXTRA', splitted_version.get(3, '0')) + +mpd_rdef = configure_file( + input: 'mpd.rdef.in', + output: 'mpd.rdef', + configuration: haiku_conf, +) + rc = find_program('rc') xres = find_program('xres') rsrc = custom_target( 'mpd.rsrc', output: 'mpd.rsrc', - input: 'mpd.rdef', + input: mpd_rdef, command: [rc, '-o', '@OUTPUT@', '@INPUT@'], ) diff --git a/src/haiku/mpd.rdef b/src/haiku/mpd.rdef.in similarity index 93% rename from src/haiku/mpd.rdef rename to src/haiku/mpd.rdef.in index 6f1aca2d9..c4dbea63c 100644 --- a/src/haiku/mpd.rdef +++ b/src/haiku/mpd.rdef.in @@ -2,7 +2,15 @@ resource app_signature "application/x-vnd.MusicPD"; resource app_flags B_BACKGROUND_APP; -// TODO: resource app_version {}; +resource app_version { + major = @VERSION_MAJOR@, + middle = @VERSION_MINOR@, + minor = @VERSION_REVISION@, + variety = B_APPV_ALPHA, + internal = @VERSION_EXTRA@, + short_info = "Music Player Daemon @VERSION@", + long_info = "Music Player Daemon @VERSION@ ©The Music Player Daemon Project" +}; resource vector_icon { $"6E6369661F050102031604BEE29BBEC5403EC540BEE29B4A10004A10000001C6" From 0d8942e64a0e1ef860e31a81246a0d17bbfda075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 27 Mar 2019 00:39:24 +0100 Subject: [PATCH 05/14] Haiku: remove redundant calls to delete_sem() Fixes #184. Semaphores are kernel-managed objects, calling delete_sem() twice is not more dangerous than calling close() twice on an fd though, it would just return an error. --- src/output/plugins/HaikuOutputPlugin.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/output/plugins/HaikuOutputPlugin.cxx b/src/output/plugins/HaikuOutputPlugin.cxx index 5d8cbf374..86fa7baf5 100644 --- a/src/output/plugins/HaikuOutputPlugin.cxx +++ b/src/output/plugins/HaikuOutputPlugin.cxx @@ -140,9 +140,6 @@ HaikuOutput::Close() noexcept HaikuOutput::~HaikuOutput() { - delete_sem(new_buffer); - delete_sem(buffer_done); - finalize_application(); } From 976731ab6cc88b88a71179f9ed4b27cbdc3c54da Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Mar 2019 17:01:31 +0100 Subject: [PATCH 06/14] command/playlist: invoke the RemoteTagScanner on all newly added songs Closes https://github.com/MusicPlayerDaemon/MPD/issues/234 --- NEWS | 2 ++ src/command/PlaylistCommands.cxx | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b93d711b5..7c1efe15d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.7 (not yet released) +* input + - qobuz/tidal: scan tags when loading a playlist * require Meson 0.49.0 for native libgcrypt-config support * fix build failure with -Dlocal_socket=false * Haiku diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx index 858cd2029..89b64ff6f 100644 --- a/src/command/PlaylistCommands.cxx +++ b/src/command/PlaylistCommands.cxx @@ -20,6 +20,7 @@ #include "config.h" #include "PlaylistCommands.hxx" #include "Request.hxx" +#include "Instance.hxx" #include "db/DatabasePlaylist.hxx" #include "CommandError.hxx" #include "PlaylistSave.hxx" @@ -27,6 +28,7 @@ #include "PlaylistError.hxx" #include "db/PlaylistVector.hxx" #include "SongLoader.hxx" +#include "song/DetachedSong.hxx" #include "BulkEdit.hxx" #include "playlist/PlaylistQueue.hxx" #include "playlist/Print.hxx" @@ -76,11 +78,21 @@ handle_load(Client &client, Request args, gcc_unused Response &r) const ScopeBulkEdit bulk_edit(client.GetPartition()); + auto &playlist = client.GetPlaylist(); + const unsigned old_size = playlist.GetLength(); + const SongLoader loader(client); playlist_open_into_queue(uri, range.start, range.end, - client.GetPlaylist(), + playlist, client.GetPlayerControl(), loader); + + /* invoke the RemoteTagScanner on all newly added songs */ + auto &instance = client.GetInstance(); + const unsigned new_size = playlist.GetLength(); + for (unsigned i = old_size; i < new_size; ++i) + instance.LookupRemoteTag(playlist.queue.Get(i).GetURI()); + return CommandResult::OK; } From 2e9f3d8b9fb873446f6e39a917e83cb763c92781 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Mar 2019 17:15:43 +0100 Subject: [PATCH 07/14] decoder/HybridDSD: downgrade log message to "debug" This plugin is interesting only for a tiny fraction of MPD users, so let's not spam everybody else's log with it. --- src/decoder/plugins/HybridDsdDecoderPlugin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decoder/plugins/HybridDsdDecoderPlugin.cxx b/src/decoder/plugins/HybridDsdDecoderPlugin.cxx index 9ff8802e4..3b46de0f1 100644 --- a/src/decoder/plugins/HybridDsdDecoderPlugin.cxx +++ b/src/decoder/plugins/HybridDsdDecoderPlugin.cxx @@ -39,8 +39,8 @@ InitHybridDsdDecoder(const ConfigBlock &block) without a DSD DAC, the PCM (=ALAC) part of the file is better */ if (block.GetBlockParam("enabled") == nullptr) { - LogInfo(hybrid_dsd_domain, - "The Hybrid DSD decoder is disabled because it was not explicitly enabled"); + LogDebug(hybrid_dsd_domain, + "The Hybrid DSD decoder is disabled because it was not explicitly enabled"); return false; } From fb7daa0d059110297b975a830043ec700e510c0c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Mar 2019 17:32:23 +0100 Subject: [PATCH 08/14] input/smbclient: use std::throw_with_nested() to construct PluginUnavailable Preserve the original exception. --- src/input/plugins/SmbclientInputPlugin.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/input/plugins/SmbclientInputPlugin.cxx b/src/input/plugins/SmbclientInputPlugin.cxx index 4469dbab5..b4b0785f8 100644 --- a/src/input/plugins/SmbclientInputPlugin.cxx +++ b/src/input/plugins/SmbclientInputPlugin.cxx @@ -28,8 +28,6 @@ #include -#include - class SmbclientInputStream final : public InputStream { SMBCCTX *ctx; int fd; @@ -72,9 +70,8 @@ input_smbclient_init(EventLoop &, const ConfigBlock &) { try { SmbclientInit(); - } catch (const std::runtime_error &e) { - // TODO: use std::throw_with_nested()? - throw PluginUnavailable(e.what()); + } catch (...) { + std::throw_with_nested(PluginUnavailable("libsmbclient initialization failed")); } // TODO: create one global SMBCCTX here? From 5201147ab1f13eb57eb5d726eb44af97de526e35 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Mar 2019 17:33:11 +0100 Subject: [PATCH 09/14] input/curl: use std::throw_with_nested() instead of logging the exception Let the caller decide what to do with the original exception. --- src/input/plugins/CurlInputPlugin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 74d28fde0..b16f1eb84 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -306,9 +306,8 @@ input_curl_init(EventLoop &event_loop, const ConfigBlock &block) { try { curl_init = new CurlInit(event_loop); - } catch (const std::runtime_error &e) { - LogError(e); - throw PluginUnavailable(e.what()); + } catch (...) { + std::throw_with_nested(PluginUnavailable("CURL initialization failed")); } const auto version_info = curl_version_info(CURLVERSION_FIRST); From 9776e43bbe6066ba38d6321e07e86c3f7e2b41ba Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2019 11:28:59 +0200 Subject: [PATCH 10/14] android/AndroidManifest.xml: update version number --- android/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index c0dfc58fb..e2672f984 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="29" + android:versionName="0.21.7"> From fef839e2a9a66f8cd8d2ae103b1dbd7aa11a5136 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2019 11:34:32 +0200 Subject: [PATCH 11/14] python/build/libs.py: upgrade FFmpeg to 4.1.3 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 8fc1f2258..e7f1ad9af 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -112,8 +112,8 @@ liblame = AutotoolsProject( ) ffmpeg = FfmpegProject( - 'http://ffmpeg.org/releases/ffmpeg-4.1.1.tar.xz', - '373749824dfd334d84e55dff406729edfd1606575ee44dd485d97d45ea4d2d86', + 'http://ffmpeg.org/releases/ffmpeg-4.1.3.tar.xz', + '0c3020452880581a8face91595b239198078645e7d7184273b8bcc7758beb63d', 'lib/libavcodec.a', [ '--disable-shared', '--enable-static', From e183ab5cf839d61ed2d90dc44b3ca17700da5f00 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2019 11:35:13 +0200 Subject: [PATCH 12/14] python/build/libs.py: upgrade CURL to 7.64.1 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index e7f1ad9af..fc7cd345e 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -341,8 +341,8 @@ ffmpeg = FfmpegProject( ) curl = AutotoolsProject( - 'http://curl.haxx.se/download/curl-7.64.0.tar.xz', - '2f2f13fa34d44aa29cb444077ad7dc4dc6d189584ad552e0aaeb06e608af6001', + 'http://curl.haxx.se/download/curl-7.64.1.tar.xz', + '9252332a7f871ce37bfa7f78bdd0a0e3924d8187cc27cb57c76c9474a7168fb3', 'lib/libcurl.a', [ '--disable-shared', '--enable-static', From 158458db5fc95f0f91b816a9374a207e73c9646d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2019 11:37:11 +0200 Subject: [PATCH 13/14] python/build/libs.py: upgrade libnfs to 4.0.0 --- python/build/libs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index fc7cd345e..ac7984afb 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -375,8 +375,8 @@ libexpat = AutotoolsProject( ) libnfs = AutotoolsProject( - 'https://github.com/sahlberg/libnfs/archive/libnfs-3.0.0.tar.gz', - '445d92c5fc55e4a5b115e358e60486cf8f87ee50e0103d46a02e7fb4618566a5', + 'https://github.com/sahlberg/libnfs/archive/libnfs-4.0.0.tar.gz', + '6ee77e9fe220e2d3e3b1f53cfea04fb319828cc7dbb97dd9df09e46e901d797d', 'lib/libnfs.a', [ '--disable-shared', '--enable-static', @@ -387,7 +387,7 @@ libnfs = AutotoolsProject( '--disable-utils', '--disable-examples', ], - base='libnfs-libnfs-3.0.0', + base='libnfs-libnfs-4.0.0', autoreconf=True, ) From ef10354d06f042a795f5ced365baf375300e7b7c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2019 12:18:29 +0200 Subject: [PATCH 14/14] release v0.21.7 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 7c1efe15d..9cfeb1115 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.21.7 (not yet released) +ver 0.21.7 (2019/04/03) * input - qobuz/tidal: scan tags when loading a playlist * require Meson 0.49.0 for native libgcrypt-config support