summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorArmijn Hemel2006-01-17 17:03:53 +0000
committerArmijn Hemel2006-01-17 17:03:53 +0000
commit13d2ab032285ce54cb629f54888eeacba9c2ed27 (patch)
tree8baa8d9eb0f41000082c589ada5c91a8a984802d /pkgs
parent79b352856736ba1e96258b6d07101bcd6284471c (diff)
add driver for the Logitech quickcam USB webcam
svn path=/nixpkgs/trunk/; revision=4572
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/os-specific/linux/qc-usb/builder.sh26
-rw-r--r--pkgs/os-specific/linux/qc-usb/default.nix12
-rw-r--r--pkgs/os-specific/linux/qc-usb/quickcam-install.patch91
3 files changed, 129 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/qc-usb/builder.sh b/pkgs/os-specific/linux/qc-usb/builder.sh
new file mode 100644
index 000000000000..a43138fa84fe
--- /dev/null
+++ b/pkgs/os-specific/linux/qc-usb/builder.sh
@@ -0,0 +1,26 @@
+source $stdenv/setup
+
+hashname=$(basename $kernel)
+echo $hashname
+if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then
+  hashname=$(echo "$hashname" | cut -c -32)
+fi
+
+stripHash $kernel
+version=$(echo $strippedName | cut -c 7-)-$hashname
+
+echo "version $version"
+
+export version
+
+ensureDir $out/lib/modules/$version/misc
+
+LINUX_DIR=$kernel/lib/modules/$version/build
+PREFIX=$out
+MODULE_DIR=$out/lib/modules/$version
+
+export LINUX_DIR
+export PREFIX
+export MODULE_DIR
+
+genericBuild
diff --git a/pkgs/os-specific/linux/qc-usb/default.nix b/pkgs/os-specific/linux/qc-usb/default.nix
new file mode 100644
index 000000000000..9d875a21674e
--- /dev/null
+++ b/pkgs/os-specific/linux/qc-usb/default.nix
@@ -0,0 +1,12 @@
+{stdenv, fetchurl, kernel}:
+
+stdenv.mkDerivation {
+  name = "qc-usb-0.6.3";
+  builder = ./builder.sh;
+  src = fetchurl {
+    url = http://surfnet.dl.sourceforge.net/sourceforge/qce-ga/qc-usb-0.6.3.tar.gz;
+    md5 = "3d33380a29a7f92c4eef1f82d61b4ee0";
+  };
+  inherit kernel;
+  patches = [./quickcam-install.patch];
+}
diff --git a/pkgs/os-specific/linux/qc-usb/quickcam-install.patch b/pkgs/os-specific/linux/qc-usb/quickcam-install.patch
new file mode 100644
index 000000000000..136aab5a1d0d
--- /dev/null
+++ b/pkgs/os-specific/linux/qc-usb/quickcam-install.patch
@@ -0,0 +1,91 @@
+diff -ruN qc-usb-0.6.3/Makefile qc-usb-0.6.3.new/Makefile
+--- qc-usb-0.6.3/Makefile	2004-10-21 18:13:11.000000000 +0200
++++ qc-usb-0.6.3.new/Makefile	2006-01-17 18:03:02.000000000 +0100
+@@ -56,8 +56,9 @@
+ endif
+ 
+ ARCH    := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+-INSTALL := $(shell which install)
+-DEPMOD  := $(shell which depmod || which /sbin/depmod || echo "true You should now run depmod")
++#INSTALL := $(shell which install)
++INSTALL := install
++#DEPMOD  := $(shell which depmod || which /sbin/depmod || echo "true You should now run depmod")
+ 
+ # Get VERSION_CODE (from version.h in kernel source directory)
+ VERSION_CODE := $(shell awk '/[ 	]*\#[ 	]*define[ 	]*LINUX_VERSION_CODE[ 	]*/ { print $$3 }' $(LINUX_DIR)/include/linux/version.h|tail -n 1)
+@@ -68,36 +69,36 @@
+ MODULE_NAME := quickcam.o	# for 2.4.x and older
+ endif
+ 
+-.PHONY: help
+-help:
+-	@echo '-=- Logitech QuickCam USB camera driver -=-'
+-	@echo
+-	@echo "Makefile target examples:"
+-	@echo "make all - Compile driver and utilities against current running kernel"
+-	@echo "make all USER_OPT=-DDEBUG - Compile with debugging code and messages"
+-	@echo "make all LINUX_DIR=/usr/src/linux - Compile against specified kernel source"
+-	@echo "make install - Copy driver and utilities into standard locations (needs root)"
+-	@echo "make install PREFIX=/usr - Copy utilities to /usr/bin instead of /usr/local/bin"
+-	@echo "make install MODULE_DIR=/lib/modules/2.4.0 - Copy module to /lib/modules/2.4.0/misc"
+-ifeq ($(VERSION_CODE),132116)
+-	@echo "make patch - Modify kernel source to include the driver for kernel 2.4.20"
+-endif
+-ifeq ($(VERSION_CODE),132615)
+-	@echo "make patch - Modify kernel source to include the driver for kernel 2.6.7"
+-endif
+-ifeq ($(VERSION_CODE),132616)
+-	@echo "make patch - Modify kernel source to include the driver for kernel 2.6.8/2.6.8.1"
+-endif
+-	@echo "make clean - Remove object files from the source directory"
+-	@echo
+-	@echo "Current configuration:"
+-	@echo "Driver source directory (PWD):         $(PWD)"
+-	@echo "Kernel source directory (LINUX_DIR):   $(LINUX_DIR)"
+-	@echo "Module install directory (MODULE_DIR): $(MODULE_DIR)"
+-	@echo "Utility install directory (PREFIX):    $(PREFIX)"
+-	@echo "User options (USER_OPT):               $(USER_OPT)"
+-	@echo "Driver file name (use with insmod):    $(MODULE_NAME)"
+-	@echo "Kernel version code:                   $(VERSION_CODE)"
++#.PHONY: help
++#help:
++	#@echo '-=- Logitech QuickCam USB camera driver -=-'
++	#@echo
++	#@echo "Makefile target examples:"
++	#@echo "make all - Compile driver and utilities against current running kernel"
++	#@echo "make all USER_OPT=-DDEBUG - Compile with debugging code and messages"
++	#@echo "make all LINUX_DIR=/usr/src/linux - Compile against specified kernel source"
++	#@echo "make install - Copy driver and utilities into standard locations (needs root)"
++	#@echo "make install PREFIX=/usr - Copy utilities to /usr/bin instead of /usr/local/bin"
++	#@echo "make install MODULE_DIR=/lib/modules/2.4.0 - Copy module to /lib/modules/2.4.0/misc"
++#ifeq ($(VERSION_CODE),132116)
++	#@echo "make patch - Modify kernel source to include the driver for kernel 2.4.20"
++#endif
++#ifeq ($(VERSION_CODE),132615)
++	#@echo "make patch - Modify kernel source to include the driver for kernel 2.6.7"
++#endif
++#ifeq ($(VERSION_CODE),132616)
++	#@echo "make patch - Modify kernel source to include the driver for kernel 2.6.8/2.6.8.1"
++#endif
++	#@echo "make clean - Remove object files from the source directory"
++	#@echo
++	#@echo "Current configuration:"
++	#@echo "Driver source directory (PWD):         $(PWD)"
++	#@echo "Kernel source directory (LINUX_DIR):   $(LINUX_DIR)"
++	#@echo "Module install directory (MODULE_DIR): $(MODULE_DIR)"
++	#@echo "Utility install directory (PREFIX):    $(PREFIX)"
++	#@echo "User options (USER_OPT):               $(USER_OPT)"
++	#@echo "Driver file name (use with insmod):    $(MODULE_NAME)"
++	#@echo "Kernel version code:                   $(VERSION_CODE)"
+ 
+ all: $(MODULE_NAME) qcset
+ 
+@@ -165,7 +166,7 @@
+ install: $(MODULE_NAME)
+ 	$(INSTALL) -c -D -m 644 $(MODULE_NAME) $(MODULE_DIR)/misc/$(MODULE_NAME)
+ 	$(INSTALL) -c -D -m 755 qcset $(PREFIX)/bin/qcset
+-	-$(DEPMOD) -a
++	#-$(DEPMOD) -a
+ 
+ qcset: qcset.c quickcam.h
+ 	gcc -Wall -O2 -s qcset.c -o qcset -lm