From c4d88889729c92aead029cf5cabd6b2086ab429e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 22 Dec 2023 17:10:57 +0100 Subject: [PATCH] subprojects: add id3tag --- android/build.py | 1 - meson.build | 3 ++ python/build/libs.py | 18 ----------- subprojects/.gitignore | 1 + subprojects/id3tag.wrap | 9 ++++++ subprojects/packagefiles/id3tag/meson.build | 36 +++++++++++++++++++++ win32/build.py | 1 - 7 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 subprojects/id3tag.wrap create mode 100644 subprojects/packagefiles/id3tag/meson.build diff --git a/android/build.py b/android/build.py index bdf10ace3..8a95c13b1 100755 --- a/android/build.py +++ b/android/build.py @@ -32,7 +32,6 @@ from build.toolchain import AndroidNdkToolchain # a list of third-party libraries to be used by MPD on Android from build.libs import * thirdparty_libs = [ - libid3tag, libmodplug, wildmidi, gme, diff --git a/meson.build b/meson.build index 4e843a4f1..d56f64505 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,7 @@ project( 'flac:default_library=static', 'fmt:default_library=static', 'gtest:default_library=static', + 'id3tag:default_library=static', 'lame:default_library=static', 'libmpdclient:default_library=static', 'liburing:default_library=static', @@ -35,6 +36,8 @@ project( 'flac:warning_level=0', 'fmt:warning_level=0', 'gtest:warning_level=0', + 'id3tag:werror=false', + 'id3tag:warning_level=0', 'lame:werror=false', 'lame:warning_level=0', 'liburing:warning_level=0', diff --git a/python/build/libs.py b/python/build/libs.py index 818d410b1..ae60c27e7 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -25,24 +25,6 @@ zlib = ZlibProject( 'lib/libz.a', ) -libid3tag = AutotoolsProject( - 'ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz', - 'e5808ad997ba32c498803822078748c3', - 'lib/libid3tag.a', - [ - '--disable-shared', '--enable-static', - - # without this, libid3tag's configure.ac ignores -O* and -f* - '--disable-debugging', - ], - autogen=True, - - edits={ - # fix bug in libid3tag's configure.ac which discards all but the last optimization flag - 'configure.ac': lambda data: re.sub(r'optimize="\$1"', r'optimize="$optimize $1"', data, count=1), - } -) - libmodplug = AutotoolsProject( 'https://downloads.sourceforge.net/modplug-xmms/libmodplug/0.8.9.0/libmodplug-0.8.9.0.tar.gz', '457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de', diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 59adee2e2..c2abd9e14 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -6,6 +6,7 @@ /fmt-*/ /googletest-*/ /lame-*/ +/libid3tag-*/ /libmpdclient/ /openssl-*/ /opus-*/ diff --git a/subprojects/id3tag.wrap b/subprojects/id3tag.wrap new file mode 100644 index 000000000..5723b528e --- /dev/null +++ b/subprojects/id3tag.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = libid3tag-0.15.1b +source_url = ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz +source_filename = libid3tag-0.15.1b.tar.gz +source_hash = 63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151 +patch_directory = id3tag + +[provide] +id3tag = libid3tag_dep diff --git a/subprojects/packagefiles/id3tag/meson.build b/subprojects/packagefiles/id3tag/meson.build new file mode 100644 index 000000000..3c56a2f7d --- /dev/null +++ b/subprojects/packagefiles/id3tag/meson.build @@ -0,0 +1,36 @@ +project( + 'libid3tag', 'c', + version: '0.15.1b', + license: 'GPLv2+', +) + +compiler = meson.get_compiler('c') + +conf = configuration_data() +conf.set('HAVE_ASSERT_H', true) +conf.set('HAVE_FTRUNCATE', compiler.has_function('ftruncate')) +conf.set('HAVE_INTTYPES_H', true) +conf.set('HAVE_LIBZ', false) # TODO +conf.set('HAVE_STDINT_H', true) +conf.set('HAVE_STDIO_H', true) +conf.set('HAVE_STDLIB_H', true) +conf.set('HAVE_STRINGS_H', true) +conf.set('HAVE_STRING_H', true) +conf.set('HAVE_SYS_STAT_H', compiler.has_header('sys/stat.h')) +conf.set('HAVE_SYS_TYPES_H', true) +conf.set('HAVE_UNISTD_H', compiler.has_header('unistd.h')) +configure_file(output: 'config.h', configuration: conf) + +add_project_arguments('-DHAVE_CONFIG_H', language: 'c') + +libid3tag = static_library( + 'id3tag', + 'version.c', 'ucs4.c', 'latin1.c', 'utf16.c', 'utf8.c', + 'parse.c', 'render.c', 'field.c', 'frametype.c', 'compat.c', + 'genre.c', 'frame.c', 'crc.c', 'util.c', 'tag.c', 'file.c', +) + +libid3tag_dep = declare_dependency( + link_with: libid3tag, + include_directories: include_directories('.'), +) diff --git a/win32/build.py b/win32/build.py index d43f274ce..898a6167c 100755 --- a/win32/build.py +++ b/win32/build.py @@ -39,7 +39,6 @@ root_path = os.path.join(arch_path, 'root') from build.libs import * thirdparty_libs = [ zlib, - libid3tag, libmodplug, libopenmpt, wildmidi,