From a4512a4a49fbb1190a2bdf56bb1f5b1f590117e1 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Sun, 10 Feb 2008 17:34:49 +0000 Subject: [PATCH] Mediastreamer: compilable svn path=/nixpkgs/branches/stdenv-updates/; revision=10569 --- .../mediastreamer/2.2.0-cvs20080207.nix | 10 +++- .../libraries/mediastreamer/h264.patch | 12 +++++ .../libraries/mediastreamer/plugins.patch | 49 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +- 4 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/mediastreamer/h264.patch create mode 100644 pkgs/development/libraries/mediastreamer/plugins.patch diff --git a/pkgs/development/libraries/mediastreamer/2.2.0-cvs20080207.nix b/pkgs/development/libraries/mediastreamer/2.2.0-cvs20080207.nix index 221954aa3fe2..6391ce4dd6ca 100644 --- a/pkgs/development/libraries/mediastreamer/2.2.0-cvs20080207.nix +++ b/pkgs/development/libraries/mediastreamer/2.2.0-cvs20080207.nix @@ -1,7 +1,7 @@ args: with args; stdenv.mkDerivation rec { - name = "mediastreamer-" + version; + name = "mediastreamer2-" + version; # This url is not related to mediastreamer. fetchcvs doesn't work on my laptop, # so I've created cvs snapshot and put it to my server. @@ -10,7 +10,13 @@ stdenv.mkDerivation rec { sha256 = "1nmvyqh4x3nsw4qbj754jwagj9ia183kvp8valdr7m44my0sw5p1"; }; - buildInputs = [automake]; + buildInputs = [automake libtool autoconf pkgconfig]; + + propagatedBuildInputs = [alsaLib ffmpeg speex ortp]; preConfigure = "./autogen.sh"; + + patches = [ ./h264.patch ./plugins.patch ]; + + configureFlags = "--enable-external-ortp --enable-shared --disable-static"; } diff --git a/pkgs/development/libraries/mediastreamer/h264.patch b/pkgs/development/libraries/mediastreamer/h264.patch new file mode 100644 index 000000000000..0c6dc9e91092 --- /dev/null +++ b/pkgs/development/libraries/mediastreamer/h264.patch @@ -0,0 +1,12 @@ +diff --git a/tests/mediastream.c b/tests/mediastream.c +index 12e1605..cdc8cd1 100644 +--- a/tests/mediastream.c ++++ b/tests/mediastream.c +@@ -144,7 +144,6 @@ int main(int argc, char * argv[]) + rtp_profile_set_payload(&av_profile,97,&payload_type_theora); + rtp_profile_set_payload(&av_profile,99,&payload_type_mp4v); + rtp_profile_set_payload(&av_profile,100,&payload_type_x_snow); +- rtp_profile_set_payload(&av_profile,102,&payload_type_h264); + #endif + if (argc<4) { + printf(usage); diff --git a/pkgs/development/libraries/mediastreamer/plugins.patch b/pkgs/development/libraries/mediastreamer/plugins.patch new file mode 100644 index 000000000000..e82b85035f08 --- /dev/null +++ b/pkgs/development/libraries/mediastreamer/plugins.patch @@ -0,0 +1,49 @@ +diff --git a/src/mscommon.c b/src/mscommon.c +index 1a12b2f..2399444 100644 +--- a/src/mscommon.c ++++ b/src/mscommon.c +@@ -428,6 +428,7 @@ static MSSndCardDesc * ms_snd_card_descs[]={ + void ms_init(){ + int i; + MSSndCardManager *cm; ++ char *ms_plugin_path; + + #ifdef __APPLE__ + NSApplicationLoad(); +@@ -451,7 +452,35 @@ void ms_init(){ + } + + ms_message("Loading plugins"); +- ms_load_plugins(PACKAGE_PLUGINS_DIR); ++ ms_plugin_path = getenv("MS_PLUGIN_PATH"); ++ do ++ { ++ if (!ms_plugin_path) ++ { ++ ms_load_plugins(PACKAGE_PLUGINS_DIR); ++ break; ++ } ++ char *dup_plugins_path = strdup (ms_plugin_path); ++ char *cur_plugins_dir = dup_plugins_path; ++ if (!dup_plugins_path) ++ { ++ ms_message("Failed to duplicate plugins path, not loading plugins"); ++ break; ++ } ++ while (1) ++ { ++ char *next_delimiter = strchr(cur_plugins_dir, ":"); ++ if (next_delimiter) ++ next_delimiter[0] = '\0'; ++ ms_load_plugins(cur_plugins_dir); ++ if (!next_delimiter) ++ break; ++ cur_plugins_dir = next_delimiter + 1; ++ } ++ free(dup_plugins_path); ++ } ++ while (0); ++ + ms_message("ms_init() done"); + } + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eaf25a2a0699..b38ecf372982 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2415,7 +2415,9 @@ rec { #failed to build mediastreamerFun = lib.sumArgs (selectVersion ../development/libraries/mediastreamer "2.2.0-cvs20080207") { - inherit fetchurl stdenv automake; + inherit fetchurl stdenv automake libtool autoconf alsaLib pkgconfig speex + ortp; + ffmpeg = ffmpeg_svn; }; mediastreamer = mediastreamerFun null;