From a64c9e4b8f7a02f4de2686238bb74dc22e122753 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 20 Jun 2008 18:17:27 +0000 Subject: [PATCH] * Some patches to make gorecord more useful. svn path=/nixpkgs/trunk/; revision=12172 --- pkgs/os-specific/linux/wis-go7007/alsa.patch | 20 +++++++++++++++++++ pkgs/os-specific/linux/wis-go7007/default.nix | 18 +++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/os-specific/linux/wis-go7007/alsa.patch diff --git a/pkgs/os-specific/linux/wis-go7007/alsa.patch b/pkgs/os-specific/linux/wis-go7007/alsa.patch new file mode 100644 index 00000000000..64fd9310e77 --- /dev/null +++ b/pkgs/os-specific/linux/wis-go7007/alsa.patch @@ -0,0 +1,20 @@ +diff -rc wis-go7007-linux-0.9.8-orig/apps/gorecord.c wis-go7007-linux-0.9.8/apps/gorecord.c +*** wis-go7007-linux-0.9.8-orig/apps/gorecord.c 2006-04-02 00:35:17.000000000 +0200 +--- wis-go7007-linux-0.9.8/apps/gorecord.c 2008-06-20 19:47:48.000000000 +0200 +*************** +*** 196,202 **** + sprintf(sympath, "/sys/class/sound/pcmC%dD0c/device", i); + if (realpath(sympath, canonpath) == NULL) + continue; +! if (!strcmp(gopath, canonpath)) + break; + } + if (i == 20) { +--- 196,202 ---- + sprintf(sympath, "/sys/class/sound/pcmC%dD0c/device", i); + if (realpath(sympath, canonpath) == NULL) + continue; +! if (!strncmp(gopath, canonpath, strlen(gopath))) + break; + } + if (i == 20) { diff --git a/pkgs/os-specific/linux/wis-go7007/default.nix b/pkgs/os-specific/linux/wis-go7007/default.nix index 150692601af..84397a59378 100644 --- a/pkgs/os-specific/linux/wis-go7007/default.nix +++ b/pkgs/os-specific/linux/wis-go7007/default.nix @@ -1,5 +1,16 @@ {stdenv, fetchurl, kernel, ncurses, fxload}: +let + + # A patch to fix A/V sync, and to allow video to be played + # (e.g. using MPlayer) while the AVI is being recorded. + gorecordAV = fetchurl { + url = http://colabti.org/convertx/patch-av-aviheader.diff; + sha256 = "04qk58qigzwfdnn3mr3pg28qx4r89nlzdhgkvfipz36bsny23r50"; + }; + +in + stdenv.mkDerivation { name = "wis-go7007-0.9.8-${kernel.version}"; @@ -21,10 +32,17 @@ stdenv.mkDerivation { { url = http://home.comcast.net/~bender647/go7007/wis-go7007-2.6.24-no_algo_control.diff; sha256 = "1a7jkcsnzagir3wpsj60pjrr9wgfaqq21jlmq6s0qg9hqg4nzbvf"; } + ] ++ [ + # http://nikosapi.org/wiki/index.php/WIS_Go7007_Linux_driver#wis-streamer_fails_to_find_the_ALSA_audio_node_and_emulated_OSS_device_node + ./alsa.patch ]; buildInputs = [ncurses]; + postPatch = '' + (cd apps && patch < ${gorecordAV}) || false + ''; + preBuild = '' # Urgh, we need the complete kernel sources for some header # files. So unpack the original kernel source tarball and copy