Add libofa

svn path=/nixpkgs/trunk/; revision=23794
This commit is contained in:
Yury G. Kudryashov 2010-09-14 14:29:25 +00:00
parent 09c85666cd
commit 5f4795b5f1
5 changed files with 103 additions and 0 deletions

View File

@ -0,0 +1,14 @@
{ stdenv, fetchurl, expat, curl, fftw }:
stdenv.mkDerivation rec {
name = "libofa-0.9.3";
propagatedBuildInputs = [ expat curl fftw ];
patches = [ ./libofa-0.9.3-gcc-4.patch ./libofa-0.9.3-gcc-4.3.patch ./gcc-4.x.patch ];
src = fetchurl {
url = "http://musicip-libofa.googlecode.com/files/${name}.tar.gz";
sha256 = "184ham039l7lwhfgg0xr2vch2xnw1lwh7sid432mh879adhlc5h2";
};
}

View File

@ -0,0 +1,12 @@
diff --git a/examples/example.cpp b/examples/example.cpp
index ef978d5..7d58a0f 100644
--- a/examples/example.cpp
+++ b/examples/example.cpp
@@ -10,6 +10,7 @@
#include "protocol.h"
#include <string.h>
+#include <stdio.h>
AudioData* loadWaveFile(char *file);
AudioData* loadDataUsingLAME(char *file);

View File

@ -0,0 +1,36 @@
Fix build with gcc >=4.3
diff -ur libofa-0.9.3.orig/examples/example.cpp libofa-0.9.3/examples/example.cpp
--- libofa-0.9.3.orig/examples/example.cpp 2006-05-10 21:05:37.000000000 +0300
+++ libofa-0.9.3/examples/example.cpp 2008-04-16 15:51:49.000000000 +0300
@@ -9,6 +9,8 @@
#include "protocol.h"
+#include <string.h>
+
AudioData* loadWaveFile(char *file);
AudioData* loadDataUsingLAME(char *file);
Vain hakemistossa libofa-0.9.3/examples: example.cpp.orig
diff -ur libofa-0.9.3.orig/examples/protocol.cpp libofa-0.9.3/examples/protocol.cpp
--- libofa-0.9.3.orig/examples/protocol.cpp 2006-05-10 21:05:42.000000000 +0300
+++ libofa-0.9.3/examples/protocol.cpp 2008-04-16 15:51:49.000000000 +0300
@@ -8,6 +8,7 @@
-------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
+#include <cstring>
#include <string>
#include <map>
#include <expat.h>
diff -ur libofa-0.9.3.orig/lib/signal_op.cpp libofa-0.9.3/lib/signal_op.cpp
--- libofa-0.9.3.orig/lib/signal_op.cpp 2006-05-10 21:01:12.000000000 +0300
+++ libofa-0.9.3/lib/signal_op.cpp 2008-04-16 15:51:49.000000000 +0300
@@ -12,6 +12,7 @@
// DATE CREATED: 1/12/06
+#include <cstdlib>
#include <math.h>
#include "signal_op.h"
#include "AFLIB/aflibConverter.h"

View File

@ -0,0 +1,39 @@
--- a/lib/JAMA/tnt_math_utils.h 2006-06-17 01:46:22.000000000 +0300
+++ b/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 */

View File

@ -3309,6 +3309,8 @@ let
libnova = callPackage ../development/libraries/libnova { };
libofa = callPackage ../development/libraries/libofa { };
libofx = callPackage ../development/libraries/libofx { };
libogg = callPackage ../development/libraries/libogg { };