summary refs log tree commit diff
path: root/pkgs/development/libraries/xvidcore/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/xvidcore/default.nix')
-rw-r--r--pkgs/development/libraries/xvidcore/default.nix38
1 files changed, 27 insertions, 11 deletions
diff --git a/pkgs/development/libraries/xvidcore/default.nix b/pkgs/development/libraries/xvidcore/default.nix
index e03773292bb..fd5efdcc3d1 100644
--- a/pkgs/development/libraries/xvidcore/default.nix
+++ b/pkgs/development/libraries/xvidcore/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, nasm}:
+{ stdenv, fetchurl, nasm, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
   name = "xvidcore-1.3.2";
@@ -8,20 +8,36 @@ stdenv.mkDerivation rec {
     sha256 = "1x0b2rq6fv99ramifhkakycd0prjc93lbzrffbjgjwg7w4s17hfn";
   };
 
-  preConfigure = "cd build/generic";
+  preConfigure = ''
+    cd build/generic
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace "-no-cpp-precomp" ""
+  '';
 
-  buildInputs = [ nasm ];
+  configureFlags = stdenv.lib.optionals stdenv.isDarwin
+    [ "--enable-macosx_module" "--disable-assembly" ];
 
-  postInstall =
-    ''
-      rm $out/lib/*.a
-      (cd $out/lib && ln -s *.so.4.* libxvidcore.so && ln -s *.so.4.* libxvidcore.so.4 )
-    '';
+  buildInputs = [ nasm ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ autoconf automake libtool ];
+
+  # don't delete the '.a' files on darwin -- they're needed to compile ffmpeg
+  # (and perhaps other things)
+  postInstall = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+    rm $out/lib/*.a
+  '' + ''
+    cd $out/lib
+    ln -s *.so.4.* libxvidcore.so
+    if [ ! -e libxvidcore.so.4 ]; then
+        ln -s *.so.4.* libxvidcore.so.4
+    fi
+  '';
   
-  meta = {
+  meta = with stdenv.lib; {
     description = "MPEG-4 video codec for PC";
-    homepage = http://www.xvid.org/;
-    license = "GPLv2+";
+    homepage    = http://www.xvid.org/;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.all;
   };
 }