summaryrefslogtreecommitdiff
path: root/extra/soundtouch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/soundtouch')
-rw-r--r--extra/soundtouch/PKGBUILD22
-rw-r--r--extra/soundtouch/disable-mmx.patch115
2 files changed, 129 insertions, 8 deletions
diff --git a/extra/soundtouch/PKGBUILD b/extra/soundtouch/PKGBUILD
index e27054573..d7dcac734 100644
--- a/extra/soundtouch/PKGBUILD
+++ b/extra/soundtouch/PKGBUILD
@@ -5,29 +5,35 @@ pkgname=soundtouch
pkgver=1.6.0
pkgrel=1
pkgdesc="An audio processing library"
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'mips64el')
url="http://www.surina.net/soundtouch/"
license=('LGPL')
depends=('gcc-libs')
options=('!libtool')
source=(http://www.surina.net/soundtouch/${pkgname}-${pkgver}.tar.gz
soundtouch-1.4.0-mmx-sse-compile-fix.patch
- soundtouch-1.4.0-x86_64-asm-broken.patch)
+ soundtouch-1.4.0-x86_64-asm-broken.patch
+ disable-mmx.patch)
md5sums=('aa1c63d4d67b033f044a6a48d2be5bdd'
'108cd080b4b0ebe8ed1f950ff1315e7a'
- '0d856bb5b519b18c6ba3a2e1770bdfd2')
-sha1sums=('9871dcbf75a68665a3515bb9dda4727beb0358e7'
- '7a245aacadcb3003e73c1c202c8de0ecc09283ac'
- '95282cca856b3b8645fadb530ce5eb892074f193')
+ '0d856bb5b519b18c6ba3a2e1770bdfd2'
+ '36e859e7a74a21ec7f9a5282fed63117')
build() {
cd "${srcdir}/${pkgname}"
patch -p1 -i "${srcdir}/soundtouch-1.4.0-mmx-sse-compile-fix.patch"
patch -p1 -i "${srcdir}/soundtouch-1.4.0-x86_64-asm-broken.patch"
+ [ "${CARCH}" = "mips64el" ] && patch -p1 -i "${srcdir}/disable-mmx.patch"
- [ "${CARCH}" = "x86_64" ] && CONFIGFLAG="--with-pic"
./bootstrap
- ./configure --prefix=/usr --enable-shared ${CONFIGFLAG}
+ case $CARCH in
+ i686)
+ ./configure --prefix=/usr --enable-shared
+ ;;
+ *)
+ ./configure --prefix=/usr --enable-shared --with-pic
+ ;;
+ esac
make
}
diff --git a/extra/soundtouch/disable-mmx.patch b/extra/soundtouch/disable-mmx.patch
new file mode 100644
index 000000000..11987059c
--- /dev/null
+++ b/extra/soundtouch/disable-mmx.patch
@@ -0,0 +1,115 @@
+diff -ru soundtouch.orig/source/SoundStretch/Makefile.am soundtouch/source/SoundStretch/Makefile.am
+--- soundtouch.orig/source/SoundStretch/Makefile.am 2012-02-22 20:51:33.240941439 +0100
++++ soundtouch/source/SoundStretch/Makefile.am 2012-02-22 20:52:25.936309597 +0100
+@@ -43,11 +43,5 @@
+ ## linker.
+ soundstretch_LDADD=../SoundTouch/libSoundTouch.la -lm
+
+-## linker flags
+-soundstretch_LDFLAGS=-s
+-
+-## additional compiler flags
+-soundstretch_CXXFLAGS=-O3
+-
+ #clean-local:
+ # -rm -f additional-files-to-remove-on-make-clean
+diff -ru soundtouch.orig/source/SoundTouch/FIRFilter.cpp soundtouch/source/SoundTouch/FIRFilter.cpp
+--- soundtouch.orig/source/SoundTouch/FIRFilter.cpp 2012-02-22 20:51:33.277196949 +0100
++++ soundtouch/source/SoundTouch/FIRFilter.cpp 2012-02-22 21:00:18.591437748 +0100
+@@ -229,32 +229,6 @@
+
+ FIRFilter * FIRFilter::newInstance()
+ {
+- uint uExtensions;
+-
+- uExtensions = detectCPUextensions();
+-
+- // Check if MMX/SSE instruction set extensions supported by CPU
+-
+-#ifdef SOUNDTOUCH_ALLOW_MMX
+- // MMX routines available only with integer sample types
+- if (uExtensions & SUPPORT_MMX)
+- {
+- return ::new FIRFilterMMX;
+- }
+- else
+-#endif // SOUNDTOUCH_ALLOW_MMX
+-
+-#ifdef SOUNDTOUCH_ALLOW_SSE
+- if (uExtensions & SUPPORT_SSE)
+- {
+- // SSE support
+- return ::new FIRFilterSSE;
+- }
+- else
+-#endif // SOUNDTOUCH_ALLOW_SSE
+-
+- {
+- // ISA optimizations not supported, use plain C version
+- return ::new FIRFilter;
+- }
++ // ISA optimizations not supported, use plain C version
++ return ::new FIRFilter;
+ }
+diff -ru soundtouch.orig/source/SoundTouch/Makefile.am soundtouch/source/SoundTouch/Makefile.am
+--- soundtouch.orig/source/SoundTouch/Makefile.am 2012-02-22 20:51:33.269140169 +0100
++++ soundtouch/source/SoundTouch/Makefile.am 2012-02-22 20:53:39.136212215 +0100
+@@ -30,16 +30,13 @@
+
+ lib_LTLIBRARIES=libSoundTouch.la
+ #
+-libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp mmx_optimized.cpp sse_optimized.cpp RateTransposer.cpp SoundTouch.cpp TDStretch.cpp cpu_detect_x86_gcc.cpp BPMDetect.cpp PeakFinder.cpp
++libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp RateTransposer.cpp SoundTouch.cpp TDStretch.cpp BPMDetect.cpp PeakFinder.cpp
+
+
+ # Note by authore: '-msse2' might not work in non-X86 compilations. If someone can
+ # fix this script to automatically check for CPU architecture, please submit a patch
+ # to me.
+ AM_CXXFLAGS = -fcheck-new -I../../include
+-mmx_optimized.lo : AM_CXXFLAGS = -mmmx -fcheck-new -I../../include
+-sse_optimized.lo : AM_CXXFLAGS = -msse -fcheck-new -I../../include
+-
+
+ # other linking flags to add
+ # noinst_LTLIBRARIES = libSoundTouchOpt.la
+diff -ru soundtouch.orig/source/SoundTouch/TDStretch.cpp soundtouch/source/SoundTouch/TDStretch.cpp
+--- soundtouch.orig/source/SoundTouch/TDStretch.cpp 2012-02-22 20:51:33.269140169 +0100
++++ soundtouch/source/SoundTouch/TDStretch.cpp 2012-02-22 20:59:57.756604035 +0100
+@@ -738,35 +738,8 @@
+
+ TDStretch * TDStretch::newInstance()
+ {
+- uint uExtensions;
+-
+- uExtensions = detectCPUextensions();
+-
+- // Check if MMX/SSE instruction set extensions supported by CPU
+-
+-#ifdef SOUNDTOUCH_ALLOW_MMX
+- // MMX routines available only with integer sample types
+- if (uExtensions & SUPPORT_MMX)
+- {
+- return ::new TDStretchMMX;
+- }
+- else
+-#endif // SOUNDTOUCH_ALLOW_MMX
+-
+-
+-#ifdef SOUNDTOUCH_ALLOW_SSE
+- if (uExtensions & SUPPORT_SSE)
+- {
+- // SSE support
+- return ::new TDStretchSSE;
+- }
+- else
+-#endif // SOUNDTOUCH_ALLOW_SSE
+-
+- {
+- // ISA optimizations not supported, use plain C version
+- return ::new TDStretch;
+- }
++ // ISA optimizations not supported, use plain C version
++ return ::new TDStretch;
+ }
+
+