[libsndfile] Update to 1.1.0 (#23800)

* [libsndfile] Update to 1.1.0

* Update to 1.1.0
* Add `mpeg` and `regtest` features to sync with upstream.

* Add fix for mp3lame

* Stop using deprecated functions

* Update versions

* Update fix

* Update versions

* More fixes

* More updates
This commit is contained in:
evpobr 2022-04-07 20:05:01 +05:00 committed by GitHub
parent c3ff2bffff
commit d0f5e56832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 145 additions and 13 deletions

View File

@ -0,0 +1,73 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1b49e9..ae8ebec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -174,7 +174,7 @@ set_package_properties (FLAC PROPERTIES
DESCRIPTION "Free Lossless Audio Codec Library"
PURPOSE "Enables FLAC support"
)
-set_package_properties (Lame PROPERTIES
+set_package_properties (mp3lame PROPERTIES
TYPE RECOMMENDED
URL "https://lame.sourceforge.io/"
DESCRIPTION "High quality MPEG Audio Layer III (MP3) encoder"
@@ -237,20 +237,7 @@ if (INSTALL_PKGCONFIG_MODULE)
endif ()
if (ENABLE_MPEG)
set (EXTERNAL_MPEG_REQUIRE "libmpg123")
- get_filename_component(LAME_WE ${LAME_LIBRARY} NAME_WE)
- if (LAME_HIP_LIBRARY)
- get_filename_component(LAME_HIP_WE ${LAME_HIP_LIBRARY} NAME_WE)
- endif ()
- if (CMAKE_IMPORT_LIBRARY_PREFIX)
- string (REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" LAME_WE_NO_PREFIX ${LAME_WE})
- if (LAME_HIP_LIBRARY)
- string (REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" LAME_HIP_WE_NO_PREFIX ${LAME_HIP_WE})
- endif ()
- endif ()
- set (EXTERNAL_MPEG_LIBS "-l${LAME_WE_NO_PREFIX}")
- if (LAME_HIP_LIBRARY)
- set (EXTERNAL_MPEG_LIBS "${MPEG_LIBS} -l${LAME_HIP_WE}")
- endif ()
+ set (EXTERNAL_MPEG_LIBS "-lmp3lame")
endif ()
configure_file (sndfile.pc.in sndfile.pc @ONLY)
@@ -411,7 +398,7 @@ target_link_libraries (sndfile
$<$<AND:$<BOOL:${ENABLE_EXPERIMENTAL}>,$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>,$<BOOL:${HAVE_SPEEX}>>:Speex::Speex>
$<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Opus::opus>
$<$<BOOL:${HAVE_MPEG}>:MPG123::libmpg123>
- $<$<BOOL:${HAVE_MPEG}>:Lame::Lame>
+ $<$<BOOL:${HAVE_MPEG}>:mp3lame::mp3lame>
)
set_target_properties (sndfile PROPERTIES
PUBLIC_HEADER "${sndfile_HDRS}"
diff --git a/cmake/SndFileChecks.cmake b/cmake/SndFileChecks.cmake
index f5d5994..2e09ba6 100644
--- a/cmake/SndFileChecks.cmake
+++ b/cmake/SndFileChecks.cmake
@@ -56,9 +56,9 @@ else ()
set (HAVE_EXTERNAL_XIPH_LIBS 0)
endif ()
-find_package (Lame)
+find_package (mp3lame)
find_package (Mpg123 1.25.10)
-if (LAME_FOUND AND (TARGET MPG123::libmpg123))
+if (TARGET mp3lame::mp3lame AND (TARGET MPG123::libmpg123))
set (HAVE_MPEG_LIBS 1)
else ()
set (HAVE_MPEG_LIBS 0)
diff --git a/cmake/SndFileConfig.cmake.in b/cmake/SndFileConfig.cmake.in
index 1d5463a..0c98e7e 100644
--- a/cmake/SndFileConfig.cmake.in
+++ b/cmake/SndFileConfig.cmake.in
@@ -18,7 +18,7 @@ if (SndFile_WITH_EXTERNAL_LIBS AND NOT @BUILD_SHARED_LIBS@)
endif ()
if (SndFile_WITH_MPEG AND NOT @BUILD_SHARED_LIBS@)
- find_dependency (Lame)
+ find_dependency (mp3lame)
find_dependency (MPG123)
endif ()

View File

@ -0,0 +1,14 @@
diff --git a/src/file_io.c b/src/file_io.c
index 334ba2a..90c9608 100644
--- a/src/file_io.c
+++ b/src/file_io.c
@@ -827,9 +827,6 @@ psf_open_handle (PSF_FILE * pfile)
} ;
#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
- if (!pfile->use_wchar)
- return INVALID_HANDLE_VALUE ;
-
CREATEFILE2_EXTENDED_PARAMETERS cfParams = { 0 } ;
cfParams.dwSize = sizeof (CREATEFILE2_EXTENDED_PARAMETERS) ;
cfParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL ;

View File

@ -1,9 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsndfile/libsndfile
REF 1.0.31
SHA512 5767ced306f2d300aa2014d383c22f3ee9a4fe1ffb2c463405bc26209ede09a9cfb95e1c08256db36e986d2b30151c38dbe635a3cae0b7138d7de485e2084891
REF 1.1.0
SHA512 5e530c33165a2d2be1c22d3a4bd96f0f1817dded3a45d24bad0e3f2c7908ccc1f19327a91d5040c3ea4d591845876019180747a125bf2a6f8bd49a6f67eadacd
HEAD_REF master
PATCHES
fix-mp3lame.patch
fix-uwp.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
@ -11,24 +14,31 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES external-libs ENABLE_EXTERNAL_LIBS
FEATURES
external-libs ENABLE_EXTERNAL_LIBS
mpeg ENABLE_MPEG
regtest BUILD_REGTEST
)
vcpkg_configure_cmake(
if(VCPKG_TARGET_IS_UWP)
set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}")
set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}")
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_EXAMPLES=OFF
-DBUILD_REGTEST=OFF
-DBUILD_TESTING=OFF
-DENABLE_BOW_DOCS=OFF
-DBUILD_PROGRAMS=OFF
-DBUILD_REGTEST=OFF
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
-DPYTHON_EXECUTABLE=${PYTHON3}
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_cmake_install()
if(WIN32 AND (NOT MINGW) AND (NOT CYGWIN))
set(CONFIG_PATH cmake)
@ -36,7 +46,7 @@ else()
set(CONFIG_PATH lib/cmake/SndFile)
endif()
vcpkg_fixup_cmake_targets(CONFIG_PATH ${CONFIG_PATH} TARGET_PATH share/SndFile)
vcpkg_cmake_config_fixup(PACKAGE_NAME SndFile CONFIG_PATH ${CONFIG_PATH})
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
vcpkg_copy_pdbs()

View File

@ -1,20 +1,50 @@
{
"name": "libsndfile",
"version-string": "1.0.31",
"description": "Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo",
"version-semver": "1.1.0",
"description": "A library for reading and writing audio files",
"homepage": "https://github.com/erikd/libsndfile",
"license": "LGPL-2.1",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"external-libs"
"external-libs",
"mpeg"
],
"features": {
"experimental": {
"description": "Enable experimental code",
"dependencies": [
"speex"
]
},
"external-libs": {
"description": "Default feature. Enables Ogg Vorbis, FLAC and Ogg Opus formats support.",
"description": "Enable FLAC, Vorbis, and Opus codecs",
"dependencies": [
"libflac",
"libvorbis",
"opus"
]
},
"mpeg": {
"description": "Enable MPEG codecs",
"dependencies": [
"mp3lame",
"mpg123"
]
},
"regtest": {
"description": "Build regtest",
"dependencies": [
"sqlite3"
]
}
}
}

View File

@ -3985,7 +3985,7 @@
"port-version": 1
},
"libsndfile": {
"baseline": "1.0.31",
"baseline": "1.1.0",
"port-version": 0
},
"libsnoretoast": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1ec8249a4721dda26735a12603defe2aa680c264",
"version-semver": "1.1.0",
"port-version": 0
},
{
"git-tree": "587283d6fa07092beece87351d1361506293ff59",
"version-string": "1.0.31",