From fcf487f4e088bb93c5ca841d02e42e6671dbdb3c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 11 Aug 2018 17:16:50 +0200 Subject: [PATCH 01/15] playlist/cue: support file type declaration "FLAC" (non-standard) According to http://wiki.hydrogenaud.io/index.php?title=Cue_sheet FLAC files should use the "WAVE" file type, but I recently encountered CUE files declared as "FLAC" which could not be read by MPD. --- NEWS | 2 ++ src/playlist/cue/CueParser.cxx | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 4f1acfbc4..6e62fe1e8 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ ver 0.20.21 (not yet released) - simple: allow .mpdignore comments only at start of line * output - httpd: remove broken DLNA support code +* playlist + - cue: support file type declaration "FLAC" (non-standard) * URI schemes are case insensitive ver 0.20.20 (2018/05/22) diff --git a/src/playlist/cue/CueParser.cxx b/src/playlist/cue/CueParser.cxx index c61fb09d0..f08078002 100644 --- a/src/playlist/cue/CueParser.cxx +++ b/src/playlist/cue/CueParser.cxx @@ -202,6 +202,7 @@ CueParser::Feed2(char *p) noexcept return; if (strcmp(type, "WAVE") != 0 && + strcmp(type, "FLAC") != 0 && /* non-standard */ strcmp(type, "MP3") != 0 && strcmp(type, "AIFF") != 0) { state = IGNORE_FILE; From 533a3def9f300a2c4cd6f5baa303e6e6f2ae0e14 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 17:04:56 +0200 Subject: [PATCH 02/15] Makefile.am: add missing $(CURL_CFLAGS) and $(EXPAT_CFLAGS) Fixes problems with the Windows build because `-DCURL_STATICLIB` was missing, causing error messages like: "undefined reference to `__imp_curl_slist_free_all'" --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 3ed0c73a8..efbe11dfd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -737,6 +737,8 @@ libstorage_a_SOURCES = \ src/storage/FileInfo.hxx libstorage_a_CPPFLAGS = $(AM_CPPFLAGS) \ + $(CURL_CFLAGS) \ + $(EXPAT_CFLAGS) \ $(NFS_CFLAGS) \ $(SMBCLIENT_CFLAGS) From aaf588aeaa4451dc6bc2bd7101093b559f73aeff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 17:13:35 +0200 Subject: [PATCH 03/15] python/libs: upgrade Boost to 1.68.0 --- 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 f94d9eb71..ceab85c09 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -380,7 +380,7 @@ libnfs = AutotoolsProject( ) boost = BoostProject( - 'http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.bz2', - '5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9', + 'http://downloads.sourceforge.net/project/boost/boost/1.68.0/boost_1_68_0.tar.bz2', + '7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7', 'include/boost/version.hpp', ) From a5cc13b0c5327ab742e2d3a66de63e1d0e02e7a6 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Fri, 17 Aug 2018 02:41:08 -0400 Subject: [PATCH 04/15] build: Add libexpat to the crosscompile build on Windows. The Curl plugin requires libexpat in order to work these days, so we should download and build it in order to get the plugin enabled on Windows. --- NEWS | 2 ++ python/build/libs.py | 9 +++++++++ win32/build.py | 1 + 3 files changed, 12 insertions(+) diff --git a/NEWS b/NEWS index 6e62fe1e8..33e0e0712 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ ver 0.20.21 (not yet released) * playlist - cue: support file type declaration "FLAC" (non-standard) * URI schemes are case insensitive +* Windows + - enable the "curl" storage plugin ver 0.20.20 (2018/05/22) * protocol diff --git a/python/build/libs.py b/python/build/libs.py index ceab85c09..04e14e829 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -364,6 +364,15 @@ curl = AutotoolsProject( patches='src/lib/curl/patches', ) +libexpat = AutotoolsProject( + 'https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2', + '17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2', + 'lib/libexpat.a', + [ + '--disable-shared', '--enable-static', + ], +) + libnfs = AutotoolsProject( 'https://github.com/sahlberg/libnfs/archive/libnfs-3.0.0.tar.gz', '445d92c5fc55e4a5b115e358e60486cf8f87ee50e0103d46a02e7fb4618566a5', diff --git a/win32/build.py b/win32/build.py index 99203a6d6..b3ed4ae55 100755 --- a/win32/build.py +++ b/win32/build.py @@ -86,6 +86,7 @@ thirdparty_libs = [ liblame, ffmpeg, curl, + libexpat, libnfs, boost, ] From dee591d970acf0c00f34820477fa4e509167ac08 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 16:59:40 +0200 Subject: [PATCH 05/15] python/build/libs.py: disable expat documentation --- python/build/libs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/build/libs.py b/python/build/libs.py index 04e14e829..6d647cdaa 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -370,6 +370,7 @@ libexpat = AutotoolsProject( 'lib/libexpat.a', [ '--disable-shared', '--enable-static', + '--without-docbook', ], ) From fb5f9baf9ca835e783dec28b73dd3fd8680d7adf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 17:15:05 +0200 Subject: [PATCH 06/15] android/build.py: enable libexpat for the "curl" storage plugin --- NEWS | 2 +- android/build.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 33e0e0712..0c8f960c5 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,7 @@ ver 0.20.21 (not yet released) * playlist - cue: support file type declaration "FLAC" (non-standard) * URI schemes are case insensitive -* Windows +* Android, Windows - enable the "curl" storage plugin ver 0.20.20 (2018/05/22) diff --git a/android/build.py b/android/build.py index ee64d3059..4c26f9c4c 100755 --- a/android/build.py +++ b/android/build.py @@ -146,6 +146,7 @@ thirdparty_libs = [ libid3tag, ffmpeg, curl, + libexpat, libnfs, boost, ] From c6299c26b524f5f7485ff66331c7375aa971e34c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 18:32:03 +0200 Subject: [PATCH 07/15] python/build/libs.py: disable libnfs utils/examples --- python/build/libs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/build/libs.py b/python/build/libs.py index 6d647cdaa..e4f621daf 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -384,6 +384,8 @@ libnfs = AutotoolsProject( # work around -Wtautological-compare '--disable-werror', + + '--disable-utils', '--disable-examples', ], base='libnfs-libnfs-3.0.0', autoreconf=True, From 76290f786d517f65b4b6b735dc120daa959b1fd5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 18:10:00 +0200 Subject: [PATCH 08/15] python/build/meson.py: set "needs_exe_wrapper=true" Prevent Meson from running Android-x86 binaries. That will fail because the Android standard libraries are most likely not installed. --- python/build/meson.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/build/meson.py b/python/build/meson.py index 4cda8ec2a..55bd1c554 100644 --- a/python/build/meson.py +++ b/python/build/meson.py @@ -51,6 +51,9 @@ c_link_args = %s cpp_args = %s cpp_link_args = %s +# Keep Meson from executing Android-x86 test binariees +needs_exe_wrapper = true + [host_machine] system = '%s' cpu_family = '%s' From 36edb4886c371b90bdc27eed305f112196dfb765 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 18:27:06 +0200 Subject: [PATCH 09/15] android/build.py: add variable "android_api_level" --- android/build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/build.py b/android/build.py index 4c26f9c4c..33f08151e 100755 --- a/android/build.py +++ b/android/build.py @@ -65,7 +65,8 @@ class AndroidNdkToolchain: self.build_path = build_path ndk_arch = abi_info['ndk_arch'] - ndk_platform = 'android-14' + android_api_level = '14' + ndk_platform = 'android-' + android_api_level # select the NDK compiler gcc_version = '4.9' @@ -106,7 +107,7 @@ class AndroidNdkToolchain: self.cppflags = '--sysroot=' + sysroot + \ ' -isystem ' + os.path.join(install_prefix, 'include') + \ ' -isystem ' + os.path.join(sysroot, 'usr', 'include', arch) + \ - ' -D__ANDROID_API__=14' + ' -D__ANDROID_API__=' + android_api_level self.ldflags = '--sysroot=' + sysroot + \ ' -L' + os.path.join(install_prefix, 'lib') + \ ' -L' + os.path.join(target_root, 'usr', 'lib') + \ From 98efb4f6d518765af5a9f9d86fffc33a94056fdb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 18:44:05 +0200 Subject: [PATCH 10/15] android: raise minSdkVersion to 21 The number of MPD installs on Android < 5.0 is negligible, and that API version introduces lots of useful features for MPD. --- Makefile.am | 2 +- android/AndroidManifest.xml | 2 +- android/build.py | 2 +- android/src/Main.java | 2 +- src/input/plugins/FileInputPlugin.cxx | 3 --- src/system/EPollFD.cxx | 15 --------------- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Makefile.am b/Makefile.am index efbe11dfd..95f888ff9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -294,7 +294,7 @@ libmpd.so: $(filter %.a,$(src_mpd_LDADD)) libmain.a $(AM_V_CXXLD)$(CXXLD) -shared -Wl,--no-undefined,-shared,-Bsymbolic -llog -lz -o $@ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) src/libmain_a-Main.o $(src_mpd_LDADD) $(LIBS) ANDROID_SDK_BUILD_TOOLS_VERSION = 27.0.0 -ANDROID_SDK_PLATFORM = android-17 +ANDROID_SDK_PLATFORM = android-21 ANDROID_BUILD_TOOLS_DIR = $(ANDROID_SDK)/build-tools/$(ANDROID_SDK_BUILD_TOOLS_VERSION) ANDROID_SDK_PLATFORM_DIR = $(ANDROID_SDK)/platforms/$(ANDROID_SDK_PLATFORM) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 09536d9c1..b6abd1124 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionCode="20" android:versionName="0.20.21"> - + = 21 - /* posix_fadvise() requires Android API 21 */ #ifdef POSIX_FADV_SEQUENTIAL posix_fadvise(reader.GetFD().Get(), (off_t)0, info.GetSize(), POSIX_FADV_SEQUENTIAL); -#endif #endif return InputStreamPtr(new FileInputStream(path.ToUTF8().c_str(), diff --git a/src/system/EPollFD.cxx b/src/system/EPollFD.cxx index 39ddbca5e..d9200ed41 100644 --- a/src/system/EPollFD.cxx +++ b/src/system/EPollFD.cxx @@ -22,21 +22,6 @@ #include "EPollFD.hxx" #include "FatalError.hxx" -#if defined(__BIONIC__) && __ANDROID_API__ < 21 - -#include -#include - -#define EPOLL_CLOEXEC O_CLOEXEC - -static inline int -epoll_create1(int flags) -{ - return syscall(__NR_epoll_create1, flags); -} - -#endif - EPollFD::EPollFD() :fd(::epoll_create1(EPOLL_CLOEXEC)) { From a4e0b524687bcc036bb81a8211c7664bf5c081bb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 18:58:56 +0200 Subject: [PATCH 11/15] configure.ac, Makefile.am: add variable ANDROID_ABI --- Makefile.am | 4 ++-- configure.ac | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 95f888ff9..c1cda5605 100644 --- a/Makefile.am +++ b/Makefile.am @@ -341,7 +341,7 @@ android/build/include/org_musicpd_Bridge.h: android/build/classes.dex BUILT_SOURCES = android/build/include/org_musicpd_Bridge.h -android/build/lib/armeabi-v7a/libmpd.so: libmpd.so +android/build/lib/$(ANDROID_ABI)/libmpd.so: libmpd.so mkdir -p $(@D) rm -f $@ $(STRIP) -o $@ $< @@ -351,7 +351,7 @@ android/build/res/drawable/icon.png: mpd.svg rsvg-convert --width=48 --height=48 $< -o $@ .DELETE_ON_ERROR: android/build/unsigned.apk -android/build/unsigned.apk: android/build/classes.dex android/build/resources.apk android/build/lib/armeabi-v7a/libmpd.so +android/build/unsigned.apk: android/build/classes.dex android/build/resources.apk android/build/lib/$(ANDROID_ABI)/libmpd.so cp android/build/resources.apk $@ cd $(dir $@) && zip -q -r $(notdir $@) classes.dex lib diff --git a/configure.ac b/configure.ac index 2e518df98..3fc74e768 100644 --- a/configure.ac +++ b/configure.ac @@ -186,6 +186,7 @@ AC_ARG_WITH([android-sdk], [Directory for Android SDK]), [], [with_android_sdk=no]) +android_abi="" if test x$host_is_android = xyes; then if test x$with_android_sdk = xno; then AC_MSG_ERROR([Android build requires option --with-android-sdk=DIR]) @@ -194,9 +195,12 @@ if test x$host_is_android = xyes; then if ! test -x $with_android_sdk/tools/android; then AC_MSG_ERROR([Android SDK not found in $with_android_sdk]) fi + + android_abi="armeabi-v7a" fi AC_SUBST(ANDROID_SDK, [$with_android_sdk]) +AC_SUBST(ANDROID_ABI, [$android_abi]) dnl --------------------------------------------------------------------------- dnl Language Checks From 6b407356b9d3564c2406c648c611f337f4d419fa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 19:03:31 +0200 Subject: [PATCH 12/15] configure.ac: set ANDROID_ABI=x86 for the Android-x86 build This was missing in commit 8266ab5588c for #69. --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3fc74e768..21f37a516 100644 --- a/configure.ac +++ b/configure.ac @@ -196,7 +196,9 @@ if test x$host_is_android = xyes; then AC_MSG_ERROR([Android SDK not found in $with_android_sdk]) fi - android_abi="armeabi-v7a" + AS_CASE([$host_cpu], + [i686], [android_abi="x86"], + [android_abi="armeabi-v7a"]) fi AC_SUBST(ANDROID_SDK, [$with_android_sdk]) From 12bc625fe1141c2d9e37b7aa0ca827bbf3804ffe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 17:53:46 +0200 Subject: [PATCH 13/15] android/build.py: add aarch64 support --- android/build.py | 10 ++++++++++ configure.ac | 1 + python/build/ffmpeg.py | 2 ++ python/build/meson.py | 3 +++ win32/build.py | 1 + 5 files changed, 17 insertions(+) diff --git a/android/build.py b/android/build.py index 2b29a3fcd..caf85f06c 100755 --- a/android/build.py +++ b/android/build.py @@ -29,6 +29,15 @@ android_abis = { 'cflags': '-march=armv7-a -mfpu=vfp -mfloat-abi=softfp', }, + 'arm64-v8a': { + 'android_api_level': '21', + 'arch': 'aarch64-linux-android', + 'ndk_arch': 'arm64', + 'toolchain_arch': 'aarch64-linux-android', + 'llvm_triple': 'aarch64-none-linux-android', + 'cflags': '', + }, + 'x86': { 'arch': 'i686-linux-android', 'ndk_arch': 'x86', @@ -117,6 +126,7 @@ class AndroidNdkToolchain: self.is_arm = ndk_arch == 'arm' self.is_armv7 = self.is_arm and 'armv7' in self.cflags + self.is_aarch64 = ndk_arch == 'arm64' self.is_windows = False libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++') diff --git a/configure.ac b/configure.ac index 21f37a516..994c75aae 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,7 @@ if test x$host_is_android = xyes; then AS_CASE([$host_cpu], [i686], [android_abi="x86"], + [aarch64], [android_abi="arm64-v8a"], [android_abi="armeabi-v7a"]) fi diff --git a/python/build/ffmpeg.py b/python/build/ffmpeg.py index d75e98044..6c0753618 100644 --- a/python/build/ffmpeg.py +++ b/python/build/ffmpeg.py @@ -21,6 +21,8 @@ class FfmpegProject(Project): if toolchain.is_arm: arch = 'arm' + elif toolchain.is_aarch64: + arch = 'aarch64' else: arch = 'x86' diff --git a/python/build/meson.py b/python/build/meson.py index 55bd1c554..427d51f0f 100644 --- a/python/build/meson.py +++ b/python/build/meson.py @@ -20,6 +20,9 @@ class MesonProject(Project): cpu = 'armv7' else: cpu = 'armv6' + elif toolchain.is_aarch64: + cpu_family = 'aarch64' + cpu = 'arm64-v8a' else: cpu_family = 'x86' if 'x86_64' in toolchain.arch: diff --git a/win32/build.py b/win32/build.py index b3ed4ae55..061bae8c6 100755 --- a/win32/build.py +++ b/win32/build.py @@ -65,6 +65,7 @@ class CrossGccToolchain: self.is_arm = arch.startswith('arm') self.is_armv7 = self.is_arm and 'armv7' in self.cflags + self.is_aarch64 = arch == 'aarch64' self.is_windows = 'mingw32' in arch self.env = dict(os.environ) From ddc85c620f4efcbd90fbb064abb0731710042b95 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 19:50:32 +0200 Subject: [PATCH 14/15] configure.ac: make the GIT_COMMIT command worktree-safe `$srcdir/.git` doesn't exist if `$srcdir` is a worktree. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 994c75aae..1d33ffb94 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_DEFINE(PROTOCOL_VERSION, "0.20.0", [The MPD protocol version]) -GIT_COMMIT=`GIT_DIR="$srcdir/.git" git describe --dirty --always 2>/dev/null` +GIT_COMMIT=`cd "$srcdir" && git describe --dirty --always 2>/dev/null` if test x$GIT_COMMIT != x; then AC_DEFINE_UNQUOTED(GIT_COMMIT, ["$GIT_COMMIT"], [The current git commit]) fi From 98afae2520fbe5a322f803335b3142612fda4762 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 17 Aug 2018 19:50:59 +0200 Subject: [PATCH 15/15] release v0.20.21 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0c8f960c5..21a2138d7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.20.21 (not yet released) +ver 0.20.21 (2018/08/17) * database - proxy: add "password" setting - proxy: support tags "ArtistSort", "AlbumArtistSort", "AlbumSort"