diff options
-rw-r--r-- | extra/libofa/.footprint | 12 | ||||
-rw-r--r-- | extra/libofa/.md5sum | 3 | ||||
-rw-r--r-- | extra/libofa/Pkgfile | 20 | ||||
-rw-r--r-- | extra/libofa/gcc-4.patch | 39 | ||||
-rw-r--r-- | extra/libofa/gcc43.patch | 42 | ||||
-rw-r--r-- | extra/libofa/tnt_math_utils.h | 70 |
6 files changed, 186 insertions, 0 deletions
diff --git a/extra/libofa/.footprint b/extra/libofa/.footprint new file mode 100644 index 000000000..0e3179cde --- /dev/null +++ b/extra/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/extra/libofa/.md5sum b/extra/libofa/.md5sum new file mode 100644 index 000000000..2193c64f6 --- /dev/null +++ b/extra/libofa/.md5sum @@ -0,0 +1,3 @@ +bf57080a5df367a72812dc75a54deabc gcc43.patch +51507d2c4b432bd2755f48d58471696e libofa-0.9.3.tar.gz +d11904b2406a9617648b2d98366118a1 tnt_math_utils.h diff --git a/extra/libofa/Pkgfile b/extra/libofa/Pkgfile new file mode 100644 index 000000000..9dbf512ff --- /dev/null +++ b/extra/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/extra/libofa/gcc-4.patch b/extra/libofa/gcc-4.patch new file mode 100644 index 000000000..18b3b7b43 --- /dev/null +++ b/extra/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 <class Real> ++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 <class Real> + Real hypot(const Real &a, const Real &b) + { +@@ -56,15 +65,6 @@ + } + */ + +-/** +- @returns the absolute value of a real (no-complex) scalar. +-*/ +-template <class Real> +-Real abs(const Real &a) +-{ +- return (a > 0 ? a : -a); +-} +- + } + #endif + /* MATH_UTILS_H */ diff --git a/extra/libofa/gcc43.patch b/extra/libofa/gcc43.patch new file mode 100644 index 000000000..b772dcabd --- /dev/null +++ b/extra/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 <cstdlib> + #include <math.h> + #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 <string.h> ++ + 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 <stdio.h> + #include <stdlib.h> ++#include <cstring> + #include <string> + #include <map> + #include <expat.h> + +--- 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 <string> ++#include <cstdio> + #include "ofa1/ofa.h" + + using namespace std; diff --git a/extra/libofa/tnt_math_utils.h b/extra/libofa/tnt_math_utils.h new file mode 100644 index 000000000..40de63f05 --- /dev/null +++ b/extra/libofa/tnt_math_utils.h @@ -0,0 +1,70 @@ +#ifndef MATH_UTILS_H
+#define MATH_UTILS_H
+
+#include <math.h>
+/* needed for sqrt() below */
+
+#ifdef PREANSI
+template <class _Tp>
+inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
+ return __b < __a ? __b : __a;
+}
+
+template <class _Tp>
+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 <class Real>
+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 <class Real>
+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 <class Scalar>
+Scalar min(const Scalar &a, const Scalar &b)
+{
+ return a < b ? a : b;
+}
+*/
+
+/**
+ @returns the maximum of scalars a and b.
+template <class Scalar>
+Scalar max(const Scalar &a, const Scalar &b)
+{
+ return a > b ? a : b;
+}
+*/
+
+}
+#endif
+/* MATH_UTILS_H */
|