From 1a6a3c4fe8ea50b6084546a4abd40e9f0e609b28 Mon Sep 17 00:00:00 2001 From: tnut Date: Fri, 26 Feb 2010 23:22:14 +0100 Subject: libofa dans test --- test/libofa/.footprint | 12 ++++++++ test/libofa/.md5sum | 3 ++ test/libofa/Pkgfile | 20 +++++++++++++ test/libofa/gcc-4.patch | 39 ++++++++++++++++++++++++ test/libofa/gcc43.patch | 42 ++++++++++++++++++++++++++ test/libofa/tnt_math_utils.h | 70 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 186 insertions(+) create mode 100644 test/libofa/.footprint create mode 100644 test/libofa/.md5sum create mode 100644 test/libofa/Pkgfile create mode 100644 test/libofa/gcc-4.patch create mode 100644 test/libofa/gcc43.patch create mode 100644 test/libofa/tnt_math_utils.h (limited to 'test') diff --git a/test/libofa/.footprint b/test/libofa/.footprint new file mode 100644 index 000000000..0e3179cde --- /dev/null +++ b/test/libofa/.footprint @@ -0,0 +1,12 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/include/ +drwxr-xr-x root/root usr/include/ofa1/ +-rw-r--r-- root/root usr/include/ofa1/ofa.h +drwxr-xr-x root/root usr/lib/ +-rw-r--r-- root/root usr/lib/libofa.a +-rwxr-xr-x root/root usr/lib/libofa.la +lrwxrwxrwx root/root usr/lib/libofa.so -> libofa.so.0.0.0 +lrwxrwxrwx root/root usr/lib/libofa.so.0 -> libofa.so.0.0.0 +-rwxr-xr-x root/root usr/lib/libofa.so.0.0.0 +drwxr-xr-x root/root usr/lib/pkgconfig/ +-rw-r--r-- root/root usr/lib/pkgconfig/libofa.pc diff --git a/test/libofa/.md5sum b/test/libofa/.md5sum new file mode 100644 index 000000000..48baf1ac5 --- /dev/null +++ b/test/libofa/.md5sum @@ -0,0 +1,3 @@ +bf57080a5df367a72812dc75a54deabc gcc43.patch +7edb4672821ebed4157a0ac294eba37f libofa-0.9.3.tar.gz +d11904b2406a9617648b2d98366118a1 tnt_math_utils.h diff --git a/test/libofa/Pkgfile b/test/libofa/Pkgfile new file mode 100644 index 000000000..9dbf512ff --- /dev/null +++ b/test/libofa/Pkgfile @@ -0,0 +1,20 @@ +# Description: Architecture Open Fingerprint +# URL: http://www.musicdns.org +# Maintainer: NuTyX core team +# Packager: thierryn1 at hispeed dot ch +# Depends on: fftw + +name=libofa +version=0.9.3 +release=1 +source=(http://www.musicip.com/dns/files/$name-$version.tar.gz\ + gcc43.patch tnt_math_utils.h) + +build() { + cd $name-$version + patch -Np0 -i ../gcc43.patch + mv ../tnt_math_utils.h lib/JAMA/ + ./configure --prefix=/usr + make + make DESTDIR=$PKG install +} diff --git a/test/libofa/gcc-4.patch b/test/libofa/gcc-4.patch new file mode 100644 index 000000000..18b3b7b43 --- /dev/null +++ b/test/libofa/gcc-4.patch @@ -0,0 +1,39 @@ +--- lib/JAMA/tnt_math_utils.h.orig 2006-06-17 01:46:22.000000000 +0300 ++++ lib/JAMA/tnt_math_utils.h 2006-06-17 01:47:02.000000000 +0300 +@@ -20,11 +20,20 @@ + namespace TNT + { + /** ++ @returns the absolute value of a real (no-complex) scalar. ++*/ ++template ++Real abs(const Real &a) ++{ ++ return (a > 0 ? a : -a); ++} ++/** + @returns hypotenuse of real (non-complex) scalars a and b by + avoiding underflow/overflow + using (a * sqrt( 1 + (b/a) * (b/a))), rather than + sqrt(a*a + b*b). + */ ++ + template + Real hypot(const Real &a, const Real &b) + { +@@ -56,15 +65,6 @@ + } + */ + +-/** +- @returns the absolute value of a real (no-complex) scalar. +-*/ +-template +-Real abs(const Real &a) +-{ +- return (a > 0 ? a : -a); +-} +- + } + #endif + /* MATH_UTILS_H */ diff --git a/test/libofa/gcc43.patch b/test/libofa/gcc43.patch new file mode 100644 index 000000000..b772dcabd --- /dev/null +++ b/test/libofa/gcc43.patch @@ -0,0 +1,42 @@ +--- lib/signal_op.cpp~ 2007-04-02 12:33:42.000000000 +0000 ++++ lib/signal_op.cpp 2007-04-02 12:33:47.000000000 +0000 +@@ -12,6 +12,7 @@ + // DATE CREATED: 1/12/06 + + ++#include + #include + #include "signal_op.h" + #include "AFLIB/aflibConverter.h" +--- examples/example.cpp~ 2007-04-02 12:34:01.000000000 +0000 ++++ examples/example.cpp 2007-04-02 12:34:10.000000000 +0000 +@@ -9,6 +9,8 @@ + -------------------------------------------------------------------*/ + + #include "protocol.h" + ++#include ++ + AudioData* loadWaveFile(char *file); + AudioData* loadDataUsingLAME(char *file); +--- examples/protocol.cpp~ 2006-05-10 18:05:42.000000000 +0000 ++++ examples/protocol.cpp 2007-12-29 18:06:16.000000000 +0000 +@@ -8,6 +8,7 @@ + -------------------------------------------------------------------*/ + #include + #include ++#include + #include + #include + #include + +--- examples/protocol.h 2009-08-04 21:15:45.000000000 +0000 ++++ examples/protocol.h.new 2009-08-04 21:15:10.000000000 +0000 +@@ -10,6 +10,7 @@ + #define __PROTOCOL_H__ + + #include ++#include + #include "ofa1/ofa.h" + + using namespace std; diff --git a/test/libofa/tnt_math_utils.h b/test/libofa/tnt_math_utils.h new file mode 100644 index 000000000..40de63f05 --- /dev/null +++ b/test/libofa/tnt_math_utils.h @@ -0,0 +1,70 @@ +#ifndef MATH_UTILS_H +#define MATH_UTILS_H + +#include +/* needed for sqrt() below */ + +#ifdef PREANSI +template +inline const _Tp& min(const _Tp& __a, const _Tp& __b) { + return __b < __a ? __b : __a; +} + +template +inline const _Tp& max(const _Tp& __a, const _Tp& __b) { + return __a < __b ? __b : __a; +} +#endif + + +namespace TNT +{ +/** + @returns the absolute value of a real (no-complex) scalar. +*/ +template +Real abs(const Real &a) +{ + return (a > 0 ? a : -a); +} +/** + + @returns hypotenuse of real (non-complex) scalars a and b by + avoiding underflow/overflow + using (a * sqrt( 1 + (b/a) * (b/a))), rather than + sqrt(a*a + b*b). +*/ +template +Real hypot(const Real &a, const Real &b) +{ + + if (a== 0) + return abs(b); + else + { + Real c = b/a; + return a * sqrt(1 + c*c); + } +} + +/** + @returns the minimum of scalars a and b. +template +Scalar min(const Scalar &a, const Scalar &b) +{ + return a < b ? a : b; +} +*/ + +/** + @returns the maximum of scalars a and b. +template +Scalar max(const Scalar &a, const Scalar &b) +{ + return a > b ? a : b; +} +*/ + +} +#endif +/* MATH_UTILS_H */ -- cgit v1.2.3-70-g09d2