Hello

The attached patch adds ffmpeg2theora to nixpkgs. It can make use of libkate but doesn't seem to find it currently. I also added the required ffmpeg-0.7.x. Please test, improve and add to nixpkgs. Thanks.

Ilja
Index: pkgs/tools/video/ffmpeg2theora/default.nix
===================================================================
--- pkgs/tools/video/ffmpeg2theora/default.nix  (revision 0)
+++ pkgs/tools/video/ffmpeg2theora/default.nix  (working copy)
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, ffmpeg_0_7, libtheora, pkgconfig, scons, libkate }:
+
+stdenv.mkDerivation rec {
+  name = "ffmpeg2theora-0.28";
+  src = fetchurl {
+    url = 
"http://v2v.cc/~j/ffmpeg2theora/downloads/ffmpeg2theora-0.28.tar.bz2";;
+    sha256 = 
"6893c1444d730a1514275ba76ba487ca207205b916d6cb1285704225ee86fe1e";
+  };
+
+  buildInputs = [ ffmpeg_0_7 libtheora pkgconfig scons libkate ];
+
+  installPhase = ''
+    scons install prefix=$out
+  '';
+
+  meta = {
+    homepage = http://v2v.cc/~j/ffmpeg2theora;
+    description = "A simple converter to create Ogg Theora files.";
+    license = "GPLv3+";
+  };
+}
+
Index: pkgs/top-level/all-packages.nix
===================================================================
--- pkgs/top-level/all-packages.nix     (revision 33234)
+++ pkgs/top-level/all-packages.nix     (working copy)
@@ -3411,10 +3411,16 @@
 
   fcgi = callPackage ../development/libraries/fcgi { };
 
+  ffmpeg2theora = callPackage ../tools/video/ffmpeg2theora { };
+
   ffmpeg = callPackage ../development/libraries/ffmpeg {
     vpxSupport = if !stdenv.isMips then true else false;
   };
 
+  ffmpeg_0_7 = callPackage ../development/libraries/ffmpeg/0.7.nix {
+    vpxSupport = if !stdenv.isMips then true else false;
+  };
+
   ffmpeg_0_6_90 = callPackage ../development/libraries/ffmpeg/0.6.90.nix {
     vpxSupport = if !stdenv.isMips then true else false;
   };
Index: pkgs/development/libraries/ffmpeg/0.7.nix
===================================================================
--- pkgs/development/libraries/ffmpeg/0.7.nix   (revision 0)
+++ pkgs/development/libraries/ffmpeg/0.7.nix   (working copy)
@@ -0,0 +1,75 @@
+{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2
+, mp3Support ? true, lame ? null
+, speexSupport ? true, speex ? null
+, theoraSupport ? true, libtheora ? null
+, vorbisSupport ? true, libvorbis ? null
+, vpxSupport ? false, libvpx ? null
+, x264Support ? true, x264 ? null
+, xvidSupport ? true, xvidcore ? null
+, faacSupport ? false, faac ? null
+}:
+
+assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert vorbisSupport -> libvorbis != null;
+assert vpxSupport -> libvpx != null;
+assert x264Support -> x264 != null;
+assert xvidSupport -> xvidcore != null;
+assert faacSupport -> faac != null;
+
+stdenv.mkDerivation rec {
+  name = "ffmpeg-0.7.11";
+  
+  src = fetchurl {
+    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";;
+    sha256 = 
"99c09d6aaf1bc04d1158310dd4f45e9eda3c721dd33047beda9e247189ef4fc3";
+  };
+  
+  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
+  # the resulting library is GPL'ed, so it can only be used in GPL'ed
+  # applications.
+  configureFlags = [
+    "--enable-gpl"
+    "--enable-postproc"
+    "--enable-swscale"
+    "--disable-ffserver"
+    "--disable-ffplay"
+    "--enable-shared"
+    "--enable-runtime-cpudetect"
+  ]
+    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
+    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
+    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
+    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
+    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
+    ++ stdenv.lib.optional x264Support "--enable-libx264"
+    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
+    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree";
+
+  buildInputs = [ pkgconfig lame yasm zlib bzip2 ]
+    ++ stdenv.lib.optional mp3Support lame
+    ++ stdenv.lib.optional speexSupport speex
+    ++ stdenv.lib.optional theoraSupport libtheora
+    ++ stdenv.lib.optional vorbisSupport libvorbis
+    ++ stdenv.lib.optional vpxSupport libvpx
+    ++ stdenv.lib.optional x264Support x264
+    ++ stdenv.lib.optional xvidSupport xvidcore
+    ++ stdenv.lib.optional faacSupport faac;
+
+  enableParallelBuilding = true;
+    
+  crossAttrs = {
+    dontSetConfigureCross = true;
+    configureFlags = configureFlags ++ [
+      "--cross-prefix=${stdenv.cross.config}-"
+      "--enable-cross-compile"
+      "--target_os=linux"
+      "--arch=${stdenv.cross.arch}"
+      ];
+  };
+
+  meta = {
+    homepage = http://www.ffmpeg.org/;
+    description = "A complete, cross-platform solution to record, convert and 
stream audio and video";
+  };
+}
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to