From b3709689db6af30e4517f678ff3844a32c9382f4 Mon Sep 17 00:00:00 2001
From: "Yury G. Kudryashov" <urkud.urkud@gmail.com>
Date: Wed, 4 Jan 2012 09:05:22 +0000
Subject: [PATCH] Add modemmanager

svn path=/nixpkgs/trunk/; revision=31263
---
 pkgs/build-support/fetchurl/gnome.nix         |  2 +-
 .../tools/networking/modemmanager/default.nix | 23 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  2 ++
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 pkgs/tools/networking/modemmanager/default.nix

diff --git a/pkgs/build-support/fetchurl/gnome.nix b/pkgs/build-support/fetchurl/gnome.nix
index 616c82036019..258b11d850e5 100644
--- a/pkgs/build-support/fetchurl/gnome.nix
+++ b/pkgs/build-support/fetchurl/gnome.nix
@@ -1,6 +1,6 @@
 { fetchurl }:
 
-{ project, major, minor, patchlevel, extension ? "bz2", sha256 }:
+{ project, major, minor, patchlevel ? null, extension ? "bz2", sha256 }:
 
 let
   baseVersion = "${major}.${minor}";
diff --git a/pkgs/tools/networking/modemmanager/default.nix b/pkgs/tools/networking/modemmanager/default.nix
new file mode 100644
index 000000000000..c5164d627708
--- /dev/null
+++ b/pkgs/tools/networking/modemmanager/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl_gnome, udev, polkit, dbus_glib, ppp, intltool, pkgconfig, xz }:
+
+stdenv.mkDerivation rec {
+  name = src.pkgname;
+
+  src = fetchurl_gnome {
+    project = "ModemManager";
+    major = "0"; minor = "5"; extension = "xz";
+    sha256 = "0zvwrni4l21d856nq28khigrhwgrq5cc7nh45zidwjj8q7bsxiz7";
+  };
+
+  buildNativeInputs = [ xz intltool pkgconfig ];
+
+  buildInputs = [ udev polkit dbus_glib ppp ];
+
+  configureFlags = "--with-polkit --with-udev-base-dir=$(out)/lib/udev";
+
+  meta = {
+    description = "WWAN modem manager, part of NetworkManager";
+    maintainers = [ stdenv.lib.maintainers.urkud ];
+    platforms = [ stdenv.lib.platforms.linux ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6ec8211bb652..bab49f41245a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -988,6 +988,8 @@ let
 
   mldonkey = callPackage ../applications/networking/p2p/mldonkey { };
 
+  modemmanager = callPackage ../tools/networking/modemmanager {};
+
   monit = builderDefsPackage ../tools/system/monit {
     inherit openssl flex bison;
   };