diff options
author | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2010-09-14 14:29:25 +0000 |
---|---|---|
committer | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2010-09-14 14:29:25 +0000 |
commit | 5f4795b5f10fb4fbd86cb4b7bf273b916cdf8c05 (patch) | |
tree | d3ddafbf3e0ebee9620b5cccf0b190bd2faed70a /pkgs/development/libraries/libofa | |
parent | 09c85666cd4bd89a36283c6de3c8849e7cc46dde (diff) |
Add libofa
svn path=/nixpkgs/trunk/; revision=23794
Diffstat (limited to 'pkgs/development/libraries/libofa')
4 files changed, 101 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libofa/default.nix b/pkgs/development/libraries/libofa/default.nix new file mode 100644 index 0000000000000..b3c69646452ec --- /dev/null +++ b/pkgs/development/libraries/libofa/default.nix @@ -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"; + }; +} diff --git a/pkgs/development/libraries/libofa/gcc-4.x.patch b/pkgs/development/libraries/libofa/gcc-4.x.patch new file mode 100644 index 0000000000000..50f72bb428c66 --- /dev/null +++ b/pkgs/development/libraries/libofa/gcc-4.x.patch @@ -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); diff --git a/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch b/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch new file mode 100644 index 0000000000000..7682e37105143 --- /dev/null +++ b/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.3.patch @@ -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" diff --git a/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch b/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch new file mode 100644 index 0000000000000..920c383c657b6 --- /dev/null +++ b/pkgs/development/libraries/libofa/libofa-0.9.3-gcc-4.patch @@ -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 */ |