diff --git a/android/build.py b/android/build.py index a26aba199..0216bc064 100755 --- a/android/build.py +++ b/android/build.py @@ -32,9 +32,6 @@ from build.toolchain import AndroidNdkToolchain from build.libs import * thirdparty_libs = [ libmpdclient, - libogg, - opus, - flac, libid3tag, libmodplug, wildmidi, diff --git a/meson.build b/meson.build index 7b3b5b2dc..9e196e268 100644 --- a/meson.build +++ b/meson.build @@ -13,20 +13,34 @@ project( # If we build those libraries as Meson subproject, they shall be # linked statically into the MPD executable. 'expat:default_library=static', + 'flac:default_library=static', 'fmt:default_library=static', 'gtest:default_library=static', 'liburing:default_library=static', + 'ogg:default_library=static', + 'opus:default_library=static', 'sqlite3:default_library=static', 'vorbis:default_library=static', # Not interested in compiler warnings from subprojects. 'expat:werror=false', 'expat:warning_level=0', + 'flac:werror=false', + 'flac:warning_level=0', 'fmt:warning_level=0', 'gtest:warning_level=0', 'liburing:warning_level=0', 'sqlite3:warning_level=0', + 'oggiopus:werror=false', + 'ogg:warning_level=0', + 'opus:werror=false', + 'opus:warning_level=0', 'vorbis:warning_level=0', + + # Disable subprojects features we don't need + 'opus:docs=disabled', + 'opus:extra-programs=disabled', + 'opus:tests=disabled', ], license: 'GPLv2+', ) diff --git a/python/build/libs.py b/python/build/libs.py index b4c4c8ec9..451d52ef7 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -26,45 +26,6 @@ libsamplerate = CmakeProject( ], ) -libogg = CmakeProject( - 'http://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.xz', - 'c4d91be36fc8e54deae7575241e03f4211eb102afb3fc0775fbbc1b740016705', - 'lib/libogg.a', - [ - '-DBUILD_SHARED_LIBS=OFF', - '-DINSTALL_DOCS=OFF', - '-DINSTALL_CMAKE_PACKAGE_MODULE=OFF', - ], -) - -opus = AutotoolsProject( - 'https://downloads.xiph.org/releases/opus/opus-1.4.tar.gz', - 'c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f', - 'lib/libopus.a', - [ - '--disable-shared', '--enable-static', - '--disable-doc', - '--disable-extra-programs', - ], - - # suppress "visibility default" from opus_defines.h - cppflags='-DOPUS_EXPORT=', -) - -flac = AutotoolsProject( - 'http://downloads.xiph.org/releases/flac/flac-1.4.3.tar.xz', - '6c58e69cd22348f441b861092b825e591d0b822e106de6eb0ee4d05d27205b70', - 'lib/libFLAC.a', - [ - '--disable-shared', '--enable-static', - '--disable-stack-smash-protection', - '--disable-xmms-plugin', '--disable-cpplibs', - '--disable-doxygen-docs', - '--disable-programs', - ], - subdirs=['include', 'src/libFLAC'], -) - zlib = ZlibProject( ('http://zlib.net/zlib-1.3.tar.xz', 'https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.xz'), diff --git a/subprojects/.gitignore b/subprojects/.gitignore index cc6058d8b..655b5b70b 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1,8 +1,11 @@ /packagecache/ /expat-*/ +/flac-*/ /fmt-*/ /googletest-*/ +/opus-*/ /sqlite-*/ +/libogg-*/ /libvorbis-*/ /liburing-*/ diff --git a/subprojects/flac.wrap b/subprojects/flac.wrap new file mode 100644 index 000000000..281a12886 --- /dev/null +++ b/subprojects/flac.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = flac-1.4.3 +source_url = https://github.com/xiph/flac/releases/download/1.4.3/flac-1.4.3.tar.xz +source_filename = flac-1.4.3.tar.xz +source_hash = 6c58e69cd22348f441b861092b825e591d0b822e106de6eb0ee4d05d27205b70 +patch_filename = flac_1.4.3-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/flac_1.4.3-1/get_patch +patch_hash = fec3d57f99e6e92af351a5d33c98d9aa9dece5ea39c280baac617c1d88817ec9 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/flac_1.4.3-1/flac-1.4.3.tar.xz +wrapdb_version = 1.4.3-1 + +[provide] +flac = flac_dep diff --git a/subprojects/ogg.wrap b/subprojects/ogg.wrap new file mode 100644 index 000000000..e7f23ebf1 --- /dev/null +++ b/subprojects/ogg.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = libogg-1.3.5 +source_url = https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.xz +source_filename = libogg-1.3.5.tar.xz +source_hash = c4d91be36fc8e54deae7575241e03f4211eb102afb3fc0775fbbc1b740016705 +patch_filename = ogg_1.3.5-6_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/ogg_1.3.5-6/get_patch +patch_hash = 8be6dcd5f93bbf9c0b9c8ec1fa29810226a60f846383074ca05b313a248e78b2 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/ogg_1.3.5-6/libogg-1.3.5.tar.xz +wrapdb_version = 1.3.5-6 + +[provide] +ogg = libogg_dep diff --git a/subprojects/opus.wrap b/subprojects/opus.wrap new file mode 100644 index 000000000..513e0dc58 --- /dev/null +++ b/subprojects/opus.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = opus-1.4 +source_url = https://downloads.xiph.org/releases/opus/opus-1.4.tar.gz +source_filename = opus-1.4.tar.gz +source_hash = c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/opus_1.4-1/opus-1.4.tar.gz +wrapdb_version = 1.4-1 + +# fix for https://github.com/xiph/opus/issues/273 +diff_files = opus_have_arm_intrinsics_or_asm.patch + +[provide] +opus = opus_dep diff --git a/subprojects/packagefiles/opus_have_arm_intrinsics_or_asm.patch b/subprojects/packagefiles/opus_have_arm_intrinsics_or_asm.patch new file mode 100644 index 000000000..9519e37b6 --- /dev/null +++ b/subprojects/packagefiles/opus_have_arm_intrinsics_or_asm.patch @@ -0,0 +1,33 @@ +From 20c032d27c59d65b19b8ffbb2608e5282fe817eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= +Date: Thu, 20 Apr 2023 19:06:13 +0100 +Subject: [PATCH] meson: fix build on arm64 + +Would fail like: + +Checking if "compiler supports ARMv7/AArch64 NEON intrinsics" : links: NO +Checking if "compiler supports ARMv7/AArch64 NEON intrinsics with -mfpu=neon" : links: YES +Checking if "compiler supports AArch64 NEON intrinsics" : links: NO +Checking if "compiler supports AArch64 NEON intrinsics with -mfpu=neon" : links: NO +Message: Compiler does not support AArch64 NEON intrinsics +../silk/meson.build:28:45: ERROR: Unknown variable "have_arm_intrinsics_or_asm". + +since commit 08088411259056f63774befb2d00951fdd5c46ba. +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index ed66d3807..9f28de333 100644 +--- a/meson.build ++++ b/meson.build +@@ -574,8 +574,8 @@ foreach l : lines + endforeach + + subdir('include') +-subdir('silk') + subdir('celt') ++subdir('silk') + subdir('src') + + configure_file(output: 'config.h', configuration: opus_conf) diff --git a/win32/build.py b/win32/build.py index cf077bdb0..64e3fdf0f 100755 --- a/win32/build.py +++ b/win32/build.py @@ -39,9 +39,6 @@ root_path = os.path.join(arch_path, 'root') from build.libs import * thirdparty_libs = [ libmpdclient, - libogg, - opus, - flac, zlib, libid3tag, liblame,