From 4d9fb0a5948994b6086ea1e5a6188c4f81b32586 Mon Sep 17 00:00:00 2001
From: "Yury G. Kudryashov" <urkud.urkud@gmail.com>
Date: Wed, 14 Mar 2012 19:35:35 +0000
Subject: [PATCH] Move gstreamer packages to top-level

This will make callPackage work with gst.
* Rename gstCamelCase to gst_with_underscores.
* Add compatibility attributes.

svn path=/nixpkgs/trunk/; revision=33078
---
 .../libraries/gstreamer/default.nix           | 24 ---------------
 .../libraries/gstreamer/gnonlin/default.nix   |  4 +--
 .../gstreamer/gst-ffmpeg/default.nix          |  4 +--
 .../gstreamer/gst-plugins-bad/default.nix     |  4 +--
 .../gstreamer/gst-plugins-good/default.nix    |  4 +--
 .../gstreamer/gst-plugins-ugly/default.nix    |  4 +--
 .../gstreamer/gst-python/default.nix          |  4 +--
 .../gstreamer/qt-gstreamer/default.nix        |  4 +--
 pkgs/top-level/all-packages.nix               | 30 ++++++++++++++++---
 9 files changed, 40 insertions(+), 42 deletions(-)
 delete mode 100644 pkgs/development/libraries/gstreamer/default.nix

diff --git a/pkgs/development/libraries/gstreamer/default.nix b/pkgs/development/libraries/gstreamer/default.nix
deleted file mode 100644
index 60678459b6d..00000000000
--- a/pkgs/development/libraries/gstreamer/default.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ callPackage }:
-
-rec {
-  gstreamer = callPackage ./gstreamer { };
-
-  gstPluginsBase = callPackage ./gst-plugins-base { };
-
-  gstPluginsGood = callPackage ./gst-plugins-good { };
-
-  gstPluginsUgly = callPackage ./gst-plugins-ugly { };
-
-  gstPluginsBad = callPackage ./gst-plugins-bad { };
-
-  gstFfmpeg = callPackage ./gst-ffmpeg { };
-
-  gnonlin = callPackage ./gnonlin { };
-
-  gst_python = callPackage ./gst-python {};
-
-  qt_gstreamer = callPackage ./qt-gstreamer {};
-
-  # Header files are in include/${prefix}/
-  prefix = "gstreamer-0.10";
-}
diff --git a/pkgs/development/libraries/gstreamer/gnonlin/default.nix b/pkgs/development/libraries/gstreamer/gnonlin/default.nix
index 1ba33f07b1e..ca386b15f0e 100644
--- a/pkgs/development/libraries/gstreamer/gnonlin/default.nix
+++ b/pkgs/development/libraries/gstreamer/gnonlin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gstPluginsBase, gstreamer }:
+{ stdenv, fetchurl, pkgconfig, gst_plugins_base, gstreamer }:
 
 stdenv.mkDerivation rec {
   name = "gnonlin-0.10.15";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1yz0i3vzpadz5axwdb310bypl4rm1xy2n6mgajja0w2z6afnrfv0";
   };
 
-  buildInputs = [ gstPluginsBase gstreamer pkgconfig ];
+  buildInputs = [ gst_plugins_base gstreamer pkgconfig ];
 
   meta = {
     homepage = "http://gstreamer.freedesktop.org/modules/gnonlin.html";
diff --git a/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix b/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix
index 0287c5b9135..e7aaaa46a96 100644
--- a/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-ffmpeg/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, gstPluginsBase, bzip2, yasm
+{ fetchurl, stdenv, pkgconfig, gst_plugins_base, bzip2, yasm
 , useInternalFfmpeg ? false, ffmpeg ? null }:
 
 stdenv.mkDerivation rec {
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = stdenv.lib.optionalString (!useInternalFfmpeg) "--with-system-ffmpeg";
 
   buildInputs =
-    [ pkgconfig bzip2 gstPluginsBase ]
+    [ pkgconfig bzip2 gst_plugins_base ]
     ++ (if useInternalFfmpeg then [ yasm ] else [ ffmpeg ]);
 
   meta = {
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-bad/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-bad/default.nix
index 4dec1a86ebf..2d1309f3a3c 100644
--- a/pkgs/development/libraries/gstreamer/gst-plugins-bad/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-bad/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, glib, gstreamer, gstPluginsBase
+{ fetchurl, stdenv, pkgconfig, glib, gstreamer, gst_plugins_base
 , libdvdnav, libdvdread }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ pkgconfig glib gstreamer gstPluginsBase libdvdnav libdvdread ];
+    [ pkgconfig glib gstreamer gst_plugins_base libdvdnav libdvdread ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
index e2eb25bfb89..4298a88f65e 100644
--- a/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, gstPluginsBase, aalib, cairo
+{ fetchurl, stdenv, pkgconfig, gst_plugins_base, aalib, cairo
 , flac, libjpeg, zlib, speex, libpng, libdv, libcaca
 , libiec61883, libavc1394, taglib, pulseaudio
 , glib, gstreamer, bzip2
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--disable-oss";
 
   buildInputs =
-    [ pkgconfig glib gstreamer gstPluginsBase libavc1394 libiec61883
+    [ pkgconfig glib gstreamer gst_plugins_base libavc1394 libiec61883
       aalib libcaca cairo libdv flac libjpeg libpng pulseaudio speex
       taglib bzip2
     ];
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-ugly/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-ugly/default.nix
index 153ab47fb92..b85fb983880 100644
--- a/pkgs/development/libraries/gstreamer/gst-plugins-ugly/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-ugly/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, glib, gstreamer, gstPluginsBase
+{ fetchurl, stdenv, pkgconfig, glib, gstreamer, gst_plugins_base
 , libmad, libdvdread, libmpeg2, libcdio, a52dec }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ pkgconfig glib gstreamer gstPluginsBase libmad libdvdread a52dec ];
+    [ pkgconfig glib gstreamer gst_plugins_base libmad libdvdread a52dec ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/gstreamer/gst-python/default.nix b/pkgs/development/libraries/gstreamer/gst-python/default.nix
index 98a2a07aa61..fedb44068eb 100644
--- a/pkgs/development/libraries/gstreamer/gst-python/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-python/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, pkgconfig, python, gstreamer
-  , gstPluginsBase, pygtk
+  , gst_plugins_base, pygtk
 }:
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ pkgconfig gstPluginsBase pygtk ]
+    [ pkgconfig gst_plugins_base pygtk ]
     ;
 
   propagatedBuildInputs = [ gstreamer python ];
diff --git a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
index 5ae24178664..98b1f21fb98 100644
--- a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
+++ b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gstreamer, gstPluginsBase, boost, glib, qt4, cmake
+{ stdenv, fetchurl, gstreamer, gst_plugins_base, boost, glib, qt4, cmake
 , automoc4, flex, bison, pkgconfig }:
 
 stdenv.mkDerivation rec {
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g377jlzlwgywgk7nbv9fd0aimv8wpzrymwzdiaffczxv5xvip5h";
   };
 
-  buildInputs = [ gstreamer gstPluginsBase boost glib qt4 ];
+  buildInputs = [ gstreamer gst_plugins_base boost glib qt4 ];
   buildNativeInputs = [ cmake automoc4 flex bison pkgconfig ];
 
   patches = [ ./boost1.48.patch ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e6ea1c59102..f4442b23cc7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3679,10 +3679,32 @@ let
   #GMP ex-satellite, so better keep it near gmp
   mpfr = callPackage ../development/libraries/mpfr { };
 
-  gst_all = recurseIntoAttrs
-    (let callPackage = newScope pkgs.gst_all; in
-     import ../development/libraries/gstreamer { inherit callPackage; }
-    );
+  gst_all = {
+    inherit (pkgs) gstreamer gnonlin gst_python qt_gstreamer;
+    gstPluginsBase = pkgs.gst_plugins_base;
+    gstPluginsBad = pkgs.gst_plugins_bad;
+    gstPluginsGood = pkgs.gst_plugins_good;
+    gstPluginsUgly = pkgs.gst_plugins_ugly;
+    gstFfmpeg = pkgs.gst_ffmpeg;
+  };
+
+  gstreamer = callPackage ../development/libraries/gstreamer/gstreamer {};
+
+  gst_plugins_base = callPackage ../development/libraries/gstreamer/gst-plugins-base {};
+
+  gst_plugins_good = callPackage ../development/libraries/gstreamer/gst-plugins-good {};
+
+  gst_plugins_bad = callPackage ../development/libraries/gstreamer/gst-plugins-bad {};
+
+  gst_plugins_ugly = callPackage ../development/libraries/gstreamer/gst-plugins-ugly {};
+
+  gst_ffmpeg = callPackage ../development/libraries/gstreamer/gst-ffmpeg {};
+
+  gst_python = callPackage ../development/libraries/gstreamer/gst-python {};
+
+  gnonlin = callPackage ../development/libraries/gstreamer/gnonlin {};
+
+  qt_gstreamer = callPackage ../development/libraries/gstreamer/qt-gstreamer {};
 
   gnet = callPackage ../development/libraries/gnet { };