From e9ce152222a50750903488659385a280617a9664 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Tue, 11 Nov 2003 15:01:07 +0000
Subject: [PATCH] * MPlayer.

svn path=/nixpkgs/trunk/; revision=495
---
 pkgs-ng/README                                |  2 ++
 pkgs-ng/applications/video/MPlayer/builder.sh | 19 ++++++++++++++
 .../applications/video/MPlayer/default.fix    | 26 +++++++++++++++++++
 .../video/MPlayer/win32codecs/builder.sh      |  9 +++++++
 .../video/MPlayer/win32codecs/default.fix     | 10 +++++++
 pkgs-ng/system/all-packages-generic.fix       |  7 +++++
 pkgs-ng/system/user-environment.fix           |  1 +
 7 files changed, 74 insertions(+)
 create mode 100755 pkgs-ng/applications/video/MPlayer/builder.sh
 create mode 100644 pkgs-ng/applications/video/MPlayer/default.fix
 create mode 100755 pkgs-ng/applications/video/MPlayer/win32codecs/builder.sh
 create mode 100644 pkgs-ng/applications/video/MPlayer/win32codecs/default.fix

diff --git a/pkgs-ng/README b/pkgs-ng/README
index 7d3dc1395c7e..1130c091c7e1 100644
--- a/pkgs-ng/README
+++ b/pkgs-ng/README
@@ -82,6 +82,8 @@ ELSE IF it's an APPLICATION:
 
   IF it's a VERSION MANAGEMENT system:
     ./applications/version-management
+  ELSE IF it's for VIDEO playback/etc:
+    ./applications/video
   ELSE IF it's for NETWORKING:
     IF it's a MAILREADER:
       ./applications/networking/mailreaders
diff --git a/pkgs-ng/applications/video/MPlayer/builder.sh b/pkgs-ng/applications/video/MPlayer/builder.sh
new file mode 100755
index 000000000000..c791d72f7416
--- /dev/null
+++ b/pkgs-ng/applications/video/MPlayer/builder.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+buildinputs="$freetype $x11"
+. $stdenv/setup || exit 1
+
+tar xvfj $src || exit 1
+tar xvfj $fonts || exit 1
+cd MPlayer-* || exit 1
+./configure --prefix=$out --with-win32libdir=$win32codecs \
+ --with-x11incdir=$x11/include --with-x11libdir=$x11/lib \
+ --with-reallibdir=$win32codecs \
+ --disable-sdl --disable-esd --disable-xanim --disable-cdparanoia --disable-directfb \
+ --disable-lirc --disable-svga --disable-libdv \
+ --disable-vorbis --disable-png --disable-jpeg --disable-gif \
+ --enable-runtime-cpudetection \
+ || exit 1
+make || exit 1
+make install || exit 1
+cp -p ../font-arial-iso-8859-1/font-arial-18-iso-8859-1/* $out/share/mplayer/font || exit 1
diff --git a/pkgs-ng/applications/video/MPlayer/default.fix b/pkgs-ng/applications/video/MPlayer/default.fix
new file mode 100644
index 000000000000..64871cd69f06
--- /dev/null
+++ b/pkgs-ng/applications/video/MPlayer/default.fix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, x11, freetype}:
+
+assert !isNull x11 && !isNull freetype;
+
+derivation {
+  name = "MPlayer-1.0pre2";
+  system = stdenv.system;
+
+  builder = ./builder.sh;
+  src = fetchurl {
+    url = http://www2.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre2.tar.bz2;
+    md5 = "a60c179468f85e83e3f9e1922e81ad64";
+  };
+  fonts = fetchurl {
+    url = http://www2.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2;
+    md5 = "1ecd31d17b51f16332b1fcc7da36b312";
+  };
+
+  stdenv = stdenv;
+  x11 = x11;
+  freetype = freetype;
+  win32codecs = (import ./win32codecs) {
+    stdenv = stdenv;
+    fetchurl = fetchurl;
+  };
+}
diff --git a/pkgs-ng/applications/video/MPlayer/win32codecs/builder.sh b/pkgs-ng/applications/video/MPlayer/win32codecs/builder.sh
new file mode 100755
index 000000000000..9b76079acabb
--- /dev/null
+++ b/pkgs-ng/applications/video/MPlayer/win32codecs/builder.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. $stdenv/setup || exit 1
+
+mkdir $out || exit 1
+cd $out || exit 1
+tar xvfj $src || exit 1
+mv extralite/* . || exit 1
+rmdir extralite || exit 1
diff --git a/pkgs-ng/applications/video/MPlayer/win32codecs/default.fix b/pkgs-ng/applications/video/MPlayer/win32codecs/default.fix
new file mode 100644
index 000000000000..699875ae1594
--- /dev/null
+++ b/pkgs-ng/applications/video/MPlayer/win32codecs/default.fix
@@ -0,0 +1,10 @@
+{stdenv, fetchurl}: derivation {
+  name = "win32codecs-1";
+  system = stdenv.system;
+  builder = ./builder.sh;
+  src = fetchurl {
+    url = http://www2.mplayerhq.hu/MPlayer/releases/codecs/extralite.tar.bz2;
+    md5 = "4748ecae87f71e8bda9cb2e2a9bd30b4";
+  };
+  stdenv = stdenv;
+}
diff --git a/pkgs-ng/system/all-packages-generic.fix b/pkgs-ng/system/all-packages-generic.fix
index 6f411aa5d9a6..fcaca8b47390 100644
--- a/pkgs-ng/system/all-packages-generic.fix
+++ b/pkgs-ng/system/all-packages-generic.fix
@@ -370,4 +370,11 @@
     libIDL = libIDL;
   };
 
+  MPlayer = (import ../applications/video/MPlayer) {
+    fetchurl = fetchurl;
+    stdenv = stdenv;
+    x11 = xfree86;
+    freetype = freetype;
+  };
+
 }
diff --git a/pkgs-ng/system/user-environment.fix b/pkgs-ng/system/user-environment.fix
index a63c8ae29f7d..0cc450754608 100644
--- a/pkgs-ng/system/user-environment.fix
+++ b/pkgs-ng/system/user-environment.fix
@@ -15,6 +15,7 @@
     pkgs.pan
     pkgs.sylpheed
     pkgs.firebird
+    pkgs.MPlayer
   ];
 
   # Create a user environment.