changeset 2468:110883446649

package sox: update and fix pkg-config and test program build
author Tony Theodore <tonyt@logyst.com>
date Wed, 02 May 2012 21:13:49 +1000
parents fca08ecb394f
children 51a4ed33302d 785b3c5007ee
files index.html src/sox-1-static.patch src/sox-test.c src/sox.mk
diffstat 4 files changed, 27 insertions(+), 236 deletions(-) [+]
line wrap: on
line diff
--- a/index.html	Wed May 02 19:59:51 2012 +1000
+++ b/index.html	Wed May 02 21:13:49 2012 +1000
@@ -1779,6 +1779,11 @@
         <td id="smpeg-website"><a href="http://icculus.org/smpeg/">smpeg</a></td>
     </tr>
     <tr>
+        <td id="sox-package">sox</td>
+        <td id="sox-version">14.4.0</td>
+        <td id="sox-website"><a href="http://sox.sourceforge.net/">SoX</a></td>
+    </tr>
+    <tr>
         <td id="speex-package">speex</td>
         <td id="speex-version">1.2rc1</td>
         <td id="speex-website"><a href="http://www.speex.org/">Speex</a></td>
--- a/src/sox-1-static.patch	Wed May 02 19:59:51 2012 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-This file is part of mingw-cross-env.
-See doc/index.html for further information.
-
-This patch has been taken from:
-http://sourceforge.net/mailarchive/forum.php?thread_name=4DD823B6.908%40cheramy.net&forum_name=sox-devel
-
-diff --git a/src/optional-fmts.am b/src/optional-fmts.am
-index 6c496aa..7e91176 100644
---- a/src/optional-fmts.am
-+++ b/src/optional-fmts.am
-@@ -3,11 +3,7 @@
- if HAVE_ALSA
- if STATIC_ALSA
-   libsox_la_SOURCES += alsa.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @ALSA_LIBS@
--else
-   libsox_la_LIBADD += @ALSA_LIBS@
--endif
- else
-   libsox_fmt_alsa_la_SOURCES = alsa.c
-   libsox_fmt_alsa_la_LIBADD = libsox.la @ALSA_LIBS@
-@@ -18,11 +14,7 @@ endif
- if HAVE_AMRNB
- if STATIC_AMRNB
-   libsox_la_SOURCES += amr-nb.c amr.h
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @AMRNB_LIBS@
--else
-   libsox_la_LIBADD += @AMRNB_LIBS@
--endif
- else
-   libsox_fmt_amr_nb_la_SOURCES = amr-nb.c amr.h
-   libsox_fmt_amr_nb_la_LIBADD = libsox.la @AMRNB_LIBS@
-@@ -33,11 +25,7 @@ endif
- if HAVE_AMRWB
- if STATIC_AMRWB
-   libsox_la_SOURCES += amr-wb.c amr.h
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @AMRWB_LIBS@
--else
-   libsox_la_LIBADD += @AMRWB_LIBS@
--endif
- else
-   libsox_fmt_amr_wb_la_SOURCES = amr-wb.c amr.h
-   libsox_fmt_amr_wb_la_LIBADD = libsox.la @AMRWB_LIBS@
-@@ -48,11 +36,7 @@ endif
- if HAVE_AO
- if STATIC_AO
-   libsox_la_SOURCES += ao.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @AO_LIBS@
--else
-   libsox_la_LIBADD += @AO_LIBS@
--endif
- else
-   libsox_fmt_ao_la_SOURCES = ao.c
-   libsox_fmt_ao_la_LIBADD = libsox.la @AO_LIBS@
-@@ -63,11 +47,7 @@ endif
- if HAVE_COREAUDIO
- if STATIC_COREAUDIO
-   libsox_la_SOURCES += coreaudio.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @COREAUDIO_LIBS@
--else
-   libsox_la_LIBADD += @COREAUDIO_LIBS@
--endif
- else
-   libsox_fmt_coreaudio_la_SOURCES = coreaudio.c
-   libsox_fmt_coreaudio_la_LIBADD = libsox.la @COREAUDIO_LIBS@
-@@ -78,11 +58,7 @@ endif
- if HAVE_FFMPEG
- if STATIC_FFMPEG
-   libsox_la_SOURCES += ffmpeg.c ffmpeg.h
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @FFMPEG_LIBS@
--else
-   libsox_la_LIBADD += @FFMPEG_LIBS@
--endif
- else
-   libsox_fmt_ffmpeg_la_SOURCES = ffmpeg.c ffmpeg.h
-   libsox_fmt_ffmpeg_la_LIBADD = libsox.la @FFMPEG_LIBS@
-@@ -93,11 +69,7 @@ endif
- if HAVE_FLAC
- if STATIC_FLAC
-   libsox_la_SOURCES += flac.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @FLAC_LIBS@
--else
-   libsox_la_LIBADD += @FLAC_LIBS@
--endif
- else
-   libsox_fmt_flac_la_SOURCES = flac.c
-   libsox_fmt_flac_la_LIBADD = libsox.la @FLAC_LIBS@
-@@ -108,11 +80,7 @@ endif
- if HAVE_GSM
- if STATIC_GSM
-   libsox_la_SOURCES += gsm.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @GSM_LIBS@
--else
-   libsox_la_LIBADD += @GSM_LIBS@
--endif
- else
-   libsox_fmt_gsm_la_SOURCES = gsm.c
-   libsox_fmt_gsm_la_LIBADD = libsox.la @GSM_LIBS@
-@@ -123,11 +91,7 @@ endif
- if HAVE_LPC10
- if STATIC_LPC10
-   libsox_la_SOURCES += lpc10.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @LPC10_LIBS@
--else
-   libsox_la_LIBADD += @LPC10_LIBS@
--endif
- else
-   libsox_fmt_lpc10_la_SOURCES = lpc10.c
-   libsox_fmt_lpc10_la_LIBADD = libsox.la @LPC10_LIBS@
-@@ -138,11 +102,7 @@ endif
- if HAVE_MP3
- if STATIC_MP3
-   libsox_la_SOURCES += mp3.c mp3-util.h
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @MP3_LIBS@
--else
-   libsox_la_LIBADD += @MP3_LIBS@
--endif
- else
-   libsox_fmt_mp3_la_SOURCES = mp3.c mp3-util.h
-   libsox_fmt_mp3_la_LIBADD = libsox.la @MP3_LIBS@
-@@ -153,11 +113,7 @@ endif
- if HAVE_OSS
- if STATIC_OSS
-   libsox_la_SOURCES += oss.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @OSS_LIBS@
--else
-   libsox_la_LIBADD += @OSS_LIBS@
--endif
- else
-   libsox_fmt_oss_la_SOURCES = oss.c
-   libsox_fmt_oss_la_LIBADD = libsox.la @OSS_LIBS@
-@@ -168,11 +124,7 @@ endif
- if HAVE_PULSEAUDIO
- if STATIC_PULSEAUDIO
-   libsox_la_SOURCES += pulseaudio.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @PULSEAUDIO_LIBS@
--else
-   libsox_la_LIBADD += @PULSEAUDIO_LIBS@
--endif
- else
-   libsox_fmt_pulseaudio_la_SOURCES = pulseaudio.c
-   libsox_fmt_pulseaudio_la_LIBADD = libsox.la @PULSEAUDIO_LIBS@
-@@ -183,11 +135,7 @@ endif
- if HAVE_WAVEAUDIO
- if STATIC_WAVEAUDIO
-   libsox_la_SOURCES += waveaudio.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @WAVEAUDIO_LIBS@
--else
-   libsox_la_LIBADD += @WAVEAUDIO_LIBS@
--endif
- else
-   libsox_fmt_waveaudio_la_SOURCES = waveaudio.c
-   libsox_fmt_waveaudio_la_LIBADD = libsox.la @WAVEAUDIO_LIBS@
-@@ -199,11 +147,6 @@ if HAVE_SNDIO
- if STATIC_SNDIO
-   libsox_la_SOURCES += sndio.c
-   libsox_la_LIBADD += @SNDIO_LIBS@
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @SNDIO_LIBS@
--else
--  libsox_la_LIBADD += @SNDIO_LIBS@
--endif
- else
-   libsox_fmt_sndio_la_SOURCES = sndio.c
-   libsox_fmt_sndio_la_LIBADD = libsox.la @SNDIO_LIBS@
-@@ -214,11 +157,7 @@ endif
- if HAVE_SUN_AUDIO
- if STATIC_SUN_AUDIO
-   libsox_la_SOURCES += sunaudio.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @SUN_AUDIO_LIBS@
--else
-   libsox_la_LIBADD += @SUN_AUDIO_LIBS@
--endif
- else
-   libsox_fmt_sunau_la_SOURCES = sunaudio.c
-   libsox_fmt_sunau_la_LIBADD = libsox.la @SUN_AUDIO_LIBS@
-@@ -229,11 +168,7 @@ endif
- if HAVE_OGG_VORBIS
- if STATIC_OGG_VORBIS
-   libsox_la_SOURCES += vorbis.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @OGG_VORBIS_LIBS@
--else
-   libsox_la_LIBADD += @OGG_VORBIS_LIBS@
--endif
- else
-   libsox_fmt_vorbis_la_SOURCES = vorbis.c
-   libsox_fmt_vorbis_la_LIBADD = libsox.la @OGG_VORBIS_LIBS@
-@@ -244,11 +179,7 @@ endif
- if HAVE_WAVPACK
- if STATIC_WAVPACK
-   libsox_la_SOURCES += wavpack.c
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @WAVPACK_LIBS@
--else
-   libsox_la_LIBADD += @WAVPACK_LIBS@
--endif
- else
-   libsox_fmt_wavpack_la_SOURCES = wavpack.c
-   libsox_fmt_wavpack_la_LIBADD = libsox.la @WAVPACK_LIBS@
-@@ -261,11 +192,7 @@ if HAVE_SNDFILE
- if STATIC_SNDFILE
-   libsox_la_SOURCES += sndfile.c caf.c mat4.c mat5.c paf.c fap.c w64.c xi.c pvf.c sd2.c
-   libsox_la_CFLAGS += @SNDFILE_CFLAGS@
--if STATIC_LIBSOX_ONLY
--  sox_LDADD += @SNDFILE_LIBS@
--else
-   libsox_la_LIBADD += @SNDFILE_LIBS@
--endif
- else
- libsox_fmt_sndfile_la_SOURCES = sndfile.c
- libsox_fmt_sndfile_la_CFLAGS = @WARN_CFLAGS@ @SNDFILE_CFLAGS@
--- a/src/sox-test.c	Wed May 02 19:59:51 2012 +1000
+++ b/src/sox-test.c	Wed May 02 21:13:49 2012 +1000
@@ -1,6 +1,15 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
 #include <sox.h>
 
-int main(void) {
+int main(int argc, char *argv[])
+{
+    (void)argc;
+    (void)argv;
+
     sox_format_init();
     return(0);
 }
--- a/src/sox.mk	Wed May 02 19:59:51 2012 +1000
+++ b/src/sox.mk	Wed May 02 21:13:49 2012 +1000
@@ -4,13 +4,11 @@
 # sox
 PKG             := sox
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 14.3.2
-$(PKG)_CHECKSUM := ad462114ff47b094078f18148bc9e29e31b42b92
+$(PKG)_CHECKSUM := d809cab382c7a9d015491c69051a9d1c1a1a44f1
 $(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
 $(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.gz
-$(PKG)_WEBSITE  := http://sox.sourceforge.net/
 $(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc libmad lame vorbis ffmpeg flac
+$(PKG)_DEPS     := gcc ffmpeg flac lame libgomp libmad libsndfile vorbis
 
 define $(PKG)_UPDATE
     wget -q -O- 'http://sourceforge.net/projects/sox/files/sox/' | \
@@ -19,18 +17,23 @@
 endef
 
 define $(PKG)_BUILD
-    # wine confuses the cross-compiling detection, so set it explicitly
-    $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure'
+    # set pkg-config cflags and libs
+    $(SED) -i 's,^\(Cflags:.*\),\1 -fopenmp,' '$(1)/sox.pc.in'
+    $(SED) -i '/Libs.private/d'               '$(1)/sox.pc.in'
+    echo Libs.private: `grep sox_LDADD '$(1)/src/optional-fmts.am' | \
+    $(SED) 's, sox_LDADD += ,,g' | tr -d '\n'` >>'$(1)/sox.pc.in'
+
     cd '$(1)' && ./configure \
         --host='$(TARGET)' \
         --prefix='$(PREFIX)/$(TARGET)' \
+        --build="`config.guess`" \
         --disable-shared
 
-    $(MAKE) -C '$(1)' -j '$(JOBS)'
+    $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= EXTRA_PROGRAMS=
     $(MAKE) -C '$(1)' -j 1 install
 
-    '$(1)/libtool' --tag=CC --mode=link '$(TARGET)-gcc' -all-static \
+    '$(TARGET)-gcc' \
         -W -Wall -Werror -ansi -pedantic \
         '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sox.exe' \
-        -lsox
+        `'$(TARGET)-pkg-config' sox --cflags --libs`
 endef