From 1f4d58ba5ce7635e513f84dbb8f08266d0c112a8 Mon Sep 17 00:00:00 2001 From: Ørjan Malde Date: Jan 21 2023 15:50:45 +0000 Subject: groups/251.native_packages_lib.group: libsndfile: bump to v1.2.0 Signed-off-by: Ørjan Malde --- diff --git a/groups/251.native_packages_lib.group b/groups/251.native_packages_lib.group index 3a89641..53bf601 100644 --- a/groups/251.native_packages_lib.group +++ b/groups/251.native_packages_lib.group @@ -236,10 +236,10 @@ ksba_cv_visibility_attribute=yes"}; : ${PKG_LIBSHINE_VERSION:=3.1.1}; : ${PKG_LIBSHINE_URL:=https://github.com/toots/shine/releases/download/${PKG_LIBSHINE_VERSION}/shine-${PKG_LIBSHINE_VERSION}.tar.gz}; : ${PKG_LIBSHINE_IN_TREE:=1}; -: ${PKG_LIBSNDFILE_DEPENDS:="libzip"}; -: ${PKG_LIBSNDFILE_SHA256SUM:=1ff33929f042fa333aed1e8923aa628c3ee9e1eb85512686c55092d1e5a9dfa9}; -: ${PKG_LIBSNDFILE_VERSION:=1.0.28}; -: ${PKG_LIBSNDFILE_URL:=http://www.mega-nerd.com/libsndfile/files/libsndfile-${PKG_LIBSNDFILE_VERSION}.tar.gz}; +: ${PKG_LIBSNDFILE_DEPENDS:="mpg123 lame libflac libogg libzip opus sqlite3"}; +: ${PKG_LIBSNDFILE_SHA256SUM:=0e30e7072f83dc84863e2e55f299175c7e04a5902ae79cfb99d4249ee8f6d60a}; +: ${PKG_LIBSNDFILE_VERSION:=1.2.0}; +: ${PKG_LIBSNDFILE_URL:=https://github.com/libsndfile/libsndfile/releases/download/${PKG_LIBSNDFILE_VERSION}/libsndfile-${PKG_LIBSNDFILE_VERSION}.tar.xz}; : ${PKG_LIBSNDFILE_CONFIGURE_ARGS_EXTRA:="--disable-alsa"}; : ${PKG_LIBSNDFILE_CFLAGS_CONFIGURE_EXTRA:="-I${PREFIX_NATIVE}/include/w32api.ports -DWINAPI_ANSI_DEFAULT"}; : ${PKG_LIBSNDFILE_LDFLAGS_CONFIGURE_EXTRA:="-L${PREFIX_NATIVE}/lib/w32lib -lkernel32 -lwinmm"}; diff --git a/patches/libsndfile-1.0.28.local.patch b/patches/libsndfile-1.0.28.local.patch deleted file mode 100644 index 708ae2c..0000000 --- a/patches/libsndfile-1.0.28.local.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff -ru libsndfile-1.0.28.orig/programs/sndfile-play.c libsndfile-1.0.28/programs/sndfile-play.c ---- libsndfile-1.0.28.orig/programs/sndfile-play.c 2017-04-01 09:18:02.000000000 +0200 -+++ libsndfile-1.0.28/programs/sndfile-play.c 2020-11-11 13:46:51.824586591 +0100 -@@ -71,10 +71,31 @@ - #include - #include - --#elif (OS_IS_WIN32 == 1) -+#elif (OS_IS_WIN32 == 1) || defined(__midipix__) -+ #include - #include - #include - -+#ifndef INFINITE -+#define INFINITE 0xffffffff -+#endif -+ -+#ifndef CALLBACK_FUNCTION -+#define CALLBACK_FUNCTION (uint32_t)0x00030000 -+#endif -+ -+#ifndef WAVE_MAPPER -+#define WAVE_MAPPER ((UINT)-1) -+#endif -+ -+#ifndef WAVE_FORMAT_PCM -+#define WAVE_FORMAT_PCM 1 -+#endif -+ -+#ifndef MM_WOM_DONE -+#define MM_WOM_DONE 0x3BD -+#endif -+ - #endif - - #define SIGNED_SIZEOF(x) ((int) sizeof (x)) -@@ -482,15 +503,16 @@ - ** point to data instead of short*. It plain sucks! - */ - --#if (OS_IS_WIN32 == 1) -+#if (OS_IS_WIN32 == 1) || defined(__midipix__) - - #define WIN32_BUFFER_LEN (1 << 15) - -+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER ; -+ - typedef struct - { HWAVEOUT hwave ; - WAVEHDR whdr [2] ; - -- CRITICAL_SECTION mutex ; /* to control access to BuffersInUSe */ - HANDLE Event ; /* signal that a buffer is free */ - - short buffer [WIN32_BUFFER_LEN / sizeof (short)] ; -@@ -524,9 +546,9 @@ - waveOutWrite (audio_data->hwave, (LPWAVEHDR) &(audio_data->whdr [audio_data->current]), sizeof (WAVEHDR)) ; - - /* count another buffer in use */ -- EnterCriticalSection (&audio_data->mutex) ; -+ pthread_mutex_lock (&mutex) ; - audio_data->BuffersInUse ++ ; -- LeaveCriticalSection (&audio_data->mutex) ; -+ pthread_mutex_unlock (&mutex) ; - - /* use the other buffer next time */ - audio_data->current = (audio_data->current + 1) % 2 ; -@@ -556,9 +578,9 @@ - - /* let main loop know a buffer is free */ - if (msg == MM_WOM_DONE) -- { EnterCriticalSection (&audio_data->mutex) ; -+ { pthread_mutex_lock (&mutex) ; - audio_data->BuffersInUse -- ; -- LeaveCriticalSection (&audio_data->mutex) ; -+ pthread_mutex_unlock (&mutex) ; - SetEvent (audio_data->Event) ; - } ; - -@@ -586,7 +608,6 @@ - audio_data.remaining = audio_data.sfinfo.frames * audio_data.sfinfo.channels ; - audio_data.current = 0 ; - -- InitializeCriticalSection (&audio_data.mutex) ; - audio_data.Event = CreateEvent (0, FALSE, FALSE, 0) ; - - wf.nChannels = audio_data.sfinfo.channels ; -@@ -655,8 +676,6 @@ - waveOutClose (audio_data.hwave) ; - audio_data.hwave = 0 ; - -- DeleteCriticalSection (&audio_data.mutex) ; -- - sf_close (audio_data.sndfile) ; - } ; - -@@ -848,7 +867,7 @@ - sndio_play (argc, argv) ; - #elif (defined (sun) && defined (unix)) - solaris_play (argc, argv) ; --#elif (OS_IS_WIN32 == 1) -+#elif (OS_IS_WIN32 == 1) || defined(__midipix__) - win32_play (argc, argv) ; - #elif (defined (__MACH__) && defined (__APPLE__)) - printf ("OS X 10.8 and later have a new Audio API.\n") ; diff --git a/patches/libsndfile-1.2.0.local.patch b/patches/libsndfile-1.2.0.local.patch new file mode 100644 index 0000000..708ae2c --- /dev/null +++ b/patches/libsndfile-1.2.0.local.patch @@ -0,0 +1,105 @@ +diff -ru libsndfile-1.0.28.orig/programs/sndfile-play.c libsndfile-1.0.28/programs/sndfile-play.c +--- libsndfile-1.0.28.orig/programs/sndfile-play.c 2017-04-01 09:18:02.000000000 +0200 ++++ libsndfile-1.0.28/programs/sndfile-play.c 2020-11-11 13:46:51.824586591 +0100 +@@ -71,10 +71,31 @@ + #include + #include + +-#elif (OS_IS_WIN32 == 1) ++#elif (OS_IS_WIN32 == 1) || defined(__midipix__) ++ #include + #include + #include + ++#ifndef INFINITE ++#define INFINITE 0xffffffff ++#endif ++ ++#ifndef CALLBACK_FUNCTION ++#define CALLBACK_FUNCTION (uint32_t)0x00030000 ++#endif ++ ++#ifndef WAVE_MAPPER ++#define WAVE_MAPPER ((UINT)-1) ++#endif ++ ++#ifndef WAVE_FORMAT_PCM ++#define WAVE_FORMAT_PCM 1 ++#endif ++ ++#ifndef MM_WOM_DONE ++#define MM_WOM_DONE 0x3BD ++#endif ++ + #endif + + #define SIGNED_SIZEOF(x) ((int) sizeof (x)) +@@ -482,15 +503,16 @@ + ** point to data instead of short*. It plain sucks! + */ + +-#if (OS_IS_WIN32 == 1) ++#if (OS_IS_WIN32 == 1) || defined(__midipix__) + + #define WIN32_BUFFER_LEN (1 << 15) + ++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER ; ++ + typedef struct + { HWAVEOUT hwave ; + WAVEHDR whdr [2] ; + +- CRITICAL_SECTION mutex ; /* to control access to BuffersInUSe */ + HANDLE Event ; /* signal that a buffer is free */ + + short buffer [WIN32_BUFFER_LEN / sizeof (short)] ; +@@ -524,9 +546,9 @@ + waveOutWrite (audio_data->hwave, (LPWAVEHDR) &(audio_data->whdr [audio_data->current]), sizeof (WAVEHDR)) ; + + /* count another buffer in use */ +- EnterCriticalSection (&audio_data->mutex) ; ++ pthread_mutex_lock (&mutex) ; + audio_data->BuffersInUse ++ ; +- LeaveCriticalSection (&audio_data->mutex) ; ++ pthread_mutex_unlock (&mutex) ; + + /* use the other buffer next time */ + audio_data->current = (audio_data->current + 1) % 2 ; +@@ -556,9 +578,9 @@ + + /* let main loop know a buffer is free */ + if (msg == MM_WOM_DONE) +- { EnterCriticalSection (&audio_data->mutex) ; ++ { pthread_mutex_lock (&mutex) ; + audio_data->BuffersInUse -- ; +- LeaveCriticalSection (&audio_data->mutex) ; ++ pthread_mutex_unlock (&mutex) ; + SetEvent (audio_data->Event) ; + } ; + +@@ -586,7 +608,6 @@ + audio_data.remaining = audio_data.sfinfo.frames * audio_data.sfinfo.channels ; + audio_data.current = 0 ; + +- InitializeCriticalSection (&audio_data.mutex) ; + audio_data.Event = CreateEvent (0, FALSE, FALSE, 0) ; + + wf.nChannels = audio_data.sfinfo.channels ; +@@ -655,8 +676,6 @@ + waveOutClose (audio_data.hwave) ; + audio_data.hwave = 0 ; + +- DeleteCriticalSection (&audio_data.mutex) ; +- + sf_close (audio_data.sndfile) ; + } ; + +@@ -848,7 +867,7 @@ + sndio_play (argc, argv) ; + #elif (defined (sun) && defined (unix)) + solaris_play (argc, argv) ; +-#elif (OS_IS_WIN32 == 1) ++#elif (OS_IS_WIN32 == 1) || defined(__midipix__) + win32_play (argc, argv) ; + #elif (defined (__MACH__) && defined (__APPLE__)) + printf ("OS X 10.8 and later have a new Audio API.\n") ;