mkxp-z/subprojects/packagefiles/libsndfile-deps.patch

329 lines
7.6 KiB
Diff

# Prevents libsndfile's build system from trying to look for external libraries since Meson already handles that.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,15 +94,15 @@ endif ()
include(SndFileChecks)
-if (ENABLE_EXTERNAL_LIBS AND NOT (Vorbis_FOUND OR FLAC_FOUND OR OPUS_FOUND))
- set (ENABLE_EXTERNAL_LIBS OFF)
-endif()
-if(ENABLE_MPEG AND (NOT HAVE_MPEG_LIBS))
- set (ENABLE_MPEG OFF)
-endif()
-if (BUILD_REGTEST AND (NOT SQLITE3_FOUND))
- set (BUILD_REGTEST OFF)
-endif()
+
+
+
+
+
+
+
+
+
cmake_dependent_option (ENABLE_CPU_CLIP "Enable tricky cpu specific clipper" ON "CPU_CLIPS_POSITIVE;CPU_CLIPS_NEGATIVE" OFF)
if (NOT ENABLE_CPU_CLIP)
@@ -391,13 +391,6 @@ target_include_directories (sndfile
target_link_libraries (sndfile
PRIVATE
$<$<BOOL:${LIBM_REQUIRED}>:m>
- $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Ogg::ogg>
- $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:Vorbis::vorbisenc>
- $<$<BOOL:${HAVE_EXTERNAL_XIPH_LIBS}>:FLAC::FLAC>
- $<$<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}>:mp3lame::mp3lame>
)
set_target_properties (sndfile PROPERTIES
PUBLIC_HEADER "${sndfile_HDRS}"
--- a/cmake/SndFileChecks.cmake
+++ b/cmake/SndFileChecks.cmake
@@ -16,49 +16,49 @@ if (LARGE_FILES_DEFINITIONS)
add_definitions(${LARGE_FILES_DEFINITIONS})
endif ()
-if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
- find_package (Sndio)
-elseif (NOT WIN32)
- find_package (ALSA)
-endif ()
-if (VCPKG_TOOLCHAIN AND (NOT CMAKE_VERSION VERSION_LESS 3.15))
- set (CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
-endif ()
-if (CMAKE_FIND_PACKAGE_PREFER_CONFIG)
- find_package (Ogg 1.3 CONFIG)
- find_package (Vorbis CONFIG COMPONENTS Enc)
- find_package (FLAC CONFIG)
- find_package (Opus CONFIG)
-
- include (FindPackageHandleStandardArgs)
- find_package_handle_standard_args (Ogg CONFIG_MODE)
- find_package_handle_standard_args (Vorbis CONFIG_MODE)
- find_package_handle_standard_args (FLAC CONFIG_MODE)
- find_package_handle_standard_args (Opus CONFIG_MODE)
-else ()
- find_package (Ogg 1.3)
- find_package (Vorbis COMPONENTS Enc)
- find_package (FLAC)
- find_package (Opus)
-endif ()
-if (Vorbis_FOUND AND FLAC_FOUND AND Opus_FOUND)
- set (HAVE_EXTERNAL_XIPH_LIBS 1)
-else ()
- set (HAVE_EXTERNAL_XIPH_LIBS 0)
-endif ()
-find_package (mp3lame)
-find_package (mpg123 1.25.10)
-if (TARGET mp3lame::mp3lame AND (TARGET MPG123::libmpg123))
- set (HAVE_MPEG_LIBS 1)
-else ()
- set (HAVE_MPEG_LIBS 0)
-endif()
-find_package (Speex)
-find_package (SQLite3)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
check_include_file (byteswap.h HAVE_BYTESWAP_H)
check_include_file (dlfcn.h HAVE_DLFCN_H)
--- a/src/flac.c
+++ b/src/flac.c
@@ -31,9 +31,9 @@
#if HAVE_EXTERNAL_XIPH_LIBS
-#include <FLAC/stream_decoder.h>
-#include <FLAC/stream_encoder.h>
-#include <FLAC/metadata.h>
+#include "../flac/include/FLAC/stream_decoder.h"
+#include "../flac/include/FLAC/stream_encoder.h"
+#include "../flac/include/FLAC/metadata.h"
/*------------------------------------------------------------------------------
** Private static functions.
--- a/src/id3.c
+++ b/src/id3.c
@@ -28,7 +28,7 @@
#include "common.h"
#include "id3.h"
-#if HAVE_MPEG
+#if 0
#include <lame/lame.h>
struct id3v1_genre_handler_userdata
--- a/src/mpeg.c
+++ b/src/mpeg.c
@@ -36,10 +36,10 @@ static int mpeg_command (SF_PRIVATE *psf, int command, void *data, int datasize)
static int
mpeg_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
{
- if (psf->have_written)
+
return 0 ;
- return mpeg_l3_encoder_write_id3tag (psf) ;
+
}
static int
@@ -56,7 +56,7 @@ mpeg_command (SF_PRIVATE *psf, int command, void *data, int datasize)
{ psf->error = SFE_NOT_WRITEMODE ;
return SF_FALSE ;
} ;
- return mpeg_l3_encoder_set_quality (psf, *(double *) data) ;
+ psf->error = SFE_UNIMPLEMENTED ; return SF_FALSE ;
case SFC_SET_BITRATE_MODE :
if (psf->file.mode != SFM_WRITE)
@@ -67,14 +67,14 @@ mpeg_command (SF_PRIVATE *psf, int command, void *data, int datasize)
{ psf->error = SFE_BAD_COMMAND_PARAM ;
return SF_FALSE ;
} ;
- bitrate_mode = *(int *) data ;
- return mpeg_l3_encoder_set_bitrate_mode (psf, bitrate_mode) ;
+ psf->error = SFE_UNIMPLEMENTED ;
+ return SF_FALSE ;
case SFC_GET_BITRATE_MODE :
if (psf->file.mode == SFM_READ)
return mpeg_decoder_get_bitrate_mode (psf) ;
else
- return mpeg_l3_encoder_get_bitrate_mode (psf) ;
+ { psf->error = SFE_UNIMPLEMENTED ; return SF_FALSE ; }
default :
return SF_FALSE ;
@@ -97,9 +97,9 @@ mpeg_init (SF_PRIVATE *psf, int bitrate_mode, int write_metadata)
if (psf->file.mode == SFM_WRITE)
{ switch (SF_CODEC (psf->sf.format))
{ case SF_FORMAT_MPEG_LAYER_III :
- if ((error = mpeg_l3_encoder_init (psf, write_metadata)))
- return error ;
- mpeg_l3_encoder_set_bitrate_mode (psf, bitrate_mode) ;
+
+ return SFE_UNIMPLEMENTED ;
+
if (write_metadata)
{ /* ID3 support */
psf->strings.flags = SF_STR_ALLOW_START ;
--- a/src/mpeg_decode.c
+++ b/src/mpeg_decode.c
@@ -30,7 +30,7 @@
#include "sfendian.h"
#include "id3.h"
-#include <mpg123.h>
+#include "../mpg123/src/include/mpg123.h"
typedef struct
{ mpg123_handle *pmh ;
--- a/src/mpeg_l3_encode.c
+++ b/src/mpeg_l3_encode.c
@@ -23,7 +23,7 @@
#include "mpeg.h"
-#if HAVE_MPEG
+#if 0
#include <lame/lame.h>
--- a/src/ogg.c
+++ b/src/ogg.c
@@ -73,7 +73,7 @@
#if HAVE_EXTERNAL_XIPH_LIBS
-#include <ogg/ogg.h>
+#include "../ogg/include/ogg/ogg.h"
#include "ogg.h"
--- a/src/ogg_opus.c
+++ b/src/ogg_opus.c
@@ -161,9 +161,9 @@
#if HAVE_EXTERNAL_XIPH_LIBS
-#include <ogg/ogg.h>
-#include <opus/opus.h>
-#include <opus/opus_multistream.h>
+#include "../ogg/include/ogg/ogg.h"
+#include "../opus/include/opus.h"
+#include "../opus/include/opus_multistream.h"
#include "ogg.h"
#include "ogg_vcomment.h"
--- a/src/ogg_pcm.c
+++ b/src/ogg_pcm.c
@@ -38,7 +38,7 @@
#if (ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_XIPH_LIBS)
-#include <ogg/ogg.h>
+#include "../ogg/include/ogg/ogg.h"
#include "ogg.h"
--- a/src/ogg_speex.c
+++ b/src/ogg_speex.c
@@ -38,12 +38,12 @@
#if (ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_XIPH_LIBS)
-#include <ogg/ogg.h>
+#include "../ogg/include/ogg/ogg.h"
-#include <speex/speex.h>
-#include <speex/speex_stereo.h>
-#include <speex/speex_header.h>
-#include <speex/speex_callbacks.h>
+#include "../speex/include/speex/speex.h"
+#include "../speex/include/speex/speex_stereo.h"
+#include "../speex/include/speex/speex_header.h"
+#include "../speex/include/speex/speex_callbacks.h"
#include "ogg.h"
--- a/src/ogg_vcomment.c
+++ b/src/ogg_vcomment.c
@@ -29,7 +29,7 @@
#if HAVE_EXTERNAL_XIPH_LIBS
-#include <ogg/ogg.h>
+#include "../ogg/include/ogg/ogg.h"
#include "ogg_vcomment.h"
--- a/src/ogg_vorbis.c
+++ b/src/ogg_vorbis.c
@@ -73,9 +73,9 @@
#if HAVE_EXTERNAL_XIPH_LIBS
-#include <ogg/ogg.h>
-#include <vorbis/codec.h>
-#include <vorbis/vorbisenc.h>
+#include "../ogg/include/ogg/ogg.h"
+#include "../vorbis/include/vorbis/codec.h"
+#include "../vorbis/include/vorbis/vorbisenc.h"
#include "ogg.h"
@@ -316,7 +316,7 @@ vorbis_write_header (SF_PRIVATE *psf, int UNUSED (calc_length))
vorbis_info_init (&vdata->vinfo) ;
/* The style of encoding should be selectable here, VBR quality mode. */
- ret = vorbis_encode_init_vbr (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, vdata->quality) ;
+ ret = -1 ;
#if 0
ret = vorbis_encode_init (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, -1, 128000, -1) ; /* average bitrate mode */