about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/psi
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-02-19 12:46:52 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-02-19 12:46:52 +0100
commit2b5aff10b97e2b97d43ebe17f9af40e0aca672ef (patch)
tree17327141c30122a48788e7cac2c7ce0b5e324696 /pkgs/applications/networking/instant-messengers/psi
parent79875ad9f5533d6678777ca0b6b048e74fd3da11 (diff)
psimedia: Fix building against current kernel headers
http://hydra.nixos.org/build/4127993
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/psi')
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/linux-headers.patch86
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/psimedia.nix6
2 files changed, 89 insertions, 3 deletions
diff --git a/pkgs/applications/networking/instant-messengers/psi/linux-headers.patch b/pkgs/applications/networking/instant-messengers/psi/linux-headers.patch
new file mode 100644
index 0000000000000..a5386b3e111ee
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/psi/linux-headers.patch
@@ -0,0 +1,86 @@
+http://pkgs.fedoraproject.org/gitweb/?p=psimedia.git;a=blob_plain;f=psimedia-remove-v4l.patch;hb=HEAD
+
+--- a/gstprovider/deviceenum/deviceenum_unix.cpp
++++ b/gstprovider/deviceenum/deviceenum_unix.cpp
+@@ -35,7 +35,7 @@
+ # include <sys/stat.h>
+ # include <dirent.h>
+ # include <sys/ioctl.h>
+-# include <linux/videodev.h>
++# include <linux/videodev2.h>
+ #endif
+ 
+ namespace DeviceEnum {
+@@ -478,72 +478,7 @@
+ // v4l detection scheme adapted from PWLib (used by Ekiga/Gnomemeeting)
+ static QList<Item> get_v4l_items()
+ {
+-#ifdef Q_OS_LINUX
+-	QList<Item> out;
+-
+-	QList<V4LName> list = get_v4l_names("/sys/class/video4linux", true);
+-	if(list.isEmpty())
+-		list = get_v4l_names("/proc/video/dev", false);
+-
+-	// if we can't find anything, then do a raw scan for possibilities
+-	if(list.isEmpty())
+-	{
+-		QStringList possible = scan_for_videodevs("/dev");
+-		foreach(QString str, possible)
+-		{
+-			V4LName v;
+-			v.dev = str;
+-			list += v;
+-		}
+-	}
+-
+-	for(int n = 0; n < list.count(); ++n)
+-	{
+-		V4LName &v = list[n];
+-
+-		// if we already have a friendly name then we'll skip the confirm
+-		//   in order to save resources.  the only real drawback here that
+-		//   I can think of is if the device isn't a capture type.  but
+-		//   what does it mean to have a V4L device that isn't capture??
+-		if(v.friendlyName.isEmpty())
+-		{
+-			int fd = open(QFile::encodeName(v.dev).data(), O_RDONLY | O_NONBLOCK);
+-			if(fd == -1)
+-				continue;
+-
+-			// get video capabilities and close
+-			struct video_capability caps;
+-			memset(&caps, 0, sizeof(caps));
+-			int ret = ioctl(fd, VIDIOCGCAP, &caps);
+-			close(fd);
+-			if(ret == -1)
+-				continue;
+-
+-			if(!(caps.type & VID_TYPE_CAPTURE))
+-				continue;
+-
+-			v.friendlyName = caps.name;
+-		}
+-
+-		Item i;
+-		i.type = Item::Video;
+-		i.dir = Item::Input;
+-		i.name = v.friendlyName;
+-		i.driver = "v4l";
+-		i.id = v.dev;
+-
+-		// HACK
+-		if(v.friendlyName == "Labtec Webcam Notebook")
+-			i.explicitCaptureSize = QSize(640, 480);
+-
+-		out += i;
+-	}
+-
+-	return out;
+-#else
+-	// return empty list if non-linux
+ 	return QList<Item>();
+-#endif
+ }
+ 
+ static QList<Item> get_v4l2_items()
diff --git a/pkgs/applications/networking/instant-messengers/psi/psimedia.nix b/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
index 993a018625e8d..aa54053c67f44 100644
--- a/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
+++ b/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
@@ -2,14 +2,14 @@
 , glib, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "psimedia";
+  name = "psimedia-1.0.3";
 
   src = fetchurl {
-    url = "http://delta.affinix.com/download/psimedia/psimedia-1.0.3.tar.bz2";
+    url = "http://delta.affinix.com/download/psimedia/${name}.tar.bz2";
     sha256 = "0fxjdz8afh75gfx2msysb1gss6zx578l3224jvc9jhm99w1ii781";
   };
 
-  patches = [ ./glib-2.32.patch ];
+  patches = [ ./glib-2.32.patch ./linux-headers.patch ];
 
   buildInputs = [ qt4 gstreamer gst_plugins_base liboil speex which glib pkgconfig ];