From 09c85666cd4bd89a36283c6de3c8849e7cc46dde Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Tue, 14 Sep 2010 14:29:19 +0000 Subject: [PATCH] Add libmusicbrainz 2.x and 3.x svn path=/nixpkgs/trunk/; revision=23793 --- .../libraries/libmusicbrainz/2.x.nix | 16 +++++ .../libraries/libmusicbrainz/default.nix | 14 +++++ .../libraries/libmusicbrainz/find-neon.patch | 52 ++++++++++++++++ .../libraries/libmusicbrainz/gcc-4.x.patch | 60 +++++++++++++++++++ .../libmusicbrainz/missing-include.patch | 12 ++++ pkgs/top-level/all-packages.nix | 6 ++ 6 files changed, 160 insertions(+) create mode 100644 pkgs/development/libraries/libmusicbrainz/2.x.nix create mode 100644 pkgs/development/libraries/libmusicbrainz/default.nix create mode 100644 pkgs/development/libraries/libmusicbrainz/find-neon.patch create mode 100644 pkgs/development/libraries/libmusicbrainz/gcc-4.x.patch create mode 100644 pkgs/development/libraries/libmusicbrainz/missing-include.patch diff --git a/pkgs/development/libraries/libmusicbrainz/2.x.nix b/pkgs/development/libraries/libmusicbrainz/2.x.nix new file mode 100644 index 000000000000..383cdf3291a5 --- /dev/null +++ b/pkgs/development/libraries/libmusicbrainz/2.x.nix @@ -0,0 +1,16 @@ +{ stdenv, fetchurl, expat }: + +stdenv.mkDerivation rec { + name = "libmusicbrainz-2.1.5"; + + configureFlags = "--enable-cpp-headers"; + + buildInputs = [ expat ]; + + patches = [ ./gcc-4.x.patch ]; + + src = fetchurl { + url = "ftp://ftp.musicbrainz.org/pub/musicbrainz/${name}.tar.gz"; + sha256 = "183i4c109r5qx3mk4r986sx5xw4n5mdhdz4yz3rrv3s2xm5rqqn6"; + }; +} diff --git a/pkgs/development/libraries/libmusicbrainz/default.nix b/pkgs/development/libraries/libmusicbrainz/default.nix new file mode 100644 index 000000000000..f39a3793eec1 --- /dev/null +++ b/pkgs/development/libraries/libmusicbrainz/default.nix @@ -0,0 +1,14 @@ +{ stdenv, fetchurl, cmake, neon, libdiscid }: + +stdenv.mkDerivation rec { + name = "libmusicbrainz-3.0.2"; + + buildInputs = [ cmake neon libdiscid ]; + + patches = [ ./find-neon.patch ]; + + src = fetchurl { + url = "ftp://ftp.musicbrainz.org/pub/musicbrainz/${name}.tar.gz"; + sha256 = "1nhyl9kalvcn0r86y3kps6id84y3rc43226g67bssfb2h9b5x8xr"; + }; +} diff --git a/pkgs/development/libraries/libmusicbrainz/find-neon.patch b/pkgs/development/libraries/libmusicbrainz/find-neon.patch new file mode 100644 index 000000000000..2230c46018e5 --- /dev/null +++ b/pkgs/development/libraries/libmusicbrainz/find-neon.patch @@ -0,0 +1,52 @@ +diff --git a/cmake/modules/FindNeon.cmake b/cmake/modules/FindNeon.cmake +index 0a6b300..dbd6194 100644 +--- a/cmake/modules/FindNeon.cmake ++++ b/cmake/modules/FindNeon.cmake +@@ -1,10 +1,10 @@ + INCLUDE(UsePkgConfig) + PKGCONFIG(neon _NeonIncDir _NeonLinkDir _NeonLinkFlags _NeonCflags) + +-FIND_PATH(NEON_INCLUDE_DIR ne_request.h ++FIND_PATH(NEON_INCLUDE_DIR neon/ne_request.h + ${_NeonIncDir} +- /usr/include/neon +- /usr/local/include/neon ++ /usr/include ++ /usr/local/include + ) + + FIND_LIBRARY(NEON_LIBRARIES neon +diff --git a/src/utils_private.cpp b/src/utils_private.cpp +index 751b4a7..5a06eca 100644 +--- a/src/utils_private.cpp ++++ b/src/utils_private.cpp +@@ -26,7 +26,7 @@ + #include + #include + #include +-#include ++#include + #include "utils_private.h" + + using namespace std; +diff --git a/src/webservice.cpp b/src/webservice.cpp +index cd483f9..483f486 100644 +--- a/src/webservice.cpp ++++ b/src/webservice.cpp +@@ -26,11 +26,11 @@ + #include + #include + #include +-#include +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include ++#include + #include + #include + #include "utils_private.h" diff --git a/pkgs/development/libraries/libmusicbrainz/gcc-4.x.patch b/pkgs/development/libraries/libmusicbrainz/gcc-4.x.patch new file mode 100644 index 000000000000..f55c4f2cd41b --- /dev/null +++ b/pkgs/development/libraries/libmusicbrainz/gcc-4.x.patch @@ -0,0 +1,60 @@ +diff --git a/lib/c_wrapper.cpp b/lib/c_wrapper.cpp +index deae11d..ebc7854 100644 +--- a/lib/c_wrapper.cpp ++++ b/lib/c_wrapper.cpp +@@ -24,6 +24,7 @@ + #include "musicbrainz.h" + #include "trm.h" + #include "mb_c.h" ++#include + + extern "C" + { +diff --git a/lib/comhttpsocket.cpp b/lib/comhttpsocket.cpp +index 067313b..4371772 100644 +--- a/lib/comhttpsocket.cpp ++++ b/lib/comhttpsocket.cpp +@@ -20,6 +20,7 @@ + #endif + #include + #include ++#include + + const char* g_strCOMVer = "libmusicbrainz/"VERSION; + +diff --git a/lib/comsocket.cpp b/lib/comsocket.cpp +index 01a94be..7bfc4dd 100644 +--- a/lib/comsocket.cpp ++++ b/lib/comsocket.cpp +@@ -44,6 +44,7 @@ ____________________________________________________________________________*/ + #include + #include + #endif ++#include + + #define mb_socklen_t ACCEPT_ARG3 + +diff --git a/lib/http.cpp b/lib/http.cpp +index 85390a3..e63713c 100644 +--- a/lib/http.cpp ++++ b/lib/http.cpp +@@ -67,6 +67,7 @@ + #ifdef __QNX__ + #include + #endif ++#include + + using namespace std; + +diff --git a/lib/sigclient.cpp b/lib/sigclient.cpp +index 9f76008..4bbbaae 100644 +--- a/lib/sigclient.cpp ++++ b/lib/sigclient.cpp +@@ -32,6 +32,7 @@ email : ijr@relatable.com + #ifdef WIN32 + #pragma warning(disable:4786) + #endif ++#include + + #include "sigclient.h" + #include "comhttpsocket.h" diff --git a/pkgs/development/libraries/libmusicbrainz/missing-include.patch b/pkgs/development/libraries/libmusicbrainz/missing-include.patch new file mode 100644 index 000000000000..2a1d2b38cae7 --- /dev/null +++ b/pkgs/development/libraries/libmusicbrainz/missing-include.patch @@ -0,0 +1,12 @@ +diff --git a/src/utils_private.cpp b/src/utils_private.cpp +index 2abe857..751b4a7 100644 +--- a/src/utils_private.cpp ++++ b/src/utils_private.cpp +@@ -21,6 +21,7 @@ + */ + + #include ++#include + #include + #include + #include diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3a534d884db9..3373cd4e781c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3299,6 +3299,12 @@ let libmusclecard = callPackage ../development/libraries/libmusclecard { }; + libmusicbrainz2 = callPackage ../development/libraries/libmusicbrainz/2.x.nix { }; + + libmusicbrainz3 = callPackage ../development/libraries/libmusicbrainz { }; + + libmusicbrainz = libmusicbrainz3; + libnih = callPackage ../development/libraries/libnih { }; libnova = callPackage ../development/libraries/libnova { };