diff --git a/meson.build b/meson.build index 4303e826e..8a2c4102a 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,7 @@ project( 'flac:default_library=static', 'fmt:default_library=static', 'gtest:default_library=static', + 'lame:default_library=static', 'liburing:default_library=static', 'ogg:default_library=static', 'openssl:default_library=static', @@ -33,6 +34,8 @@ project( 'flac:warning_level=0', 'fmt:warning_level=0', 'gtest:warning_level=0', + 'lame:werror=false', + 'lame:warning_level=0', 'liburing:warning_level=0', 'sqlite3:warning_level=0', 'oggiopus:werror=false', @@ -71,6 +74,8 @@ project( 'curl:smtp=disabled', 'curl:telnet=disabled', 'curl:tftp=disabled', + 'lame:decoder=false', + 'lame:tools=disabled', 'openssl:build_cli=false', 'openssl:asm=disabled', # work around "call to undeclared function "asm" on Android 'opus:docs=disabled', diff --git a/python/build/libs.py b/python/build/libs.py index 9f6f0a4f0..d7881316f 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -63,17 +63,6 @@ libmad = AutotoolsProject( autogen=True, ) -liblame = AutotoolsProject( - 'http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz', - 'ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e', - 'lib/libmp3lame.a', - [ - '--disable-shared', '--enable-static', - '--disable-gtktest', '--disable-analyzer-hooks', - '--disable-decoder', '--disable-frontend', - ], -) - libmodplug = AutotoolsProject( 'https://downloads.sourceforge.net/modplug-xmms/libmodplug/0.8.9.0/libmodplug-0.8.9.0.tar.gz', '457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de', diff --git a/src/encoder/plugins/meson.build b/src/encoder/plugins/meson.build index 854c736bb..b0c4aed7b 100644 --- a/src/encoder/plugins/meson.build +++ b/src/encoder/plugins/meson.build @@ -16,7 +16,19 @@ if libvorbisenc_dep.found() encoder_plugins_sources += 'VorbisEncoderPlugin.cxx' endif -liblame_dep = c_compiler.find_library('mp3lame', required: get_option('lame')) +if not get_option('lame').disabled() + # LAME doesn't have a pkg-config file so we have to use + # find_library() + liblame_dep = c_compiler.find_library('mp3lame', required: false) + if not liblame_dep.found() + # only if that was not found, use dependency() which may use the + # LAME subproject + liblame_dep = dependency('mp3lame', required: get_option('lame')) + endif +else + liblame_dep = dependency('', required: false) +endif + encoder_features.set('ENABLE_LAME', liblame_dep.found()) if liblame_dep.found() encoder_plugins_sources += 'LameEncoderPlugin.cxx' diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 07d4120fb..b21704d8a 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -5,6 +5,7 @@ /flac-*/ /fmt-*/ /googletest-*/ +/lame-*/ /openssl-*/ /opus-*/ /sqlite-*/ diff --git a/subprojects/lame.wrap b/subprojects/lame.wrap new file mode 100644 index 000000000..9719ed4f4 --- /dev/null +++ b/subprojects/lame.wrap @@ -0,0 +1,14 @@ +[wrap-file] +directory = lame-3.100 +source_url = http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz +source_filename = lame-3.100.tar.gz +source_hash = ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e +patch_filename = lame_3.100-9_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/lame_3.100-9/get_patch +patch_hash = bedda639a621b2046fb04110a51870d6c9640f2f4282b5d877bc452e9943c22e +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/lame_3.100-9/lame-3.100.tar.gz +wrapdb_version = 3.100-9 + +[provide] +mp3lame = lame_dep +mpglib = mpglib_dep diff --git a/win32/build.py b/win32/build.py index 2c02c58f3..94ed9eed7 100755 --- a/win32/build.py +++ b/win32/build.py @@ -41,7 +41,6 @@ thirdparty_libs = [ libmpdclient, zlib, libid3tag, - liblame, libmodplug, libopenmpt, wildmidi,